npm / @tailwindcss/vite
@tailwindcss/vite
What changed in @tailwindcss/vite 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.
5 breaking1 deprecations10 new APIs and options1 performance9 behavior and defaults5 tooling59 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@tailwindcss/vite 490 changes
Breaking changes 5
Spacing utilities like m-1 and left-1 now generate var(--spacing) instead of calc(var(--spacing) * 1).
Canonicalization changes where the minus sign appears for negative arbitrary values.
.env and .env.* files are now excluded from default content scanning.
Canonicalization collapses matching axis-specific overscroll utilities into overscroll-*.
Canonicalization collapses matching arbitrary horizontal and vertical padding utilities into a single shorthand utility.
Deprecations 1
Deprecates start-* and end-* utilities in favor of inset-s-* and inset-e-* utilities.
New APIs and options 10
Adds utilities for block-size, min-block-size, and max-block-size.
Adds utilities for border-block-start and border-block-end.
Adds a utility for font-feature-settings.
Adds utilities for inline-size, min-inline-size, and max-inline-size.
Adds logical inset utilities for inline and block start and end.
Adds utilities for margin-block-start and margin-block-end.
Adds utilities for padding-block-start and padding-block-end.
Adds utilities for scroll-margin-block-start and scroll-margin-block-end.
Adds utilities for scroll-padding-block-start and scroll-padding-block-end.
Allows named groups to be combined with not-*, has-*, and in-*.
Performance 1
Scanning JSONL and NDJSON files is faster.
Behavior and default changes 9
Spacing utilities like m-0 and left-0 now generate 0 instead of calc(var(--spacing) * 0).
Canonicalization can move a negative sign outside an arbitrary value and use shorthand variable syntax.
Canonicalization collapses matching directional border utilities into axis-specific or general border utilities.
Canonicalization migrates end utilities, including negative versions, to their inset-e equivalents.
Canonicalization migrates start utilities, including negative versions, to their inset-s equivalents.
Canonicalization collapses matching axis-specific overflow utilities into overflow-*.
Canonicalization collapses matching directional scroll-margin utilities into axis-specific or general scroll-margin utilities.
Aspect fractions now allow multiples of .25, such as aspect-8.5/11.
Utilities containing capital letters followed by numbers are now detected.
Tooling 5
@tailwindcss/vite now supports Vite 8.
.jj is now included in the default ignored content directories.
The Vite integration now supports the environment API.
The upgrade process migrates deprecated break-words to wrap-break-word.
A dedicated Vite plugin is available as an alternative to the PostCSS plugin, with improved performance and developer experience.
Fixes and other changes 59
No longer triggers full page reloads when Vite has processed scanned files that have not yet been loaded as modules.
Prevents crashes in Deno v2.8.x when context.parentURL is not a valid URL.
Prevents crashes during HMR when scanned files or directories are deleted.
Can now be used with CSS mixins.
Avoids crashing when plugin utilities throw for unsupported values.
No longer suggests invalid calc(…) expressions.
Avoids suggesting large spacing-scale values for arbitrary lengths.
Avoids folding calc(…) divisions when the result would require high precision.
Extracts candidates from Twig addClass(…) and removeClass(…) calls.
Color utilities work with custom shadow values containing calc(…).
Transitions between inset-shadow-none and other inset shadows now work correctly.
Uses Module#registerHooks instead of Module#register on Node 26+ to remove deprecation warnings.
Correctly negates @container queries, including style(…) queries.
Avoids crashes when scanning files containing invalid UTF-8 bytes.
Globs ending in **/* preserve dynamic path segments to avoid scanning too many files.
Preserves symlinks in source globs.
Later source rules can re-include files excluded by earlier @source not rules.
Explicitly referenced directories are scanned even when ignored by git.
Fixes 'Sourcemap is likely to be incorrect' warnings when using the Vite integration.
Can now be used inside addBase.
When using @tailwindcss/vite, @plugin resolves package JavaScript entries instead of browser CSS entries.
Relative @import and @plugin paths resolve from the correct directory when using @tailwindcss/vite.
CSS files containing @variant are processed by @tailwindcss/vite.
Imports in @import and @plugin now resolve correctly when using Vite aliases.
Invalid characters in candidates that exceed the valid Unicode code point range no longer cause a crash.
Placeholder utilities now read their color from --placeholder-color instead of --background-color.
Canonicalization collapses matching directional scroll-padding utilities into axis-specific or general scroll-padding utilities.
Canonicalization migrates overflow-ellipsis to text-ellipsis.
Canonicalization now prefers non-negative tracking utilities, such as converting -tracking-tighter to tracking-wider.
Expressions written as calc(var(--spacing)*…) are canonicalized into --spacing(…).
Candidates containing prototype properties like row-constructor no longer crash.
Server-only modules scanned by client CSS no longer trigger a full reload when using @tailwindcss/vite.
@tailwindcss/vite resolves tsconfig paths for imports such as @import '@/path/to/file';.
Canonicalization no longer crashes when handling utilities containing @property at-rules.
Bare values exceeding default spacing scale suggestions are canonicalized more effectively, such as w-1234 h-1234 to size-1234.
Canonicalization no longer produces an empty list for equivalent utilities such as w-5 h-5 size-5.
Functional utility names can now end with a trailing dash for backwards compatibility.
Classes containing
.characters within curly braces in MDX files are now properly detected.Prevents a duplicate @supports wrapper from being emitted for color-mix values.
The default theme adds mauve, olive, mist, and taupe color palettes.
Whitespace around the @source inline() argument is now allowed.
Changes to external files listed via @source now trigger a full page reload.
Import aliases in Astro v5 now work without crashing.
Utility name validation now aligns with Oxide scanner rules.
Utility names now allow escape characters, improving support with formatters such as Biome.
Fixes an infinite loop when @variant is used inside @custom-variant.
Substitute @variant inside legacy JS APIs.
Prevent an occasional crash on Windows when loaded into a worker thread.
Fixes canonicalization of arbitrary variants that use attribute selectors.
Improves canonicalization for arbitrary variants using
& > :pseudoand& :pseudoselectors.Candidates with an empty data type are discarded, preventing them from affecting candidate processing.
Fixes invalid colors caused by nested
&.Fixes a parsing issue when \t is used in at-rules.
Fixes a Safari DevTools rendering issue caused by the color-mix fallback.
Suppresses Lightning CSS warnings about :deep, :slotted, and :global.
Prevents important utilities from affecting other utilities.
Fixes resolving theme keys that start with the name of another theme key in JS configs and plugins.
The theme(…) function no longer indexes into strings.
Canonicalizes utilities containing 0 values during upgrades.