Apply dark mode to the element that itself has dark
class
#12136
RheingoldRiver
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
Hey @RheingoldRiver, thanks for the question! In order to do so, you can add a custom variant that will handle it the way you described. There're two options:
You can see both options in action here - https://play.tailwindcss.com/dGzSg9OMAA |
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
Uh oh!
There was an error while loading. Please reload this page.
-
Right now, you need a parent element to have the
dark
class. But if you want to add a background color depending ondark
parent to the first element in your DOM structure, that means you basically need to create a container that's doing nothing.Could the classes used in the same element as the one with
.dark
on it, get an additional selector that also makes.dark.dark\:whatever-class-here
dark mode?Beta Was this translation helpful? Give feedback.
All reactions