My code is based on Bootstrap v4 and I am facing an issue with creating gradient backgrounds for primary buttons that also use outline. The challenge is to maintain the same height and width for both buttons without the 2px border on the primary buttons. Gradient borders are not supported, so I am seeking a solution to achieve this effect.
https://i.sstatic.net/juZYY.png
In the screenshot above, you can see the problem I am trying to solve. One workaround that I found effective in Chrome is:
background-color: var(--background) !important;
background-image: var(--gradient-background) !important;
border-width: 2px !important;
border-style: solid !important;
border-image-source: var(--gradient-background) !important;
border-image-slice: 1 !important;
This solution works perfectly in Chrome as shown here:
https://i.sstatic.net/cBu5f.png
However, in Firefox, a strange bug occurs resulting in this:
https://i.sstatic.net/TvHAY.png
Addtionally, setting the border color to transparent creates an undesirable effect at the edges in both browsers:
https://i.sstatic.net/6bB7P.png
I have created a messy Codepen which demonstrates the issue with transparent borders: https://codepen.io/anon/pen/ymvYQX
Therefore, I seek assistance with either of the following options:
1) Resolving the Firefox bug to ensure consistent rendering across different browsers.
2) Exploring alternative solutions such as resizing the buttons or finding a better way to create gradient border lines.
Your help is greatly appreciated! Thank you.