November 15, 2026

Tailwind CSS v4 vs v3

Kausar

tailwind-v4-vs-v3-comparison

Tailwind CSS v4 moves configuration from tailwind.config.js into your CSS file, builds several times faster on a new engine, and only supports modern browsers (Safari 16.4+, Chrome 111+, Firefox 128+).

It's a major release with breaking changes, so most v3 projects need a short migration, not just a version bump. For new projects in 2026, v4 is the default. Stay on v3.4 only if you must support older browsers.

Tailwind v3 vs v4 at a glance

Tailwind CSS v3 vs v4 at a glance (updated November 16, 2026)
Feature Tailwind CSS v3 Tailwind CSS v4
First release v3.0, December 9, 2021 v4.0, January 22, 2025
Latest version 3.4.19 (December 10, 2025), on npm's v3-lts tag 4.3.5 (November 6, 2026)
Configuration JavaScript file (tailwind.config.js) CSS, with the @theme directive
Setup in CSS Three @tailwind directives One line: @import "tailwindcss"
Template paths Listed by hand in content Detected automatically
Build tooling PostCSS, plus postcss-import and autoprefixer Built in (Lightning CSS); Vite, PostCSS, webpack and CLI packages
Theme values Resolved in JS Exposed as native CSS variables
Container queries Official plugin Built into core
Browser support Older browsers supported Safari 16.4+, Chrome 111+, Firefox 128+
Sass, Less, Stylus Can be combined Not supported

What changed in Tailwind v4

Configuration lives in CSS. In v3 you customized colors, fonts and breakpoints in a JavaScript object. In v4 you define them as CSS variables inside @theme, and Tailwind generates the matching utilities. Those variables also exist at runtime, so you can read var(--color-brand) in inline styles or animation libraries.

/* v3: src/input.css (theme lives in tailwind.config.js) */
@tailwind base;
@tailwind components;
@tailwind utilities;
 
/* v4: src/app.css (theme lives here) */
@import "tailwindcss";
 
@theme {
  --color-brand: oklch(0.62 0.19 255);
  --font-display: "Inter", sans-serif;
  --breakpoint-3xl: 1920px;
}

That gives you "bg-brand", "font-display" and a "3xl:" breakpoint with no config file.

The engine is much faster. Tailwind Labs' own benchmark on its Catalyst UI kit measured full builds dropping from 378 ms to 100 ms, and incremental rebuilds with no new CSS from 35 ms to 192 µs. You'll notice it most in large projects and in watch mode.

More values work without configuration. Utilities such as "grid-cols-15", "w-17" and "data-current:opacity-100" now work without config entries, because spacing and many other utilities are derived from one scale.

Modern CSS is the foundation. v4 uses cascade layers, @property (registered custom properties) and color-mix() internally. That's why it gained gradient interpolation, opacity modifiers on any color and smoother transitions, and also why it doesn't run in older browsers.

New utilities kept arriving after 4.0. Container queries (@container, @sm:) and 3D transforms (rotate-x-*, perspective-*) shipped in 4.0. Version 4.1 added text-shadow-* and mask-*, 4.2 added logical-property utilities and a webpack plugin, and 4.3 (May 2026) added scrollbar styling. For a feature-by-feature tour of v4, see our Tailwind CSS 4 key updates guide.

Breaking changes that catch v3 projects

The upgrade tool handles most of these. Still, they explain why a site can "look slightly off" after upgrading.

Some defaults changed too. Borders and dividers now use currentColor instead of gray-200. Buttons get the browser's default cursor instead of a pointer. Placeholder text uses the current text color at 50% opacity, and hover: styles only apply on devices that can actually hover. Stacked variants now read left to right, like CSS. If a border, focus ring, or button suddenly looks different after the upgrade, check this list first.

Two corrections to common claims, including an earlier version of this article. Arbitrary properties aren't new in v4: v3 already supported them with syntax like [scroll-snap-align:start]. And v4 isn't fully backward compatible. The renames above are real breaking changes.

Tailwind v3 classes renamed or changed in v4
v3 class v4 class Why it changed
shadow-sm / shadow shadow-xs / shadow-sm Every step in the scale now has a name
rounded-sm / rounded rounded-xs / rounded-sm Same scale rename
blur-sm / blur blur-xs / blur-sm Same scale rename (also drop-shadow, backdrop-blur)
outline-none outline-hidden outline-none now really sets outline-style: none
ring ring-3 Default ring is now 1px and currentColor, not 3px blue
bg-opacity-50 bg-black/50 Separate opacity utilities were removed
!flex flex! The important modifier moves to the end
tw-flex (prefix) tw:flex Prefixes now look like variants
bg-[--brand] bg-(--brand) New shorthand for CSS variables

Should you upgrade from v3 to v4?

Upgrade if you're starting a new project, your users are on current browsers, or slow builds and a large tailwind.config.js are slowing your team down. Most US consumer and SaaS audiences fall into this group.

Stay on v3.4 for now if you must support browsers older than Safari 16.4 or Firefox 128 (common in some enterprise, healthcare and government contracts), you rely on Sass or Less alongside Tailwind, or you depend on a v3 plugin with no v4 version yet. v3.4 still receives occasional patch releases, but all new features land in v4.

How to upgrade from Tailwind v3 to v4

  1. Check your browser targets. Confirm in your analytics that your visitors use Safari 16.4+, Chrome 111+ or Firefox 128+.
  2. Work in a new branch and update Node.js to version 20 or later.
  3. Run the official upgrade tool. It updates dependencies, moves your config into CSS and rewrites class names in your templates:
git checkout -b tailwind-v4
npx @tailwindcss/upgrade
  1. Swap the build plugin if the tool didn't. Use @tailwindcss/vite for Vite, @tailwindcss/postcss for PostCSS (and remove postcss-import and autoprefixer), or @tailwindcss/cli for the command line.
  2. Review the diff. Search for shadow, rounded, blur, ring and outline-none, and check that border colors and focus rings still look right.
  3. Keep a JS config only if you need it. If you can't migrate a complex config yet, load it from CSS with @config "./tailwind.config.js";. Note that safelist, corePlugins and separator aren't supported; use @source inline() to safelist classes.
  4. Test visually in every target browser before you merge.

Tailwind's official upgrade guide lists every change. Using Next.js? Follow our Tailwind CSS 4 setup for Next.js walkthrough.

Get a faster Tailwind site with StaticMania

Upgrading Tailwind is a good moment to fix everything else that slows a site down. StaticMania builds and migrates Tailwind sites for US businesses:

  • Website design: clean, conversion-focused UI and UX built on a consistent Tailwind design system.
  • Website development: fast, SEO-ready sites with Next.js, Astro, and headless CMSs, including v3 to v4 migrations with visual regression testing.
  • AI solutions: AI chatbots, smart search, and custom AI features built into your website or product.

Explore our services or book a free consultation to plan your upgrade.

Frequently asked questions

Tailwind CSS 4.3.5, released November 6, 2026. The newest v3 release is 3.4.19, which npm tags as v3-lts.

No. v4 renames several utilities, changes defaults such as border color and ring width, and drops older browsers. The upgrade tool automates most of the changes.

No. Theme settings go in your CSS file with @theme. You can still load an existing JavaScript config with the @config directive while you migrate.

Tailwind doesn't support it. v4 already handles imports, nesting, variables and vendor prefixes, so Tailwind's docs recommend plain CSS files instead.

For a typical marketing site, usually an afternoon: run the tool, review the diff, fix visual regressions. Large apps with custom plugins or heavy config can take several days.

Share this post