Default ringColor has opacity baked into it
See original GitHub issueWhat version of Tailwind CSS are you using?
v3.0.22
What build tool (or framework if it abstracts the build tool) are you using?
postcss 8.4.6, webpack 5.65.0
What version of Node.js are you using?
For example: v17.5.0
What browser are you using?
Edge (Chromium)
What operating system are you using?
macOS
Reproduction URL
https://play.tailwindcss.com/DXtIUnfIC0
Describe your issue
When trying to set the default color for ringColor
, it seems like an opacity of 0.5
is being applied regardless of the defined color. In my example I wanted to set the default ring color to be #000
, but the output ends up becoming --tw-ring-color: rgb(0 0 0 / 0.5);
.
Ideally, I’d like to be able override that default opacity with a defined opacity of my own choosing, or have the color defined for DEFAULT
just override whatever opacity is being applied.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
We’ve come up with a solution here that we think works well and will become the default whenever we hit v4 in the future. A custom default ring color will not have it’s opacity modified at all. Given that this is a breaking change it’s been put behind a future feature flag (
respectDefaultRingColorOpacity
) but will ship with v3.1:Given the above config the default ring color will be
#ff7700
and not have an alpha channel applied to it. Thanks for the report and helping push us to figure this one out!Just revisiting this, spent like 45 minutes talking through it with @thecrypticace and I think we would like to change this so that the
ringOpacity.DEFAULT
value didn’t inject itself into your customringColor.DEFAULT
value but it would be a breaking change, since anyone who has currently customizedringColor.DEFAULT
would now see a different color after updating. It feels a little too breaking to just call it a bug fix to me unfortunately.I think what we’re going to do is feature flag this fix so that anyone who runs into this problem and finds this issue can see that there’s a flag to opt-in to the breaking change early, and then in v4 we can make that the default and mention it in the upgrade guide.
Not sure when we will tackle this but leaving this as a note for myself anyways for when we look at this issue again 👍🏻
In the mean time, changing your
ringOpacity.DEFAULT
as explained earlier is the right way to solve this.