Lock Tailwind dark mode variant to class-based, never OS media query

Fixkamo-marketing
Shipped
April 18, 2026 at 3:04 AM UTC
Author
Kamo
Commit
f86c91a

Tailwind v4 defaults dark: utilities to respond to prefers-color-scheme (OS preference). The @variant override ensures dark: classes only activate when a .dark class is present in the DOM — the OS can never flip colors on any device.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing