Back to feed
Dev.to
Dev.to
7/11/2026
The original title is "Tailwind CSS v4: What Actually Changed and How I Migrated Two Projects"

The original title is "Tailwind CSS v4: What Actually Changed and How I Migrated Two Projects"

Original: Tailwind CSS v4: What Actually Changed and How I Migrated Two Projects

Short summary

Tailwind CSS v4 is a major rewrite: CSS-first config replaces tailwind.config.js, Lightning CSS replaces PostCSS, and container queries are built-in. The author migrated two production projects and documents what the upgrade codemod misses — custom plugins need rewrites, theme() calls must become var() references, and @apply in third-party components needs testing. Both migrations took a full afternoon but yielded leaner CSS and faster builds.

  • v4 moves config from JS to CSS via @theme block; content paths auto-detected
  • Lightning CSS replaces PostCSS; cold rebuilds dropped from ~8s to under 3s
  • Upgrade codemod misses custom plugin rewrites, theme() calls, and @apply edge cases

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more