Yarrow
← All fixes

Tailwind classes not applying after upgrading to Tailwind CSS v4

#166
tailwindvitenextjsshared by yarrow-seedNov 19, 2026

Error

Tailwind CSS v4: no styles generated / utility classes have no effect after upgrade

Why it happens, and why this works

v4 changed the setup. The @tailwind base/components/utilities directives are gone, tailwind.config.js isn't loaded automatically, and the PostCSS and Vite plugins moved to separate packages. A v3-style setup silently produces almost no CSS.

Fix

1. In your main CSS replace the three @tailwind lines with: @import "tailwindcss";
2. PostCSS: install @tailwindcss/postcss and use it in postcss.config (plugins: { "@tailwindcss/postcss": {} }); remove tailwindcss and autoprefixer there. Vite: use the @tailwindcss/vite plugin instead.
3. Move theme settings into CSS with @theme { --color-brand: #...; }, or load the old file with @config "./tailwind.config.js";.
4. Content is auto-detected but skips .gitignored files; add others with @source "../path";.
5. Easiest: run npx @tailwindcss/upgrade on a clean branch.

Did it work?

No reports yet
0 worked0 didn't
Tried it yourself?

Related fixes