releases.shpreview
Home/Tailwind CSS
Tailwind CSS

Tailwind CSS

Added
  • Add @container-size utility (#18901)
  • Add scrollbar-{auto,thin,none} utilities for scrollbar-width, and scrollbar-thumb-* / scrollbar-track-* color utilities for scrollbar-color (#19981, #20019)
  • Add scrollbar-gutter-* utilities (#20018)
  • Add zoom-* utilities (#20020)
  • Add tab-* utilities (#20022)
  • Allow using @variant with stacked variants (e.g. @variant hover:focus { … }) (#19996)
  • Allow using @variant with compound variants (e.g. @variant hover, focus { … }) (#19996)
  • Support --default(…) in --value(…) and --modifier(…) for functional @utility definitions (#19989)
Fixed
  • Ensure @plugin resolves package JavaScript entries instead of browser CSS entries when using @tailwindcss/vite (#19949)
  • Fix relative @import and @plugin paths resolving from the wrong directory when using @tailwindcss/vite (#19965)
  • Ensure CSS files containing @variant are processed by @tailwindcss/vite (#19966)
  • Resolve imports relative to base when result.opts.from is 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], not mt-[-1920px]) (#19988)
  • Canonicalization: migrate arbitrary :has() variants from [&:has(…)] to has-[…] (#19991)
  • Upgrade: don’t migrate inline style attributes (e.g. style="flex-grow: 1"style="flex-grow: 1", not style="grow: 1") (#19918)
  • Allow multiple @utility definitions with the same name but different value types (#19777)
  • Export missing PluginWithConfig type from tailwindcss/plugin to fix errors when inferring plugin config types (#19707)
  • Ensure start and end legacy utilities without values do not generate CSS (#20003)
  • Ensure --value(…) is required in functional @utility definitions (#20005)
  • Canonicalization: preserve required whitespace around operators in negated arbitrary values (e.g. -left-[(var(--a)+var(--b))]) (#20011)

Tailwind CSS v4.3 is here, and because apparently shipping v4.2 was easier than remembering to blog about it, this post is secretly about two releases worth of new stuff.

Here's what landed in v4.2:

  • New mauve, olive, mist, and taupe palettes — four more neutral-ish palettes for when gray, zinc, neutral, stone, and slate have somehow failed you.
  • First-class webpack plugin — for a huge performance boost in frameworks like Next.js.
  • More logical property utilities — including pbs-*, mbs-*, inline-*, block-*, and new logical inset utilities.
  • New font-features-* utility — control low-level OpenType features without writing custom CSS every time.

…and here's what's new in v4.3:

  • New scrollbar utilities — style scrollbars without wondering which half-supported browser API you're supposed to use this week.
  • New @container-size utility — create size containers for when your container queries need to care about height too.
  • New zoom-* utilities — use the CSS zoom property directly in your markup, now that every browser has finally agreed it exists.
  • New tab-* utilities — control the rendered width of tab characters, just please don't make it eight like GitHub used to.
  • Stacked + compound @variant support — use stacked and compound variants directly in CSS.
  • Default values for functional utilities — define utilities that work with or without a value.

A lot of the v4.2 improvements, including the new logical property utilities and font-features-* support, came out of collaborations with teams at Netflix and Vercel through our Partners Program. If there are framework improvements like this that would make Tailwind CSS work better for your team, we'd love to help.

Upgrade your projects by installing the latest version of tailwindcss from npm:

Using the Tailwind CLI

npm install tailwindcss@latest @tailwindcss/cli@latest

Using Vite

npm install tailwindcss@latest @tailwindcss/vite@latest

Using PostCSS

npm install tailwindcss@latest @tailwindcss/postcss@latest

Using webpack

npm install tailwindcss@latest @tailwindcss/webpack@latest

New mauve, olive, mist, and taupe palettes

In v4.2 we added four new color palettes to the default theme: mauve, olive, mist, and taupe.

These originally came out of Oatmeal, the multi-theme marketing site kit we released for Tailwind Plus back in December, where we needed a few more neutral-ish palettes that still felt distinct from the grays we already ship.

They're all in that useful neutral-adjacent category where you want something that still behaves like gray, but has a little more personality:

They're a nice substitute for the existing gray palettes when you want the whole design to lean a little warmer, cooler, greener, or… mauver?

<div class="bg-mauve-950 text-mauve-100 ...">Mauve</div>
<div class="bg-olive-100 text-olive-950 ...">Olive</div>
<div class="border border-mist-200 shadow-taupe-950/10 ...">Mist and taupe</div>

Check out the colors documentation for a pretty grid of all the available colors.


First-class webpack plugin

Tailwind CSS v4.2 added a dedicated @tailwindcss/webpack loader for integrating Tailwind CSS in webpack projects.

Before this, webpack projects usually ran Tailwind through postcss-loader and @tailwindcss/postcss, which works, but means CSS has to take a little detour through PostCSS just so Tailwind can get its hands on a string it already knows how to compile.

The dedicated loader skips that extra work, and we've seen it make Tailwind over 2x faster in large, complicated webpack projects. For example, here's what we saw testing against the tailwindcss.com docs with Next.js and Turbopack:

PackageBuild time
@tailwindcss/postcss932ms
@tailwindcss/webpack429ms
Speedup2.17x faster

Using it is the same sort of setup you're used to from other webpack loaders:

webpack.config.js

const MiniCssExtractPlugin = require("mini-css-extract-plugin");

module.exports = {
  plugins: [new MiniCssExtractPlugin()],
  module: {
    rules: [
      {
        test: /\.css$/i,
        use: [MiniCssExtractPlugin.loader, "css-loader", "@tailwindcss/webpack"],
      },
    ],
  },
};

Because Turbopack supports webpack loaders through its compatibility layer, these improvements carry over there too, which is a big deal for frameworks like Next.js where Turbopack is becoming the default.

Check out the @tailwindcss/webpack README for more details.


More logical property utilities

Tailwind CSS v4.2 added a whole bunch of new logical property utilities, making it easier to build layouts that adapt correctly across different writing modes and directions.

For spacing, there are new block-start and block-end utilities for padding, margin, scroll padding, scroll margin, and borders:

<div class="mbs-6 mbe-2 pbs-4 pbe-8 ...">
  <!-- ... -->
</div>
<div class="scroll-mbs-4 scroll-mbe-4 scroll-pbs-12 scroll-pbe-12 ...">
  <!-- ... -->
</div>
<div class="border-bs border-be-2 ...">
  <!-- ... -->
</div>

We've also added logical sizing utilities for inline-size and block-size, along with min and max variants:

<div class="block-64 inline-full max-block-screen max-inline-lg min-block-24 min-inline-0 ...">
  <!-- ... -->
</div>

And we've added logical inset utilities for positioning elements:

<div class="absolute inset-s-0 inset-e-4 inset-bs-2 inset-be-8 ...">
  <!-- ... -->
</div>

The existing start-* and end-* utilities are still available, but they're now deprecated in favor of inset-s-* and inset-e-* so the whole API lines up with inset-bs-* and inset-be-*.

Check out the padding, margin, scroll-padding, scroll-margin, border-width, inline-size, block-size, and top / right / bottom / left docs for more details.


New font-features-* utility

We've also added font-features-* utilities for controlling font-feature-settings:

<div class='font-features-["tnum"] ...'>
  <!-- ... -->
</div>

For common cases like tabular numbers, you should still reach for higher-level utilities like tabular-nums first, because nobody should have to remember that "tnum" is a thing.

But when you need to enable a font-specific stylistic set or some other OpenType feature we don't have a dedicated utility for, font-features-* gives you a clean escape hatch.

Check out the font-feature-settings docs for more details.


New scrollbar utilities

Tailwind CSS v4.3 adds first-party utilities for the CSS scrollbar APIs, so you can finally do the boring-but-useful scrollbar stuff without opening a second tab and remembering which browser supports what.

Use scrollbar-auto, scrollbar-thin, and scrollbar-none to control scrollbar-width:

<div class="scrollbar-thin scrollbar-thumb-sky-700 scrollbar-track-sky-100 overflow-auto ...">
  <!-- ... -->
</div>

You can also control scrollbar colors using scrollbar-thumb-* and scrollbar-track-* utilities:

<div class="scrollbar-thumb-sky-700 scrollbar-track-sky-100 overflow-auto ...">
  <!-- ... -->
</div>

They work with the usual color opacity modifiers too:

<div class="scrollbar-thumb-slate-900/60 scrollbar-track-slate-900/10 ...">
  <!-- ... -->
</div>

And for preventing layout shift when scrollbars appear, we've added scrollbar-gutter-auto, scrollbar-gutter-stable, and scrollbar-gutter-both:

<div class="scrollbar-gutter-stable overflow-auto ...">
  <!-- ... -->
</div>

Check out the scrollbar-width, scrollbar-color, and scrollbar-gutter docs for more details.


New @container-size utility

In Tailwind CSS v4.0 we added first-party container query support with the @container utility, which creates an inline-size container.

That's what you want most of the time, but container query length units like cqb and cqh depend on the block size of the container, and inline-size containers don't expose that information.

So in v4.3 we've added @container-size, which creates a size container instead:

<div class="@container-size">
  <div class="h-[50cqb]">
    <!-- ... -->
  </div>
</div>

You can name size containers too using @container-size/{name}, just like @container/{name}.

Check out the responsive design docs for more details.


New zoom-* utilities

Tailwind CSS v4.3 adds zoom-* utilities for the CSS zoom property, one of those ancient browser features that was supported in Chrome 1 back in 2008, but only became fully supported across all major browsers in 2024 after taking the scenic route through a few long-standing SVG bugs:

<div class="zoom-75 ...">Zoomed out</div>
<div class="zoom-100 ...">Normal</div>
<div class="zoom-125 ...">Zoomed in</div>

You can also use arbitrary values and CSS variables:

<div class="zoom-[1.1] ...">Zoomed in a little</div>
<div class="zoom-(--preview-zoom) ...">Zoomed using a variable</div>

Check out the zoom docs for more details.


New tab-* utilities

We've also added tab-* utilities for controlling the rendered width of tab characters using tab-size.

This is mostly useful for code examples, editors, and any other UI where you're rendering preformatted text that might contain real tab characters:

<pre class="tab-2 ...">function indent() {
	return 'tabbed';
}</pre>
<pre class="tab-8 ...">function indent() {
	return 'tabbed';
}</pre>

Arbitrary values and CSS variables work here too:

<pre class="tab-[12px] ...">...</pre>
<pre class="tab-(--tab-size) ...">...</pre>

Check out the tab-size docs for more details.


Stacked + compound @variant support

Tailwind CSS v4.3 makes @variant more flexible when you're using variants in CSS instead of directly in your markup.

You can now use stacked variants:

CSS

.button {
  background: var(--color-sky-500);

  @variant hover:focus {
    background: var(--color-sky-600);
  }
}

Compiled CSS

.button {
  background: var(--color-sky-500);
  &:hover {
    @media (hover: hover) {
      &:focus {
        background: var(--color-sky-600);
      }
    }
  }
}

And you can use compound variants to share the same block of CSS across multiple variants:

CSS

.button {
  background: var(--color-sky-500);

  @variant hover, focus {
    background: var(--color-sky-600);
  }
}

Compiled CSS

.button {
  background: var(--color-sky-500);
  &:hover {
    @media (hover: hover) {
      background: var(--color-sky-600);
    }
  }

  &:focus {
    background: var(--color-sky-600);
  }
}

You're usually better off creating a real component and styling it with Tailwind CSS classes directly, but when CSS is the right tool, this makes @variant a lot nicer to work with.

Check out the @variant docs for more details.


Default values for functional utilities

Tailwind CSS v4.0 introduced functional @utility definitions, where you can use --value(…) and --modifier(…) to define utilities that accept theme values, bare values, arbitrary values, and modifiers.

In v4.3, you can now pass --default(…) to --value(…) and --modifier(…) when a utility should work with or without a value:

CSS

@utility tab-* {
  tab-size: --value(integer, --default(4));
}

Now the bare tab utility can fall back to 4, while tab-2 still resolves to 2:

HTML

<pre class="tab ...">...</pre>
<pre class="tab-2 ...">...</pre>

Generated CSS

.tab {
  tab-size: 4;
}

.tab-2 {
  tab-size: 2;
}

Check out the @utility docs for more details.

Fixed
  • Ensure imports in @import and @plugin still resolve correctly when using Vite aliases in @tailwindcss/vite (#19947)
Fixed
  • Canonicalization: improve canonicalizations for tracking-* utilities by preferring non-negative utilities (e.g. -tracking-tightertracking-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}-* into border-y-*, border-{l,r}-* into border-x-*, and border-{t,r,b,l}-* into border-* (#19842)
  • Canonicalization: collapse scroll-m{t,b}-* into scroll-my-*, scroll-m{l,r}-* into scroll-mx-*, and scroll-m{t,r,b,l}-* into scroll-m-* (#19842)
  • Canonicalization: collapse scroll-p{t,b}-* into scroll-py-*, scroll-p{l,r}-* into scroll-px-*, and scroll-p{t,r,b,l}-* into scroll-p-* (#19842)
  • Canonicalization: collapse overflow-{x,y}-* into overflow-* (#19842)
  • Canonicalization: collapse overscroll-{x,y}-* into overscroll-* (#19842)
  • Read from --placeholder-color instead of --background-color for placeholder-* utilities (#19843)
  • Upgrade: ensure files are not emptied out when killing the upgrade process while it's running (#19846)
  • Upgrade: use config.content when migrating from Tailwind CSS v3 to Tailwind CSS v4 (#19846)
  • Upgrade: never migrate files that are ignored by git (#19846)
  • Add .env and .env.* to default ignored content files (#19846)
  • Canonicalization: migrate overflow-ellipsis into text-ellipsis (#19849)
  • Canonicalization: migrate start-fullinset-s-full, start-autoinset-s-auto, start-pxinset-s-px, and start-<number>inset-s-<number> as well as negative versions (#19849)
  • Canonicalization: migrate end-fullinset-e-full, end-autoinset-e-auto, end-pxinset-e-px, and end-<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 value ml-[calc(-1*var(--width))]-ml-(--width) (#19858)
  • Improve performance when scanning JSONL / NDJSON files (#19862)
  • Support NODE_PATH environment variable in standalone CLI (#19617)
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 @property at-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-1234size-1234) (#19809)
  • Fix canonicalization resulting in empty list (e.g. w-5 h-5 size-5'' instead of size-5) (#19812)
Fixed
  • Allow trailing dash in functional utility names for backwards compatibility (#19696)
  • Properly detect classes containing . characters within curly braces in MDX files (#19711)
Added
  • Add mauve, olive, mist, and taupe color palettes to the default theme (#19627)
  • Add @tailwindcss/webpack package to run Tailwind CSS as a webpack plugin (#19610)
  • Add pbs-* and pbe-* utilities for padding-block-start and padding-block-end (#19601)
  • Add mbs-* and mbe-* utilities for margin-block-start and margin-block-end (#19601)
  • Add scroll-pbs-* and scroll-pbe-* utilities for scroll-padding-block-start and scroll-padding-block-end (#19601)
  • Add scroll-mbs-* and scroll-mbe-* utilities for scroll-margin-block-start and scroll-margin-block-end (#19601)
  • Add border-bs-* and border-be-* utilities for border-block-start and border-block-end (#19601)
  • Add inline-*, min-inline-*, max-inline-* utilities for inline-size, min-inline-size, and max-inline-size (#19612)
  • Add block-*, min-block-*, max-block-* utilities for block-size, min-block-size, and max-block-size (#19612)
  • Add inset-s-*, inset-e-*, inset-bs-*, inset-be-* utilities for inset-inline-start, inset-inline-end, inset-block-start, and inset-block-end (#19613)
  • Add font-features-* utility for font-feature-settings (#19623)
Fixed
  • Prevent double @supports wrapper for color-mix values (#19450)
  • Allow whitespace around @source inline() argument (#19461)
  • Emit comment when source maps are saved to files when using @tailwindcss/cli (#19447)
  • Detect utilities containing capital letters followed by numbers (#19465)
  • Fix class extraction for Rails' strict locals (#19525)
  • Align @utility name validation with Oxide scanner rules (#19524)
  • Fix infinite loop when using @variant inside @custom-variant (#19633)
  • Allow multiples of .25 in aspect-* fractions (e.g. aspect-8.5/11) (#19688)
  • Ensure changes to external files listed via @source trigger a full page reload when using @tailwindcss/vite (#19670)
  • Improve performance of Oxide scanner in bigger projects by reducing file system walks (#19632)
  • Ensure import aliases in Astro v5 work without crashing when using @tailwindcss/vite (#19677)
  • Allow escape characters in @utility names to improve support with formatters such as Biome (#19626)
  • Fix incorrect canonicalization results when canonicalizing multiple times (#19675)
  • Add .jj to default ignored content directories (#19687)
Deprecated
  • Deprecate start-* and end-* utilities in favor of inset-s-* and inset-e-* utilities (#19613)
Fixed
  • Ensure validation of source(…) happens relative to the file it is in (#19274)
  • Include filename and line numbers in CSS parse errors (#19282)
  • Skip comments in Ruby files when checking for class names (#19243)
  • Skip over arbitrary property utilities with a top-level ! in the value (#19243)
  • Support environment API in @tailwindcss/vite (#18970)
  • Preserve case of theme keys from JS configs and plugins (#19337)
  • Write source maps correctly on the CLI when using --watch (#19373)
  • Handle special defaults (like ringColor.DEFAULT) in JS configs (#19348)
  • Improve backwards compatibility for content theme key from JS configs (#19381)
  • Upgrade: Handle future and experimental config keys (#19344)
  • Try to canonicalize any arbitrary utility to a bare value (#19379)
  • Validate candidates similarly to Oxide (#19397)
  • Canonicalization: combine text-* and leading-* classes (#19396)
  • Correctly handle duplicate CLI arguments (#19416)
  • Don’t emit color-mix fallback rules inside @keyframes (#19419)
  • CLI: Don't hang when output is /dev/stdout (#19421)
Fixed
  • Discard candidates with an empty data type (#19172)
  • Fix canonicalization of arbitrary variants with attribute selectors (#19176)
  • Fix invalid colors due to nested & (#19184)
  • Improve canonicalization for & > :pseudo and & :pseudo arbitrary variants (#19178)
Fixed
  • Fix Safari devtools rendering issue due to color-mix fallback (#19069)
  • Suppress Lightning CSS warnings about :deep, :slotted, and :global (#19094)
  • Fix resolving theme keys when starting with the name of another theme key in JS configs and plugins (#19097)
  • Allow named groups in combination with not-*, has-*, and in-* (#19100)
  • Prevent important utilities from affecting other utilities (#19110)
  • Don’t index into strings with the theme(…) function (#19111)
  • Fix parsing issue when \t is used in at-rules (#19130)
  • Upgrade: Canonicalize utilities containing 0 values (#19095)
  • Upgrade: Migrate deprecated break-words to wrap-break-word (#19157)
Changed
  • Remove the postinstall script from oxide (#19149)
Added
  • Format quotes in @source, @plugin, and @config (#387)
  • Sort in function calls in Twig (#358)
  • Sort in callable template literals (#367)
  • Sort in function calls mixed with property accesses (#367)
  • Support regular expression patterns for attributes (#405)
  • Support regular expression patterns for function names (#405)
Changed
  • Improved monorepo support by loading Tailwind CSS relative to the input file instead of prettier config file (#386)
  • Improved monorepo support by loading v3 configs relative to the input file instead of prettier config file (#386)
  • Fallback to Tailwind CSS v4 instead of v3 by default (#390)
  • Don't augment global Prettier ParserOptions and RequiredOptions types (#354)
  • Drop support for prettier-plugin-import-sort (#385)
Fixed
  • Handle quote escapes in LESS when sorting @apply (#392)
  • Fix whitespace removal inside nested concat and template expressions (#396)
Fixed
  • Handle ' syntax in ClojureScript when extracting classes (#18888)
  • Handle @variant inside @custom-variant (#18885)
  • Merge suggestions when using @utility (#18900)
  • Ensure that file system watchers created when using the CLI are always cleaned up (#18905)
  • Do not generate grid-column utilities when configuring grid-column-start or grid-column-end (#18907)
  • Do not generate grid-row utilities when configuring grid-row-start or grid-row-end (#18907)
  • Prevent duplicate CSS when overwriting a static utility with a theme key (#18056)
  • Show Lightning CSS warnings (if any) when optimizing/minifying (#18918)
  • Use default export condition for @tailwindcss/vite (#18948)
  • Re-throw errors from PostCSS nodes (#18373)
  • Detect classes in markdown inline directives (#18967)
  • Ensure files with only @theme produce no output when built (#18979)
  • Support Maud templates when extracting classes (#18988)
  • Upgrade: Do not migrate variant = 'outline' during upgrades (#18922)
  • Upgrade: Show version mismatch (if any) when running upgrade tool (#19028)
  • Upgrade: Ensure first class inside className is migrated (#19031)
  • Upgrade: Migrate classes inside *ClassName and *Class attributes (#19031)
Last Checked
57m ago
Category
Tracking since May 18, 2020