Tailwind CSS v4
Tailwind CSS v4 moved its configuration into CSS. These articles cover where things went and the errors people hit on the way, each tested on the version named at the top.
- Does Tailwind CSS v4 have a config file?Not by default: v4 is configured in CSS with @theme. Where every v3 setting went, how to load an old tailwind.config.js with @config, and when to keep it.
- Tailwind v4 custom colors: how to add them, and why they don’t workAdd a --color-* variable in @theme and every colour utility follows. The four reasons a custom colour silently does nothing, each reproduced.
- Tailwind v4 dark mode: class toggle, system setting and fixesdark: follows prefers-color-scheme by default. One @custom-variant line switches it to a class. A no-flash toggle, and what to check when it fails.
- Tailwind v4 @apply not working: "Cannot apply unknown utility class"Style blocks in Astro, Vue and Svelte and CSS modules need @reference in v4. Custom classes need @utility. The error, the fix and the other causes.