Skip to content

/changelogs/tailwindcss/tailwind-v3-to-v4

Tailwind CSS v3 to v4: renamed utilities and breaking changes

verified onenvironmentlocal · windows 10.0.26200 arm64 · GNU bash 5.3.15 (Git Bash)updated 2026-10-20
tool
Tailwind CSS
versions
3.4 → 4.x

Tailwind CSS v4 is configured in CSS instead of tailwind.config.js, ships its build tools in separate packages, and renames several utility scales. The official upgrade tool, npx @tailwindcss/upgrade, rewrites most of a project automatically; review the diff, because the renamed utilities change how things look.

Setup changes

app.css (v3)
@tailwind base;
@tailwind components;
@tailwind utilities;
app.css (v4)
@import "tailwindcss";

@theme {
  --color-brand: #0e7c86;
  --font-display: "Inter", sans-serif;
}
v3v4
tailwindcss as a PostCSS plugin@tailwindcss/postcss
npx tailwindcss -i in.css -o out.cssnpx @tailwindcss/cli -i in.css -o out.css
PostCSS in Vite projects@tailwindcss/vite plugin
tailwind.config.js theme.extend@theme variables in CSS (a JS config can still be loaded with @config)
postcss-import, autoprefixerbuilt in, remove them

Renamed utilities

v3v4
shadow-smshadow-xs
shadowshadow-sm
drop-shadow-sm / drop-shadowdrop-shadow-xs / drop-shadow-sm
blur-sm / blurblur-xs / blur-sm
backdrop-blur-sm / backdrop-blurbackdrop-blur-xs / backdrop-blur-sm
rounded-sm / roundedrounded-xs / rounded-sm
outline-noneoutline-hidden (outline-none now really sets outline-style: none)
ring (3px)ring-3 (ring is 1px in v4)
bg-opacity-50, text-opacity-*, …opacity modifiers: bg-black/50
flex-shrink-* / flex-grow-*shrink-* / grow-*
overflow-ellipsistext-ellipsis
bg-gradient-to-rbg-linear-to-r

See the new names compiled

bash
npm init -y >/dev/null
npm install --silent --no-audit --no-fund tailwindcss@4 @tailwindcss/cli@4 >/dev/null 2>&1
echo '@import "tailwindcss";' > in.css
echo '<div class="shadow-xs rounded-xs ring-3 outline-hidden bg-linear-to-r"></div>' > index.html
npx @tailwindcss/cli -i in.css -o out.css 2>/dev/null
grep -oE '^\s*\.(shadow-xs|rounded-xs|ring-3|outline-hidden|bg-linear-to-r)' out.css | sed 's/^ *//' | sort -u

Output

.bg-linear-to-r
.outline-hidden
.ring-3
.rounded-xs
.shadow-xs

Other behaviour changes

  • Border colour: border and divide use currentColor instead of gray-200; add border-gray-200 where you relied on the old default.
  • Variants stack left to right: *:first:pt-0 instead of v3's right-to-left order.
  • Hover only applies on devices that support hover (@media (hover: hover)).
  • Browsers: v4 depends on @property and color-mix() and targets Safari 16.4, Chrome 111 and Firefox 128. Stay on v3.4 if you must support older browsers.

Sources