Tailwind v4 Converter

Convert Tailwind v3.5 to Tailwind v4.

Loading editor...
Loading editor...

Tailwind v4 Upgrade Guide

CSS Imports

Replace @tailwind directives with @import "tailwindcss";

Renamed Utilities

  • shadow-smshadow-xs
  • shadowshadow-sm
  • drop-shadow-smdrop-shadow-xs
  • drop-shadowdrop-shadow-sm
  • blur-smblur-xs
  • blurblur-sm
  • backdrop-blur-smbackdrop-blur-xs
  • backdrop-blurbackdrop-blur-sm
  • rounded-smrounded-xs
  • roundedrounded-sm
  • outline-noneoutline-hidden
  • ringring-3

Removed Deprecated Utilities

  • bg-opacity-*bg-black/50
  • text-opacity-*text-black/50
  • border-opacity-*border-black/50
  • divide-opacity-*divide-black/50
  • ring-opacity-*ring-black/50
  • placeholder-opacity-*placeholder-black/50
  • flex-shrink-*shrink-*
  • flex-grow-*grow-*
  • overflow-ellipsistext-ellipsis
  • decoration-slicebox-decoration-slice
  • decoration-clonebox-decoration-clone

Default Colors & Widths

  • Border color: gray-200currentColor (specify colors explicitly)
  • Ring width: 3px → 1px (use ring-3 for previous behavior)
  • Ring color: blue-500currentColor (specify colors explicitly)

Variant Stacking Order

v3: right-to-left (first:*:pt-0) → v4: left-to-right (*:first:pt-0)

Space Between Utilities

The selector used by space-x-* and space-y-* has changed. Consider using flex/grid with gap-* instead.

CSS Variables in Arbitrary Values

bg-[--brand-color]bg-(--brand-color)

Utility Prefixes

In v4, prefixes look like variants: tw-flextw:flex

Custom Utilities & Layers

Replace @layer utilities with @utility (requires manual edit)

Manual Updates

Some changes require manual CSS updates that can't be automated:

  • Container Customization: Use @utility container { ... } instead of container config options
  • Preflight Changes: Update placeholder colors, button cursors, dialog margins if needed
  • Custom Layer Definitions: Update @layer utilities to @utility
  • JavaScript Config Files: Use @config "tailwind.config.js" to load them explicitly
  • Theme Values in JavaScript: Use CSS variables instead of resolveConfig