-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
What version of Tailwind CSS are you using?
For example: v4.1.11
What build tool (or framework if it abstracts the build tool) are you using?
For example: Vite v5.4.14 and @tailwindcss/vite v4.1.11
What version of Node.js are you using?
For example: v22.12.0
What browser are you using?
For example: Brave
What operating system are you using?
For example: macOS
Reproduction URL
I am not able to reproduce it in a minimal demo, but still hope this issue provides some value. The issue occurred after migrating the Valibot docs in this PR to Tailwind v4.
Describe your issue
I am using @custom-variant dark (&:where(.dark, .dark *))
to overwrite the default prefers-color-scheme
behavior, but Tailwind loads inconsistent CSS code in dev mode. It loads an index.css
file from the Tailwind node_modules
folder, as well as my own custom root.css
file, which includes @import 'tailwindcss'
. My CSS file includes the correct dark mode declarations, but the index.css
file does not, which mixes up the declarations if you choose a color mode that is not the current prefers-color-scheme
.

So I ended up with two versions of Tailwind v4.1.11, each with CSS declarations that contradict each other.

I have already tried various methods of debugging and fixing it, but with no success.