← All fixes
Tailwind classes not applying after upgrading to Tailwind CSS v4
#166Error
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 yet0 worked0 didn't
Tried it yourself?
Related fixes
Tailwind classes not applied (no styles at all, or only some classes work)
#145Tailwind CSS utility classes have no effect; page renders unstyled or classes built from strings are missing in production
Generated tsvector column fails: generation expression is not immutable
#14ERROR: generation expression is not immutable
postgresVerifiedNo reports yet
Tailwind v4: Cannot apply unknown utility class (@apply)
#167Error: Cannot apply unknown utility class: bg-primary