You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today with tailwind, it is not that easy to use the colors stored in a css variable.
If we do this --color-primary: theme(colors.blue.500);, --color-primary: #hexcolor;, --color-primary: rgb (255,255,255) or other color format, we definitely lose the ability to add color opacity.
So, we are forced to store the color in an unconventional way: --color-primary: 59, 130, 246;.
This brings some disappointment: hand conversion, no visual on colors in IDEs
I think it will be interesting to have a function available that allows at build time to convert the most common color format to one that takes advantage of opacity. Like that
/* result to */--color-primary:59,130,246;
After that, in the same way, we can declare the color in tailwind.config
And / or, as in a recent similar library, proposing to create classes on the fly with a syntax like this: border-$color-primary (with opacity support of course)
Thanks a lot for your work!
The text was updated successfully, but these errors were encountered:
Would love to see variables get first class support
Currently using https://github.com/mertasan/tailwindcss-variables which is great for generating and using variables, but overriding means writing css like colors-primary-rgb: 255, 0, 255;
If you're revisiting the color system, please make it work with CSS Color Level 4 (see: #2218) as well.
The way the colors are deconstructed internally makes it absolutely impossible to specify any color using the CSS color() function and have it work with opacity.
What version of @tailwindcss/jit are you using?
0.1.6
What version of Node.js are you using?
14
What browser are you using?
all
What operating system are you using?
linux
Reproduction repository
no need
Today with tailwind, it is not that easy to use the colors stored in a css variable.
If we do this
--color-primary: theme(colors.blue.500);
,--color-primary: #hexcolor;
,--color-primary: rgb (255,255,255)
or other color format, we definitely lose the ability to add color opacity.So, we are forced to store the color in an unconventional way:
--color-primary: 59, 130, 246;
.This brings some disappointment: hand conversion, no visual on colors in IDEs
I think it will be interesting to have a function available that allows at build time to convert the most common color format to one that takes advantage of opacity. Like that
border-$color-primary
(with opacity support of course)Thanks a lot for your work!
The text was updated successfully, but these errors were encountered: