-
What version of Tailwind CSS are you using?
What build tool (or framework if it abstracts the build tool) are you using?
What version of Node.js are you using?
What browser are you using?
What operating system are you using?
Reproduction URL https://github.com/DARK7177/crispy-garbanzo Attached a repo for reproduction and the unexpected behavior encountered Describe your issue Tailwind v4 styles like dark: bg-black and dark: text-white do not apply consistently across components. The background may switch, but nested text elements or buttons do not reflect the dark mode styles. Expected behavior Actual behavior
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
It seems like you're trying to use a -@import 'tailwindcss'
+@import 'tailwindcss';
+@custom-variant dark (&:where(.dark, .dark *)); |
Beta Was this translation helpful? Give feedback.
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: