@dark
directive for applying selector only when tailwind's dark mode is active.
#12163
Replies: 2 comments
-
yeah, this will be very usefull. one more example - is a scrollbar customization:
as you can see - now
|
Beta Was this translation helpful? Give feedback.
-
One more case:
as you can see - we want make possible to use any light/dark value if we need and we have dynamic variable where color depends on currently active mode |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The idea is to have a
@dark
directive that would modify the selector to only be applied only when tailwind's dark mode is active, something like:or even something like a media selector, like this:
For me to get a similar result, I added this to the tailwind config:
but this seems wasteful because I'm only going to use this once in the entire page.
I know I could just write out the media query or the class, but it would be more convenient for this to be managed by tailwind.
All the other discussions mentioning something like this were asking for help, and in the most part the replies mentioned that you should write the media query or the class.
Beta Was this translation helpful? Give feedback.
All reactions