Skip to main content
Tailwind CSS v4 includes major architectural changes and several breaking changes. This guide covers everything that’s changed and how to update your code.

Quick start

The fastest way to migrate is using the automated upgrade tool:
This will automatically handle most of the changes listed below. For manual migration or to understand what’s changing, read on.

Configuration changes

CSS-first configuration

The biggest change in v4 is moving from JavaScript configuration to CSS-based configuration using @theme. Before (v3):
After (v4):

Import syntax

Replace Tailwind directives with a single import: Before (v3):
After (v4):

Content configuration

Content detection is now automatic. No configuration needed! Before (v3):
After (v4): No configuration required. Tailwind automatically scans your project. For custom paths:

Utility class changes

Shadow utilities renamed

Shadow utilities have been renamed to provide better granularity.
Inset shadows: Drop shadows:

Border radius utilities renamed

Blur utilities renamed

Positioning utilities

The start-* and end-* utilities are deprecated in favor of more explicit names.

Background position utilities

Object position utilities

Text wrapping

Order utilities

Outline utilities

Removed utilities

These utilities have been removed in v4:
  • max-w-auto and max-h-auto - Generated invalid CSS
  • min-w-none and min-h-none - Invalid CSS values
  • max-w-screen-* - Use container queries or custom values instead

Theme variable changes

Namespace changes

Theme variables now use more intuitive namespaces:

Spacing scale changes

v4 introduces a dynamic spacing scale based on a single --spacing multiplier: Before (v3):
After (v4):

Font weight changes

Font weights are now theme variables instead of static utilities: Before (v3): Static utilities: font-thin, font-bold, etc. After (v4):

Color system changes

P3 color palette

v4 includes a modernized color palette using the P3 color space for wider gamut displays. New color palettes added:
  • mauve
  • olive
  • mist
  • taupe

Color mixing

v4 uses color-mix() for opacity modifiers with automatic fallbacks:

Variant changes

New variants

v4 adds many new variants for modern CSS features:
Media query variants:
  • inverted-colors - Target inverted color mode
  • pointer-none/coarse/fine - Pointer capabilities
  • any-pointer-none/coarse/fine - Any input pointer
State variants:
  • user-valid and user-invalid - User interaction validation states
  • details-content - Style content within details element
  • noscript - Target noscript context
Layout variants:
  • ** - All descendants (replaces [&_*])
  • in-* - Element in a container (replaces some group-[] patterns)

Variant syntax changes

Group and peer variants: Some arbitrary group/peer variants now use in-*: Before (v3):
After (v4):

Custom variants

v3 JavaScript variant configuration moves to CSS: Before (v3):
After (v4):

Plugin system changes

Official plugins

Bundled plugins:
  • @tailwindcss/forms - Updated for v4
  • @tailwindcss/typography - Updated for v4
  • @tailwindcss/aspect-ratio - No longer needed, aspect ratio is built-in
Installation:
Usage (v4):

Custom utilities

v3 JavaScript utilities move to CSS: Before (v3):
After (v4):

Build tool changes

Vite projects

Use the new first-party Vite plugin:

PostCSS projects

Update to the new PostCSS plugin:
Autoprefixer is now built-in and no longer required as a separate plugin.

CLI

The standalone CLI is now available:

New features to explore

After migrating, take advantage of v4’s new features:

Container queries

Built-in container query support:

3D transforms

New 3D transform utilities:

Starting style

Create enter/exit transitions without JavaScript:

Not variant

Style elements when they don’t match a condition:

Text shadow utilities

New built-in text shadow support:

Mask utilities

CSS mask utilities:

Migration checklist

Use this checklist to ensure a complete migration:

Getting help

If you encounter migration issues: