-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] Tailwind 1.4.0 support - new color opacity utilities #21
Comments
So, this if fixable with a change on Tailwind's core, but that would be a bit hacky, not sure if Adam would be open to this. I asked him on the Discord and tagged you. If it's not possible to do that, the best bet would be to disable Tailwind's EDIT - Actually I've found a better solution and I think Adam would like it better. Same principle but different implementation. |
tailwindlabs/tailwindcss#1676 (comment) @AndrewBogdanovTSS Answering there, because the PR wasn't the place. Normally, that would eventually be polyfillable, since I plan on generating that type of utility: .text-primary-75 {
color: rgba(32, 32, 32, var(--text-opacity, 0.75));
} Where Ran through .text-primary-75 {
color: rgba(32, 32, 32, 0.75);
color: rgba(32, 32, 32, var(--text-opacity, 0.75));
} If I need to use a CSS variable instead of a hard-coded value for some reason, I can have a double fallback which polyfills the same: /* Generated */
.text-primary {
color: rgba(32, 32, 32, var(--text-opacity, var(--color-primary-opacity-variant, 0.75)));
}
/* Polyfilled */
.text-primary-75 {
color: rgba(32, 32, 32, 0.75);
color: rgba(32, 32, 32, var(--text-opacity, var(--color-primary-opacity-variant, 0.75)));
} Basically, we can do Does that answer your concerns? |
Ok, so in order to have IE11 support we will have to stick to using utilities such as |
Exactly. |
I can live with that 😄 |
Hey @innocenzi |
Hey, it's in stand-by right now because I don't have time for this, unfortunately. Even if you PR'd it, I would probably not have the time to review and test it either... I hope to be able to get back to this project in the coming months, I need to tag |
Thanks for the quick answer. I love the approach of your plugin and don't plan to ditch it. I'll have a look and let you know if I can provide a solution down the road. |
After TailwindCSS introduced new color opacity utilities current approach of opacity and colors generation became not inlined with the official way colors are generated in tailwindCSS.
As a result classes such as
bg-opacity-25
,text-opacity-25
makes no difference to the opacity level.@hawezo I actually have mixed feelings about 1.4.0 color utilities and I like how you implemented it - more, but what can we do here? I guess when using tailwind-theming we should still have an access to full list of tailwind features. But what is really great about your approach with colors is that it's fully polyfillable for IE11 and 1.4.0 colors - are not. So maybe let's discuss what is the best thing that should be done here
The text was updated successfully, but these errors were encountered: