npm / tailwind-merge
tailwind-merge
What changed in tailwind-merge 2 to 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-12-04.
13 breaking1 security3 new APIs and options1 performance7 behavior and defaults1 tooling15 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli inittailwind-merge 328 changes
Breaking changes 9
Classes removed in Tailwind CSS v4 are no longer supported by tailwind-merge.
Custom separators are no longer supported.
The type union now consists of different string literals than before.
The isLength validator was removed and split into isNumber and isFraction.
A mandatory orderSensitiveModifiers property is required in config when using createTailwindMerge.
A prefix defined in config should no longer include the combining
-character.Tailwind CSS v3 prefix position in classes is no longer supported; use the Tailwind CSS v4 position.
tailwind-merge drops Tailwind CSS v3 support and adds Tailwind CSS v4 support; upgrade both together.
Theme scales keys changed to match the Tailwind CSS v4 theme variable namespace exactly.
New APIs and options 2
Theme getters now expose the referenced theme key so tooling can identify the theme scale without calling the getter.
Adds a config option for Tailwind utilities where a slash is part of the full class name, such as named container queries.
Performance 1
Performance optimizations make tailwind-merge more than 10% faster.
Behavior and default changes 5
Adds support for readonly array values in the technology's accepted inputs.
Adds support for Tailwind CSS v4.3 utilities, including utilities whose full class name contains a slash.
Adds support for Tailwind CSS v4.2, allowing tailwind-merge to handle its class names and utilities.
tailwind-merge adds support for arbitrary CSS variable syntax.
tailwind-merge supports the new important modifier position at the end of a class.
Fixes and other changes 11
Bare bg-conic now merges correctly with other background image classes.
Arbitrary values using color() are now classified as colors instead of lengths.
columns-auto now conflicts correctly with other columns classes.
Container sizes such as inline-2xl now merge correctly.
leading-none is no longer removed when the leading theme scale is overridden.
Arbitrary values using light-dark() are now classified as colors instead of lengths.
max-h-none is now included in the max-h class group.
Axis shorthand px now overrides logical sides such as ps correctly.
Deprecated shadow-inner is now classified as a shadow instead of a shadow color.
Prevents arbitrary font-family and font-weight values from merging incorrectly.
Order-sensitive modifiers such as before: are now correctly treated as order-sensitive.
tailwind-merge 213 changes
Breaking changes 4
This config field is now required rather than optional.
Deprecated exports are removed.
The module field is removed from package.json.
The separator is now configured in the config.
Security 1
This release is published from CI with npm provenance again, so installs of tailwind-merge@^2 resolve to an attested version.
New APIs and options 1
An ES5 bundle is added for developers who need that bundle target.
Behavior and default changes 2
Available configuration keys have stricter types and can be configured through generics.
The API can now be used to override elements.
Tooling 1
The library is transpiled to more modern JavaScript.
Fixes and other changes 4
Arbitrary values using color-mix are now detected as colors by tailwind-merge.
Background-image and background-position classes are merged correctly; arbitrary background-position and background-size values need labels because their values can look similar and share the bg- prefix.
Number validators no longer return true for empty strings.
Touch action classes no longer override each other incorrectly.