Dark mode is not working #18224
Answered
by
wongjn
MyDataHouse
asked this question in
Help
Dark mode is not working
#18224
-
tailwindcss Version 4.1.8 |
Beta Was this translation helpful? Give feedback.
Answered by
wongjn
Jun 5, 2025
Replies: 1 comment 1 reply
-
It seems like you're trying to use a @import "tailwindcss";
+@custom-variant dark (&:where(.dark, .dark *)); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
MyDataHouse
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems like you're trying to use a
dark
class name to toggle between dark and light mode. By default, Tailwind uses theprefers-color-scheme
media query. So, to use a class name toggle instead, you'd need to configure Tailwind to do so:@import "tailwindcss"; +@custom-variant dark (&:where(.dark, .dark *));