Repository navigation
Releases
Releases Β· tailwindlabs/tailwindcss
v4.3.5
Fixed
- Canonicalization: improve performance in projects with many functional variant values (e.g. a
matchVariantplugin with thousands of values) (#20663) - Don't crash or create a fallback with the wrong color for a
color-mix(β¦)without a color interpolation method (e.g.color-mix(var(--color-red-500))orcolor-mix(currentcolor 50%, transparent)) (#20658, #20666) - Ensure
@tailwindcss/oxide-wasm32-wasiloads instead of hanging forever (e.g. withNAPI_RS_FORCE_WASI=erroror in WebContainers) (#20667) - Remove
as: '*.css'from the@tailwindcss/turbopacksetup in its README, because it breaks CSS modules (#20660) - Ignore
<!--and-->between top-level rules in CSS instead of throwing or swallowing the next rule (e.g.a { color: red } --> b { color: blue }) (#20665) - Ensure
@tailwindcss/oxide-wasm32-wasidetects changed and new source files after the first scan (e.g. in WebContainers) (#20487) - Prevent type errors with
skipLibCheck: falsecaused by imports of unshipped modules in the@tailwindcss/nodetype declarations (#20632)
v4.3.4
Added
- Add
@tailwindcss/turbopack, a Turbopack loader for using Tailwind CSS with Next.js (#20367)
Fixed
- Ensure watch mode detects changes to symlinked
@sourcefiles whose real paths aren't otherwise scanned (#20356) - Ensure variants using
@scopewrap generated utilities instead of nesting inside them (#20369) - Ensure nested
@scoperules preserve their scoping semantics when flattened (#20369) - Preserve declarations directly inside
@scopeby wrapping them in:where(:scope)(#20369) - Ensure generated utilities include a space in empty
var()fallbacks (e.g.var(--tw-blur,)βvar(--tw-blur, )) (#20373) - Canonicalization: convert arbitrary breakpoint and container query variants to named equivalents (e.g.
max-[64rem]:flexβmax-lg:flex) (#20380) - Prevent
@tailwindcss/vitefrom crashing on every edit under Vite's experimentalbundledDevmode (#20379) - Ensure
@tailwindcss/oxidefalls back to WASM on platforms without native bindings (#20383) - Extract class candidates from Ruby
%wand%Wliterals using angle brackets or custom delimiters (e.g.%w<flex>,%w|flex|), including in Slim and Haml templates (#20387) - Preserve whitespace in
--default(β¦)values in functional@utilitydefinitions (e.g.--default(box alphabetic)no longer becomesboxalphabetic) (#20392) - Ensure automatic source detection respects negation-based
.gitignorefiles (e.g./*followed by!/β¦patterns) (#20397) - Ensure root
theme('β¦')namespace lookups in JavaScript plugins and config files return the full namespace object instead of the value of itsDEFAULTkey (#20399) - Skip ignored directories when generating watch globs instead of walking their contents on every rebuild (#20408)
- Drop invalid UTF-8 candidates during class detection (#20389)
- Prevent
@tailwindcss/vitefrom forcing full-page reloads for scanned files that Vite does not handle as modules (e.g..phpfiles) (#20414) - Canonicalization: don't merge utilities that reference different theme variables set to CSS-wide keywords like
unset(#20417) - Don't generate utilities when a modifier is used that would otherwise be silently ignored (e.g.
rounded-sm/[5],shadow-sm/foo,stroke-2/50) (#20419) - Preserve
and,or, andnotinside selectors insupports-[β¦]variants (e.g.supports-[selector(a:not(.foo))]:flex) (#20420) - Don't warn about Angular's
::ng-deepand:host-context()when optimizing CSS (#20434) - Don't generate CSS for candidates containing an empty additional modifier (e.g.
bg-red-500/50/andgroup-hover/foo//bar:flex) (#20466) - Ensure
min-*,max-*, and container query variants with decimal values are sorted numerically (e.g.min-[40.25rem]beforemin-[40.5rem]) (#20512) - Ensure CSS comments ending with
\*/are closed correctly instead of swallowing the CSS that follows (e.g./* C:\temp\*/) (#20508) - Improve style invalidation performance of
group-*andpeer-*variants (#20513) - Ensure cached compilers release their
loadModuleandloadStylesheetcallbacks after compilation (#20531) - Canonicalization: preserve
&when moving a pseudo-element into*or**(e.g.[&_::before]:flexβ**:[&::before]:flex) (#20550) - Ensure the
Set.prototype.intersectionpolyfill incanonicalizeCandidates(β¦)returns the intersection instead of the first set on Node.js < 22 (#20562) - Canonicalization: ensure inline
theme(β¦)alphas with more than 2 decimals migrate to a percentage modifier with the same opacity (e.g.theme(colors.red.500/.12345)βtext-red-500/[12.345%], nottext-red-500/[12.345]) (#20563) - Canonicalization: preserve inline
theme(β¦)alphas as an arbitrary percentage when a custom--opacity-*theme value would change the opacity (e.g.theme(colors.red.500/50%)βtext-red-500/[50%]with--opacity-50: 10%) (#20563) - Ensure the
@propertyfallback isn't applied in Safari versions that no longer supportmargin-trim: inline(#20569) - Treat viewport units like
dvminandsviand font-relative units likecapandrexas lengths in arbitrary values (e.g.text-[10dvmin]generatesfont-sizeinstead ofcolor) (#20516) - Write plugin logs to stderr in
tailwindcss canonicalizeso they don't end up in the results on stdout (#20561) - Extract class shorthands on later lines when Pug text, comments, or quoted attribute values contain unbalanced brackets, or a quote that doesn't start a string (e.g.
input(pattern=/"/.source)) (#20547, #20572) - Underline the correct occurrence of an unsupported data type in
--value(β¦)warnings (#20554) - Canonicalization: prefer an existing candidate when collapsing utilities over another utility with the same default theme value (e.g.
text-foreground text-primaryβtext-primary, nottext-card-checked-border) (#20540) - Canonicalization: don't collapse utilities into a utility that uses another theme variable with the same default value (e.g.
mt-card mb-cardβmy-card, notmy-4) (#20574) - Ensure
@tailwindcss/postcssrewrites relativeurl(β¦)s of stylesheets that are inlined before it runs (e.g.@imports in Vite) in optimized builds (#20576) - Drop nested rules that put a combinator after a pseudo-element when using pseudo-element variants (e.g.
selection:*on a utility with a nested& > *rule) (#20575) - Don't generate CSS for arbitrary values with unbalanced parentheses or brackets (e.g.
w-[calc(1px]or[--x:a[b]) (#20577) - Canonicalization: prevent
collapse: truefrom taking exponentially longer when classes are linked through a utility that sets many properties (e.g.sr-only) (#20558) - Ensure
&is substituted inside:-moz-any(β¦)and:-webkit-any(β¦)in custom variants (e.g.@custom-variant firefox (:-moz-any(&));) (#20486) - Ensure the standalone macOS binaries have a valid code signature, so macOS 27 no longer kills them at launch (#20578)
- Ensure
@tailwindcss/turbopackand@tailwindcss/webpackrebuild when the input CSS changes (e.g.next devwith Turbopack no longer serves the CSS of the previous edit) (#20582) - Canonicalization: don't drop a utility that sets a
--tw-*variable when an unrelated property has the same value (e.g.link mt-4no longer becomesmt-4whenlinksetsmargin-top: 16pxand--tw-translate-x: 16px) (#20593) - Decode single-digit hexadecimal escapes in theme variable and
@utilitynames as the CSS spec does (e.g.@theme { --color-\0: red; }no longer registers--color-0) (#20591) - Don't treat
!importantinside strings, comments orurl()in declaration values as the important flag (e.g.content: "a !important b") (#20627) - Parse a custom property at the end of the input when it has no trailing
;(e.g.--foo: baras the last declaration) (#20653) - Keep a declaration without a
;at the end of the CSS input (e.g.color: red) (#20655)
v4.3.3
Fixed
- Support
--watch --poll[=ms]in@tailwindcss/cliwhen filesystem events are unreliable or unavailable (#20297) - Canonicalization: match arbitrary hex colors against theme colors case-insensitively (e.g.
bg-[#fff]andbg-[#FFF]βbg-white) (#20298) - Prevent Preflight from overriding Firefox's native
iframe:focus-visibleoutline styles (#20292) - Ensure
theme('colors.foo')in JS plugins resolves correctly when both--color-fooand--color-foo-barexist (#20299) - Ensure fractional opacity modifiers work with named shadow sizes like
shadow-sm/12.5,text-shadow-sm/12.5,drop-shadow-sm/12.5, andinset-shadow-sm/12.5(#20302) - Parse selectors like
[data-foo]divas two selectors instead of one (#20303) - Ensure
@tailwindcss/postcssrebuilds when a preprocessor like Sass changes the input CSS without changing the input file on disk (#20310) - Ensure CSS nesting is handled even when Lightning CSS isn't run, such as in
@tailwindcss/browserand Tailwind Play (#20124) - Prevent achromatic theme colors from shifting hue when mixed in polar color spaces like
oklch(#20314) - Ensure
--spacing(0)is optimized to0pxinstead of0so it remains a<length>when used incalc(β¦)(#20319) - Load
@parcel/watcheronly when needed in@tailwindcss/cli --watchmode, so one-off builds and--watch --pollwork when@parcel/watchercan't be loaded (#20325) - Use explicit platform fonts instead of
system-uiandui-sans-serifso CJK text respects the page'slangattribute on Windows (#20318) - Prevent
@tailwindcss/upgradefrom rewriting ignored files when run from a subdirectory (#20329) - Ensure earlier
@sourcerules pointing to nested files are scanned when later@sourcerules point to files in parent folders (#20335) - Prevent
@tailwindcss/vitefrom triggering full page reloads when scanned files are processed by Vite but haven't been loaded as modules yet (#20336)
v4.3.2
Fixed
- Support bare spacing values for
auto-rows-*andauto-cols-*utilities (e.g.auto-rows-12andauto-cols-16) (#20229) - Prevent
@tailwindcss/cliin--watchmode from crashing on Windows when@sourcepoints to a directory that doesn't exist (#20242) - Prevent
@tailwindcss/vitefrom crashing in Deno v2.8.x whencontext.parentURLis not a valid URL (#20245) - Ensure
@tailwindcss/cliin--watchmode rebuilds when the input CSS file changes in an ignored directory (#20246) - Allow
@variantrules used inaddBase(β¦)to use custom variants defined later (#20247) - Prevent
@tailwindcss/vitefrom crashing during HMR when scanned files or directories are deleted (#20259) - Generate
font-sizeinstead ofcolordeclarations fortext-[--spacing(β¦)](#20260) - Prevent
@sourcepatterns from scanning unrelated sibling files and folders (#20263) - Extract class candidates adjacent to Template Toolkit delimiters like
%]β¦[%in.tt,.tt2, and.txfiles (#20269) - Extract class candidates from conditional Maud syntax like
p.text-black[condition](#20269) - Prevent
@position-tryrules from triggering unknown at-rule warnings when optimizing CSS (#20277) - Support class suggestions for named opacity modifiers from
--opacitytheme values (#20287) - Prevent type errors in
@tailwindcss/postcsswhen used with newer PostCSS patch releases (#20289)
v4.3.1
Added
- Add
--silentoption to suppress output in@tailwindcss/cli(#20100)
Fixed
- Remove deprecation warnings by using
Module#registerHooksinstead ofModule#registeron Node 26+ (#20028) - Canonicalization: don't crash when plugin utilities throw for unsupported values (#20052)
- Allow
@applyto be used with CSS mixins (#19427) - Ensure
not-*correctly negates@containerqueries, includingstyle(β¦)queries (#20059) - Ensure
drop-shadow-*color utilities work with custom shadow values containingcalc(β¦)(#20080) - Fix 'Sourcemap is likely to be incorrect' warnings when using
@tailwindcss/vite(#20103) - Ensure
@tailwindcss/webpackcan be installed in Rspack projects without requiringwebpackas a peer dependency (#20027) - Canonicalization: don't suggest invalid
calc(β¦)expressions (e.g.px-[calc(1rem+0px)]βpx-[calc(1rem+0)]) (#20127) - Canonicalization: avoid suggesting large spacing-scale values for arbitrary lengths (e.g.
left-[99999px]βleft-[99999px], notleft-24999.75) (#20130) - Ensure
@tailwindcss/cliin--watchmode recovers when a tracked dependency is deleted and restored (#20137) - Ensure standalone
@tailwindcss/clibinaries are ignored when scanning for class candidates (#20139) - Ensure class candidates are extracted from Twig
addClass(β¦)andremoveClass(β¦)calls (#20198) - Don't crash in the Ruby or Vue preprocessors when scanning files containing invalid UTF-8 bytes (#19588)
- Allow
@variantto be used insideaddBase(#19480) - Ensure
@sourceglobs with symlinks are preserved (#20203) - Ensure later
@sourcerules can re-include files excluded by earlier@source notrules (#20203) - Upgrade: don't migrate empty class rules to invalid
@utilityrules (#20205) - Ensure transitions between
inset-shadow-noneand other inset shadows work correctly (#20208) - Ensure explicitly referenced
@sourcedirectories are scanned even when ignored by git (#20214) - Ensure
@sourceglobs ending in**/*preserve dynamic path segments to avoid scanning too many files (#20217) - Canonicalization: don't fold
calc(β¦)divisions when the result would require high precision (e.g.w-[calc(100%/3.5)]βw-[calc(100%/3.5)], notw-[28.571428571428573%]) (#20221) - Serve ESM type declarations to ESM importers of
@tailwindcss/postcss(#20228)
Changed
v4.3.0
Added
- Add
@container-sizeutility (#18901) - Add
scrollbar-{auto,thin,none}utilities forscrollbar-width, andscrollbar-thumb-*/scrollbar-track-*color utilities forscrollbar-color(#19981, #20019) - Add
scrollbar-gutter-*utilities (#20018) - Add
zoom-*utilities (#20020) - Add
tab-*utilities (#20022) - Allow using
@variantwith stacked variants (e.g.@variant hover:focus { β¦ }) (#19996) - Allow using
@variantwith compound variants (e.g.@variant hover, focus { β¦ }) (#19996) - Support
--default(β¦)in--value(β¦)and--modifier(β¦)for functional@utilitydefinitions (#19989)
Fixed
- Ensure
@pluginresolves package JavaScript entries instead of browser CSS entries when using@tailwindcss/vite(#19949) - Fix relative
@importand@pluginpaths resolving from the wrong directory when using@tailwindcss/vite(#19965) - Ensure CSS files containing
@variantare processed by@tailwindcss/vite(#19966) - Resolve imports relative to
basewhenresult.opts.fromis not provided when using@tailwindcss/postcss(#19980) - Canonicalization: preserve significant
_whitespace in arbitrary values (#19986) - Canonicalization: add parentheses when removing whitespace from arbitrary values would hurt readability (e.g.
w-[calc(100%---spacing(60))]βw-[calc(100%-(--spacing(60)))]) (#19986) - Canonicalization: preserve the original unit in arbitrary values instead of normalizing to base units (e.g.
-mt-[20in]βmt-[-20in], notmt-[-1920px]) (#19988) - Canonicalization: migrate arbitrary
:has()variants from[&:has(β¦)]tohas-[β¦](#19991) - Upgrade: donβt migrate inline
styleattributes (e.g.style="flex-grow: 1"βstyle="flex-grow: 1", notstyle="grow: 1") (#19918) - Allow multiple
@utilitydefinitions with the same name but different value types (#19777) - Export missing
PluginWithConfigtype fromtailwindcss/pluginto fix errors when inferring plugin config types (#19707) - Ensure
startandendlegacy utilities without values do not generate CSS (#20003) - Ensure
--value(β¦)is required in functional@utilitydefinitions (#20005) - Canonicalization: preserve required whitespace around operators in negated arbitrary values (e.g.
-left-[(var(--a)+var(--b))]) (#20011)
v4.2.4
Fixed
- Ensure imports in
@importand@pluginstill resolve correctly when using Vite aliases in@tailwindcss/vite(#19947)
v4.2.3
Fixed
- Canonicalization: improve canonicalizations for
tracking-*utilities by preferring non-negative utilities (e.g.-tracking-tighterβtracking-wider) (#19827) - Fix crash due to invalid characters in candidate (exceeding valid unicode code point range) (#19829)
- Ensure query params in imports are considered unique resources when using
@tailwindcss/webpack(#19723) - Canonicalization: collapse arbitrary values into shorthand utilities (e.g.
px-[1.2rem] py-[1.2rem]βp-[1.2rem]) (#19837) - Canonicalization: collapse
border-{t,b}-*intoborder-y-*,border-{l,r}-*intoborder-x-*, andborder-{t,r,b,l}-*intoborder-*(#19842) - Canonicalization: collapse
scroll-m{t,b}-*intoscroll-my-*,scroll-m{l,r}-*intoscroll-mx-*, andscroll-m{t,r,b,l}-*intoscroll-m-*(#19842) - Canonicalization: collapse
scroll-p{t,b}-*intoscroll-py-*,scroll-p{l,r}-*intoscroll-px-*, andscroll-p{t,r,b,l}-*intoscroll-p-*(#19842) - Canonicalization: collapse
overflow-{x,y}-*intooverflow-*(#19842) - Canonicalization: collapse
overscroll-{x,y}-*intooverscroll-*(#19842) - Read from
--placeholder-colorinstead of--background-colorforplaceholder-*utilities (#19843) - Upgrade: ensure files are not emptied out when killing the upgrade process while it's running (#19846)
- Upgrade: use
config.contentwhen migrating from Tailwind CSS v3 to Tailwind CSS v4 (#19846) - Upgrade: never migrate files that are ignored by git (#19846)
- Add
.envand.env.*to default ignored content files (#19846) - Canonicalization: migrate
overflow-ellipsisintotext-ellipsis(#19849) - Canonicalization: migrate
start-fullβinset-s-full,start-autoβinset-s-auto,start-pxβinset-s-px, andstart-<number>βinset-s-<number>as well as negative versions (#19849) - Canonicalization: migrate
end-fullβinset-e-full,end-autoβinset-e-auto,end-pxβinset-e-px, andend-<number>βinset-e-<number>as well as negative versions (#19849) - Canonicalization: move the
-sign inside the arbitrary value-left-[9rem]βleft-[-9rem](#19858) - Canonicalization: move the
-sign outside the arbitrary valueml-[calc(-1*var(--width))]β-ml-(--width)(#19858) - Improve performance when scanning JSONL / NDJSON files (#19862)
- Support
NODE_PATHenvironment variable in standalone CLI (#19617)
v4.2.2
Added
- Support Vite 8 in
@tailwindcss/vite(#19790)
Fixed
- Don't crash when candidates contain prototype properties like
row-constructor(#19725) - Canonicalize
calc(var(--spacing)*β¦)expressions into--spacing(β¦)(#19769) - Fix crash in canonicalization step when handling utilities containing
@propertyat-rules (e.g.shadow-sm border) (#19727) - Skip full reload for server only modules scanned by client CSS when using
@tailwindcss/vite(#19745) - Improve canonicalization for bare values exceeding default spacing scale suggestions (e.g.
w-1234 h-1234βsize-1234) (#19809) - Fix canonicalization resulting in empty list (e.g.
w-5 h-5 size-5β''instead ofsize-5) (#19812)