How to update CSS variable in @theme (light/dark etc) #16275
-
I couldn't find any docs or guides. Let's say I have this
How to control variable value depending on something? I need to change |
Beta Was this translation helpful? Give feedback.
Answered by
wongjn
Feb 5, 2025
Replies: 2 comments 1 reply
-
Update them like any CSS variable: @theme {
--color-background: var(--background);
--color-foreground: var(--foreground);
}
@layer theme {
[data-theme="dark] {
--foreground: …;
}
} Or if the redefinition might not be on the @theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
}
@layer theme {
[data-theme="dark] {
--foreground: …;
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
My god @wongjn THANK YOU for |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is documentated at https://tailwindcss.com/docs/theme#referencing-other-variables