Replies: 1 comment 7 replies
-
You could consider using theme token namespace for @custom-variant dark (&:where(.dark, .dark *));
@theme {
--background-color-button-default: #eb6bd8;
}
@layer base {
* {
@variant dark {
--background-color-button-default: #8e0d7a;
}
}
} <div class="bg-button-default"> |
Beta Was this translation helpful? Give feedback.
7 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.
-
Imagine I want to have several custom utility classes - such as
button-default-background
- and also override them during dark mode (because I suppose this is one approach to create apps which support themes).Now I could do it in following way based on tailwind 4 docs:
But it would generate utilities like
bg-button-default-background
andtext-button-default-background
right? However having value named:text-button-default-background
seems a bit strange (usage of text and background in the same word) isn't it?So what is the best way to achieve what I want using tailwind 4 primitives?
Beta Was this translation helpful? Give feedback.
All reactions