Replies: 1 comment
-
You could consider having sort of process that runs after Tailwind that detects the unused CSS variables and removes them as needed. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
In Tailwind v4, I've created a theme, and I'm wondering how Tailwind could detect that some variables need to be removed in the final CSS when they are set under... let's say
[data-theme="xx"]
.Here is a minimal example:
Now let's say in my code I only use a class that uses
color-background-accent-primary
. This variable will be in the generated CSS, but so willcolor-background-accent-secondary
because it's defined in the [data-theme] selectors.Now imagine I have more themes than these two, and also more variables. I'll end up with too many unused variables. Is there a better way to handle this?
Beta Was this translation helpful? Give feedback.
All reactions