Skip to content

<utility>-<color>/<opacity> syntax doesn't work if your color is a css custom property (var(--color)) on tailwindcss@3.4.4 #13981

Answered by adamwathan
vhoyer asked this question in Help
Discussion options

You must be logged in to vote

Hey! See the docs on using CSS variables for colors here:

https://tailwindcss.com/docs/customizing-colors#using-css-variables

You need to define things a bit differently if you want this to work.

Good news is in v4 we are switching to color-mix like in your example, which makes this unnecessary. It's a breaking change though that doesn't work in older browsers so we can't bring that change to v3.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@vhoyer
Comment options

@adamwathan
Comment options

Answer selected by vhoyer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #13980 on July 10, 2024 15:04.