Tailwind v3 to v4 Migration Guide (2026): Config, Breaking Changes and Upgrade Steps
By Eoin Villarin, 2025-12-10, updated 2026-11-14
Tailwind CSS v4.3.5 is the latest release. Here is what changed from v3, how the CSS-first Tailwind v4 config works, every breaking rename and a step-by-step migration with fixes for common errors.
How do I migrate from Tailwind CSS v3 to v4, and what is the latest version?
The latest Tailwind CSS version is v4.3.5, released on November 6, 2026. To migrate from v3, run npx @tailwindcss/upgrade on a new branch with Node.js 20 or higher, switch to @tailwindcss/vite or @tailwindcss/postcss, replace the @tailwind directives with @import "tailwindcss" and move your config into an @theme block (or load the old file with @config). Then check renamed utilities, the new currentColor border and ring defaults, and confirm your users run Safari 16.4+, Chrome 111+ or Firefox 128+.
Key takeaways
- The latest Tailwind CSS release is v4.3.5 (November 6, 2026); v4.0 shipped January 22, 2025, v4.2 on February 18, 2026 and v4.3 on May 8, 2026.
- Run npx @tailwindcss/upgrade on a branch with Node.js 20+ to update dependencies, move config to CSS and rewrite renamed classes.
- Tailwind v4 config lives in CSS: @import "tailwindcss" plus an @theme block, with @config to keep a legacy tailwind.config.js.
- Classes inside @layer utilities are no longer registered as utilities in v4; define them with @utility so variants work.
- Watch the quiet changes: shadow-sm is now shadow-xs, outline-none is outline-hidden, and borders and rings default to currentColor.
Updated November 14, 2026. The latest version of Tailwind CSS is v4.3.5, released on November 6, 2026. Tailwind v4.0 shipped on January 22, 2025, and the 4.x line has had three feature releases since then (4.1, 4.2 and 4.3). Version 3 is still maintained on a separate v3-lts npm tag, currently 3.4.19.
Should you upgrade from v3 to v4? For most projects, yes. Start every new project on v4, and move active v3 projects over in a branch with the official upgrade tool, npx @tailwindcss/upgrade. The two real reasons to wait are browser support (v4 targets Safari 16.4+, Chrome 111+ and Firefox 128+) and a build that depends on Sass, Less or Stylus, which v4 does not support.
This guide is written for the questions people actually search for: what changed between Tailwind 3 and 4, how the Tailwind v4 config works without tailwind.config.js, what happened to layers, which classes were renamed, and how to migrate without leaving visual bugs behind. Every fact here links back to the official Tailwind docs, blog or GitHub releases in the Sources section at the end.
Tailwind CSS version history: 4.0 to 4.3.5
If you searched for "tailwindcss latest version", this table is the short answer. Dates come from the official GitHub releases and the Tailwind blog.
| Version | Released | What it added |
|---|---|---|
| v4.0 | January 22, 2025 | Ground-up rewrite, CSS-first config with @theme, automatic content detection, native cascade layers, container queries in core, 3D transforms, OKLCH colors |
| v4.1 | April 2025 (4.1.0 tagged April 1) | text-shadow-*, mask-*, colored drop shadows, pointer-fine and pointer-coarse, user-valid and user-invalid, @source not, @source inline(), better fallbacks for older browsers |
| v4.2 | February 18, 2026 | Mauve, olive, mist and taupe palettes, logical property utilities, font-features-*, the @tailwindcss/webpack loader |
| v4.3 | May 8, 2026 | Scrollbar utilities, @container-size, zoom-*, tab-*, stacked and compound @variant, --default() in custom utilities |
| v4.3.4 | November 2, 2026 | New @tailwindcss/turbopack loader for Next.js, plus fixes |
| v4.3.5 | November 6, 2026 | Bug fixes (current latest on npm) |
| v3.4.19 | December 10, 2025 | Latest v3 release, published on the v3-lts npm tag |
To check what your own project runs, look at the tailwindcss entry in package.json or run npm ls tailwindcss. If it starts with 3, everything below applies to you.
What changed in Tailwind v4?
Tailwind v4 is not a small version bump. The engine was rewritten, the configuration moved from JavaScript into CSS, and the generated CSS now leans on modern browser features such as cascade layers, registered custom properties with @property and color-mix(). Here is the summary in one table.
| Area | What changed in v4 | Why it matters |
|---|---|---|
| Engine | Rewritten from scratch, with Lightning CSS handling imports, nesting and vendor prefixes | Faster builds and no need for autoprefixer or postcss-import |
| Entry point | One line: @import "tailwindcss"; | Replaces the three @tailwind directives |
| Configuration | Design tokens live in CSS inside @theme | tailwind.config.js is optional and no longer detected automatically |
| Content paths | Automatic source detection that respects .gitignore | No content array; use @source for edge cases |
| Theme values | Every token is emitted as a real CSS variable | Use var(--color-brand-500) anywhere, no resolveConfig |
| Layers | Native CSS @layer theme, base, components, utilities | Custom utilities move to @utility |
| Build tools | Separate packages: @tailwindcss/vite, @tailwindcss/postcss, @tailwindcss/cli, and later @tailwindcss/webpack and @tailwindcss/turbopack | Your build config must change |
| Defaults | Border, divide and ring colors default to currentColor; ring is 1px | The most common source of visual bugs after upgrading |
| Utility names | Shadow, blur, radius and drop shadow scales shifted down one step | shadow-sm is now shadow-xs, and so on |
| Browsers | Safari 16.4+, Chrome 111+, Firefox 128+ | Older browsers should stay on v3.4 |
Tailwind v4 performance numbers
The Tailwind team benchmarked v4.0 against v3.4 on their Catalyst UI kit in the official launch post. Full builds went from 378ms to 100ms, incremental rebuilds that add new CSS went from 44ms to 5ms, and incremental rebuilds with no new CSS went from 35ms to 192 microseconds. The headline of that post says "up to 5x faster" full builds and "over 100x faster" incremental builds, but the measured numbers in its own table are about 3.8x, 8.8x and 182x, so treat those as the realistic figures. In practice, hot reload feels instant even on large templates.
Since then, the v4.2 release added the @tailwindcss/webpack loader, which skips PostCSS. On the tailwindcss.com docs site with Next.js and Turbopack, Tailwind measured a build of 429ms with the loader against 932ms with @tailwindcss/postcss, about 2.17x faster.
Tailwind v3 vs v4: side by side comparison
If you only want the difference between Tailwind v3 and v4 at a glance, this is it.
| Topic | Tailwind v3 | Tailwind v4 |
|---|---|---|
| CSS entry | @tailwind base; @tailwind components; @tailwind utilities; | @import "tailwindcss"; |
| Config file | tailwind.config.js, detected automatically | @theme in CSS; JS config only via @config |
| Template paths | Manual content: [...] array | Automatic, plus @source |
| Safelist | safelist option | @source inline("...") |
| Custom utilities | Classes inside @layer utilities | @utility name { ... } |
| Custom variants | JS plugin with addVariant | @custom-variant in CSS |
| Plugins | plugins: [require(...)] in config | @plugin "..."; in CSS |
| PostCSS plugin | tailwindcss plus autoprefixer | @tailwindcss/postcss only |
| Vite | PostCSS setup | First-party @tailwindcss/vite plugin |
| CLI | npx tailwindcss | npx @tailwindcss/cli |
| Colors | RGB palette | OKLCH palette (wider P3 gamut) |
| Opacity | bg-opacity-50 | bg-black/50 modifier |
| Container queries | Plugin | Built in: @container, @sm:, @max-md: |
| Variable shorthand | bg-[--brand] | bg-(--brand) |
| Important | !flex | flex! |
| Prefix | tw-flex | tw:flex |
| Variant order | Applied right to left | Applied left to right |
| Hover | Applies on tap on touch devices | Only inside @media (hover: hover) |
| Preprocessors | Sass and Less possible | Not supported |
| Browsers | Wide support | Safari 16.4+, Chrome 111+, Firefox 128+ |
How to migrate from Tailwind v3 to v4, step by step
This is the process I follow on client projects. On a typical marketing site or mid-size app it takes a few hours, and most of that time goes into visual review, not code.
- Check your browsers first. Open your analytics and confirm that almost all real traffic uses Safari 16.4+, Chrome 111+ or Firefox 128+. If not, stop here and stay on v3.4.
- Create a branch and update Node.js. The upgrade tool needs Node.js 20 or higher.
- Run the official upgrade tool. It updates your dependencies, migrates your JavaScript config into CSS and rewrites renamed classes in your template files.
- Switch your build integration. Vite projects use
@tailwindcss/vite, PostCSS projects use@tailwindcss/postcss, CLI users move to@tailwindcss/cli, and webpack or Next.js projects can use@tailwindcss/webpackor the new@tailwindcss/turbopackloader. Removeautoprefixerandpostcss-import. - Check the CSS entry file. It should start with
@import "tailwindcss";followed by your@themeblock. - Review the diff file by file. Class names built from strings, such as
"shadow-" + size, cannot be rewritten by any tool. Search for them by hand. - Fix component-scoped styles. Vue, Svelte and Astro
<style>blocks and CSS modules need@referenceto use@applywith your theme. - Compare every key template in the browser at mobile and desktop widths. Screenshot tests are ideal, because the renamed shadows and new border colors are easy to miss by eye.
The commands and config files for the most common setups:
npx @tailwindcss/upgrade
If the tool did not already switch your build packages, install the one that matches your setup. For Vite:
npm install tailwindcss @tailwindcss/vite
For PostCSS setups such as Next.js, install the new plugin and remove the two packages v4 no longer needs:
npm install tailwindcss @tailwindcss/postcss
npm uninstall autoprefixer postcss-import
For Vite, add the plugin in vite.config.ts:
import { defineConfig } from "vite";
import tailwindcss from "@tailwindcss/vite";
export default defineConfig({
plugins: [tailwindcss()],
});
For PostCSS, the plugin name changes in postcss.config.mjs:
export default {
plugins: {
"@tailwindcss/postcss": {},
},
};
Then replace the three old directives in your main stylesheet, @tailwind base;, @tailwind components; and @tailwind utilities;, with a single line:
@import "tailwindcss";
If you are also changing build tools during the upgrade, my comparison of Vite and webpack explains which one I would choose for a new project.
Tailwind v4 config: how CSS-first configuration works
The biggest mental shift in v4 is where configuration lives. There is no tailwind.config.js by default. You import Tailwind in your main CSS file and define design tokens as CSS variables inside an @theme block. Each variable belongs to a namespace, and the namespace decides which utilities it creates. For example, --color-brand-500 gives you bg-brand-500, text-brand-500, border-brand-500 and every other color utility.
A minimal Tailwind v4 config with @theme
@import "tailwindcss";
@theme {
--font-display: "Satoshi", sans-serif;
--color-brand-500: oklch(0.62 0.21 285);
--color-brand-900: oklch(0.28 0.09 280);
--breakpoint-3xl: 120rem;
--radius-card: 1.25rem;
--shadow-soft: 0 8px 30px rgb(0 0 0 / 0.08);
--ease-snappy: cubic-bezier(0.2, 0, 0, 1);
--animate-fade-in: fade-in 0.3s ease-out;
@keyframes fade-in {
from { opacity: 0; }
to { opacity: 1; }
}
}
That one block gives you font-display, bg-brand-500, a 3xl: breakpoint, rounded-card, shadow-soft, ease-snappy and animate-fade-in, with no other setup. The main namespaces are:
--color-*for color utilities such asbg-*,text-*andfill-*--font-*,--text-*,--font-weight-*,--tracking-*and--leading-*for typography--breakpoint-*for responsive variants likesm:andlg:--container-*for container query variants like@sm:and sizes likemax-w-md--spacingfor the base spacing unit behindp-*,m-*,w-*andgap-*--radius-*,--shadow-*,--inset-shadow-*,--drop-shadow-*and--blur-*for effects--ease-*and--animate-*for motion
Extending, overriding and resetting the theme
Adding a new variable extends the default theme. Redefining an existing one, such as --breakpoint-sm: 30rem;, overrides it. To remove a whole default namespace, set it to initial first, for example --color-*: initial; followed by only your brand colors. --*: initial; removes the entire default theme so only your own tokens remain. This replaces the v3 pattern of choosing between theme and theme.extend.
Use @theme only for tokens that should create utilities. Plain CSS variables that should not create classes still belong in :root. @theme blocks must be at the top level, not inside a selector or media query.
@theme inline and @theme static
When a theme variable points to another variable, for example a font loaded by Next.js as --font-inter, use @theme inline { --font-sans: var(--font-inter); }. The generated utility then uses the value directly instead of resolving the variable where it was defined, which avoids unexpected fallbacks. By default Tailwind only outputs the CSS variables you actually use; @theme static outputs all of them, which helps when JavaScript reads tokens at runtime.
Keeping tailwind.config.js with @config
If your JavaScript config is too large to move in one go, keep it. JavaScript configs still work in v4, but they are not detected automatically. Load it explicitly at the top of your CSS:
@import "tailwindcss";
@config "../../tailwind.config.js";
@theme {
--color-brand-500: oklch(0.62 0.21 285);
}
You can mix @config with @theme while you move tokens across in stages. Values defined in CSS are merged where possible and otherwise win over the JavaScript config. Three options are not supported at all in v4: corePlugins, safelist and separator. Safelisting now uses @source inline(), which supports brace expansion such as @source inline("{hover:,}bg-brand-{500,900}");. The resolveConfig helper was removed, so read tokens from CSS variables instead.
Dark mode and custom variants with @custom-variant
In v3 a class-based dark mode was a config setting. In v4 it is one line of CSS. The same directive replaces most small JavaScript variant plugins:
@import "tailwindcss";
@custom-variant dark (&:where(.dark, .dark *));
@custom-variant theme-midnight (&:where([data-theme="midnight"] *));
@plugin "@tailwindcss/typography";
@source "../node_modules/@acme/ui";
@source not "../src/legacy";
Now dark:bg-gray-900 responds to a .dark class and theme-midnight:bg-black responds to a data attribute. @plugin loads a JavaScript plugin such as typography or forms, and @source adds or excludes folders that automatic detection would otherwise miss or scan.
Tailwind v4 layers, @utility and @layer explained
Tailwind v4 uses real CSS cascade layers. The default import expands to @layer theme, base, components, utilities; followed by the theme, Preflight and utilities files, each placed in its own layer. Because utilities sit in the last layer, a utility class always beats a component class without any specificity tricks.
What changed for you as an author:
@layer basestill works for default element styles, such as heading sizes usingvar(--text-2xl).@layer componentsstill works for classes like.cardor third-party overrides, and utilities can still override them, soclass="card rounded-none"behaves as expected.@layer utilitiesno longer registers custom classes. In v3, anything inside it became a utility that worked withhover:andmd:. In v4 you must use@utilityinstead.
In v3 you wrote a custom utility like this:
@layer utilities {
.content-auto {
content-visibility: auto;
}
}
In v4 the same class, plus a functional utility that reads values from your theme, looks like this:
@utility content-auto {
content-visibility: auto;
}
@theme {
--tab-size-2: 2;
--tab-size-4: 4;
--tab-size-github: 8;
}
@utility tab-* {
tab-size: --value(--tab-size-*);
}
The functional form generates tab-2, tab-4 and tab-github from your theme. --value() can also accept bare numbers, literal keywords and arbitrary values, and since v4.3 it supports --default() so a bare class like tab gets a fallback value. Custom utilities are sorted by how many properties they set, so a @utility btn can still be overridden by single-purpose utilities.
If you want to drop Preflight, import the layers yourself instead of the single @import "tailwindcss"; line: declare the four layers, then import tailwindcss/theme.css into layer(theme) and tailwindcss/utilities.css into layer(utilities), and leave out tailwindcss/preflight.css.
Breaking renames and removals: before and after
The upgrade tool rewrites most of these automatically, but it helps to know them when you review the diff or write new code. The size scales for shadows, blur and radius shifted down one step so that every scale has a named value.
| Tailwind v3 | Tailwind v4 | Note |
|---|---|---|
shadow-sm | shadow-xs | Scale moved down one step |
shadow | shadow-sm | Bare shadow still exists but maps to the old look |
drop-shadow-sm | drop-shadow-xs | |
drop-shadow | drop-shadow-sm | |
blur-sm | blur-xs | |
blur | blur-sm | |
backdrop-blur-sm | backdrop-blur-xs | |
backdrop-blur | backdrop-blur-sm | |
rounded-sm | rounded-xs | |
rounded | rounded-sm | |
outline-none | outline-hidden | New outline-none sets outline-style: none |
ring | ring-3 | Bare ring is now 1px |
outline outline-2 | outline-2 | Width utilities now set a solid style |
bg-opacity-50 (and text, border, divide, ring, placeholder) | bg-black/50 | Opacity utilities removed |
flex-shrink-0, flex-grow | shrink-0, grow | Old names removed |
overflow-ellipsis | text-ellipsis | |
decoration-slice, decoration-clone | box-decoration-slice, box-decoration-clone | |
bg-gradient-to-r | bg-linear-to-r | Also new bg-linear-45, bg-radial, bg-conic |
bg-[--brand] | bg-(--brand) | Parentheses for CSS variables |
grid-cols-[max-content,auto] | grid-cols-[max-content_auto] | Commas no longer become spaces |
!flex | flex! | Important goes at the end |
first:*:pt-0 | *:first:pt-0 | Variants now read left to right |
tw-flex (prefix) | tw:flex | Set with @import "tailwindcss" prefix(tw); |
focus:transform-none | focus:scale-none | Transforms use individual CSS properties |
theme(screens.xl) | theme(--breakpoint-xl) or var(--breakpoint-xl) | theme() is deprecated |
The full list lives in the official Tailwind upgrade guide, which is worth keeping open while you review the diff.
Default style changes that cause visual bugs
Renamed classes fail loudly in review. Changed defaults fail quietly, because the class names stay the same and only the look changes. These are the ones I check on every migration:
- Border and divide color changed from
gray-200tocurrentColor. A plainborderon dark text now draws a dark line. Add an explicit color likeborder-gray-200. - Ring changed from 3px
blue-500to 1pxcurrentColor. Usering-3 ring-blue-500for the old focus ring. - Placeholder text now uses the current text color at 50% opacity instead of
gray-400. - Buttons now use
cursor: defaultinstead of a pointer. - Dialogs have their margins reset, so add
margin: autoif you relied on centered dialogs. - The
hiddenattribute now wins over display classes such asflexorblock. space-y-*anddivide-y-*now use a:not(:last-child)selector, which can change spacing on inline elements. Flex or grid withgapis the safer replacement.hover:only applies on devices whose primary input supports hover, so tap-to-reveal patterns on phones stop working.transitionandtransition-colorsnow includeoutline-color, which can animate focus outlines unexpectedly.- Gradients: a variant no longer resets the whole gradient, so use
via-noneto remove a middle stop in dark mode. container: thecenterandpaddingoptions are gone; customize it with@utility container.
If you need a large site to look exactly like v3 while you clean up, the upgrade guide gives compatibility snippets. Use them as a temporary bridge, not a permanent setup:
@layer base {
*,
::after,
::before,
::backdrop,
::file-selector-button {
border-color: var(--color-gray-200, currentColor);
}
button:not(:disabled),
[role="button"]:not(:disabled) {
cursor: pointer;
}
}
@custom-variant hover (&:hover);
Common Tailwind v4 migration errors and fixes
| Error or symptom | Cause | Fix |
|---|---|---|
"It looks like you're trying to use tailwindcss directly as a PostCSS plugin" | The PostCSS plugin moved to its own package | Install @tailwindcss/postcss and use it as the plugin name in your PostCSS config |
| "Cannot apply unknown utility class" | @apply inside a Vue, Svelte or Astro <style> block or a CSS module that cannot see your theme | Add @reference "../app.css"; at the top, or use var(--color-blue-500) directly |
| Some classes have no styles in production | The files are in .gitignore or node_modules, or class names are built from strings | Add the folder with @source, safelist with @source inline(), and write full class names |
Custom classes ignore hover: and md: | They are defined inside @layer utilities | Move them to @utility |
| Config changes have no effect | tailwind.config.js is no longer detected | Load it with @config, or move the tokens into @theme |
| Sass build breaks after upgrading | v4 is not designed for Sass, Less or Stylus | Use plain CSS files; Tailwind handles imports, nesting and variables |
Script calling resolveConfig crashes | The function was removed | Read tokens with getComputedStyle(document.documentElement).getPropertyValue("--shadow-xl") |
| Borders look darker, focus rings look thin | New currentColor and 1px defaults | Add explicit colors and ring-3, or use the compatibility snippet above |
| Upgrade tool fails to start | Node.js older than version 20 | Update Node.js, then run it again on a clean branch |
Vue, Svelte and CSS module styles are processed separately from your main stylesheet, so Tailwind runs once per file. The Tailwind docs recommend keeping styling in utility classes where possible and using @reference only where you really need @apply.
Who should wait before upgrading to Tailwind v4
v4 is stable and mature, but there are good reasons to hold off on an existing project:
- Sites that must support older browsers. Core features depend on
@propertyandcolor-mix(). v4.1 added fallbacks that help older Safari and Firefox, but the official target is still Safari 16.4+, Chrome 111+ and Firefox 128+. Enterprise intranets, kiosks and old embedded webviews are where I still find older engines. - Projects built around Sass, Less or Stylus. You will need to move those files to plain CSS first.
- Large design systems with many custom JavaScript plugins. Upgrade the engine with
@configfirst, then migrate tokens to@themeover several releases. - Stable sites that rarely change. There is little benefit in touching a working build. Upgrade the next time you do significant front-end work.
- Teams in the middle of a launch. Do the migration in a quiet sprint with time for visual review.
Check your analytics before you check your codebase. If a meaningful share of paying customers use browsers older than Safari 16.4, the upgrade can wait no matter how fast the new engine is.
Everyone else, especially new projects, should be on v4. There is no reason to start a project on v3 in 2026, and the CSS-first setup is simpler to learn. When I build sites as part of my web design service, new builds start on the latest Tailwind v4 release, and for larger apps through my custom web development service I plan migrations like this one with screenshot tests from the start.
Which new v4 features are worth using after you migrate
Once the upgrade is done, a few features replace custom CSS in most projects:
- Container queries in core: mark a parent with
@containerand use@sm:,@lg:or@max-md:on children. Since v4.3,@container-sizealso enables height-based units likecqb. - Dynamic values:
grid-cols-15,w-17ordata-current:opacity-100work without configuration or square brackets, because spacing is calculated from a single--spacingvariable. - 3D transforms:
rotate-x-*,rotate-y-*,perspective-*andtransform-3d. - Gradients:
bg-linear-45,bg-radialandbg-conicwith interpolation modifiers such as/oklch. - Enter transitions: the
starting:variant uses@starting-style, though browser support is still limited. - v4.1 extras:
text-shadow-*,mask-*, colored drop shadows anduser-invalid:for friendlier form validation. - v4.3 extras:
scrollbar-thin,scrollbar-thumb-*,scrollbar-gutter-stable,zoom-*andtab-*.
If you maintain a component library, my guide to building a design system with React and Storybook shows how tokens like these feed into shared components. For layout, my guides to CSS subgrid and view transitions and anchor positioning pair well with v4.
Frequently asked questions
What is the latest version of Tailwind CSS?
As of November 14, 2026, the latest version of Tailwind CSS is v4.3.5, released on November 6, 2026. The last feature release was v4.3 on May 8, 2026. Version 3 is still published on the v3-lts npm tag, where the latest release is 3.4.19 from December 10, 2025.
What is the difference between Tailwind v3 and v4?
Tailwind v4 is a rewrite with a faster engine, configuration in CSS through @theme instead of tailwind.config.js, automatic content detection, native cascade layers and a single @import "tailwindcss"; entry. It also renamed several utilities, changed border and ring defaults to currentColor, moved build integrations into separate packages and requires Safari 16.4+, Chrome 111+ and Firefox 128+.
How do I migrate from Tailwind CSS 3 to 4?
Create a branch, make sure you run Node.js 20 or higher and run npx @tailwindcss/upgrade. The tool updates dependencies, migrates your config to CSS and rewrites renamed classes. Then switch to @tailwindcss/vite or @tailwindcss/postcss, add @reference to component style blocks that use @apply, search for dynamic class names and compare every key page visually.
Where is the Tailwind v4 config file?
There is no separate config file by default. The Tailwind v4 config lives in your main CSS file: @import "tailwindcss"; followed by an @theme block with variables such as --color-brand-500 or --breakpoint-3xl. Custom utilities use @utility, custom variants use @custom-variant and plugins use @plugin.
Can I still use tailwind.config.js in Tailwind v4?
Yes, for compatibility. JavaScript config files are no longer detected automatically, so load yours with @config "../../tailwind.config.js"; in your CSS. The corePlugins, safelist and separator options are not supported, and resolveConfig was removed.
How do layers work in Tailwind v4?
Tailwind v4 uses native CSS cascade layers in the order theme, base, components, utilities. @layer base and @layer components still work for your own styles, but classes inside @layer utilities are no longer registered as utilities. Define custom utilities with @utility so they work with variants like hover: and md:.
Is Tailwind 4 backward compatible with Tailwind 3?
Mostly, but not fully. Most class names are unchanged, but scales such as shadow-sm, blur-sm and rounded-sm moved to -xs, outline-none became outline-hidden, bare ring is now 1px, and deprecated opacity utilities were removed. The upgrade tool handles most of this, but you should still review pages visually.
How long does a Tailwind upgrade take?
For a typical business site or mid-size app, plan for a few hours to a day. The upgrade tool rewrites code in minutes; the rest of the time goes into dynamic class names, component style blocks and visual checks. Large design systems with custom plugins are best migrated in stages with @config.
Next steps
Tailwind v4 is fast, stable and now well past its first year, with v4.3.5 as the current release. For new work it is the obvious choice. For existing v3 projects, confirm your browser data, run the upgrade tool in a branch, fix the changed defaults and budget time for visual review.
If you would rather have someone handle the migration or a front-end rebuild, get in touch through my contact form or browse my web development case studies.
Sources
- Tailwind CSS: Upgrade guide
- Tailwind CSS blog: Tailwind CSS v4.0 (January 22, 2025)
- Tailwind CSS blog: Tailwind CSS v4.1
- Tailwind CSS blog: Tailwind CSS v4.2 and v4.3 (May 8, 2026)
- GitHub: tailwindlabs/tailwindcss releases (v4.3.4 and v4.3.5)
- npm: tailwindcss package and dist-tags
- Tailwind CSS: Theme variables
- Tailwind CSS: Functions and directives
- Tailwind CSS: Adding custom styles
- Tailwind CSS: Compatibility
- Tailwind CSS: Preflight