Tailwind v4 in production: what changed for us
CSS-first configuration, native cascade layers, and smaller output bundles. Practical notes from migrating client builds to Tailwind v4.
Tailwind v4 moved to a CSS-first configuration model, and we have now migrated several live client sites onto it. The short summary: less config boilerplate, faster builds, and smaller shipped stylesheets.
What changed in daily work
Configuration now lives directly in your main CSS file. Instead of maintaining a separate tailwind.config.js, design tokens such as colors, font families, radii, and spacing sit inside a @theme block right next to the CSS that consumes them.
What works better in production
- Native cascade layers: cleaner base resets and component overrides without specificity hacks
- Smaller compiled CSS: unused utilities are pruned cleanly at build time
- Direct Vite integration: using
@tailwindcss/viteremoves extra PostCSS configuration files from static Astro and React setups
Migration details to watch
If a legacy codebase relies on darkMode: 'class', replace it with a @custom-variant rule in CSS. Custom plugins or non-standard color keys usually take a few one-line adjustments rather than a rewrite.
For a static Astro build, migrating typically takes an afternoon, and the payoff is a simpler build setup with fewer moving parts to maintain over time.