NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm, #1561 most downloaded on npm
Merge Tailwind CSS classes without style conflicts
Latest stable
3.7.1
Last release 2 days ago
20 Nov 2026
Ships on a steady schedule
a new release about every 3 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
509 releases · first in 2021
Drag across the ruler to compare, or tap a release to open it.
I deprecated the `join` function and renamed it to `twJoin` to make replacing it via search and replace easier since join is a common function name. Y…
join to twJoin by @dcastil in https://github.com/dcastil/tailwind-merge/pull/161
join function and renamed it to twJoin to make replacing it via search and replace easier since join is a common function name. You don't need to change anything right now, but if you have some spare time, rename join → twJoin in your code since the join function will be removed in the next major release.Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v1.7.0...v1.8.0
Thanks to @gjtorikian for sponsoring tailwind-merge! ❤️
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Add support for Tailwind CSS v3.2 by @dcastil and @brandonmcconnell in https://github.com/dcastil/tailwind-merge/pull/159
Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v1.6.2...v1.7.0
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
I deprecated the validator isArbitraryWeight and renamed it to isArbitraryNumber to reflect its broader use case. You don't need to change anything ri…
stroke-[3] correctly.isArbitraryWeight and renamed it to isArbitraryNumber to reflect its broader use case. You don't need to change anything right now, but if you have some spare time, rename isArbitraryWeight → isArbitraryNumber in your code since isArbitraryWeight will be removed in the next major release.0.0.0-dev anymore and instead have the version number of the last release, like 1.6.1-dev. That makes it easier for tools like Renovate to understand which package version you're using in case you use dev releases.Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v1.6.1...v1.6.2
Nothing published for this version
Nothing published for this version
Fix h-min not working by @dcastil in https://github.com/dcastil/tailwind-merge/pull/146
Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v1.6.0...v1.6.1
Nothing published for this version
Nothing published for this version
Nothing published for this version
Add support for arrays as argument by @dcastil in https://github.com/dcastil/tailwind-merge/pull/127
twMerge. That's especially handy for nested conditions.twMerge('…', someBool && ['…', anotherBool && '…'])
join function which is present in the tailwind-merge exports as well. It has the same functionality as clsx but without support for objects as arguments which makes it a little faster.String.prototype.matchAll()Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v1.5.1...v1.6.0
Thanks to @charkour for sponsoring tailwind-merge! ❤️
Fix arbitrary z-index value not being recognized by @dcastil in https://github.com/dcastil/tailwind-merge/pull/116
Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v1.5.0...v1.5.1
Thanks to @charkour for sponsoring tailwind-merge! ❤️
Added missing ESM types subpath export condition by @scott-lc in https://github.com/dcastil/tailwind-merge/pull/113
types subpath export condition by @scott-lc in https://github.com/dcastil/tailwind-merge/pull/113
nodenext module type introduced in TypeScript 4.7.Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v1.4.0...v1.5.0
Thanks to @charkour for sponsoring tailwind-merge! ❤️
Optimize runtime performance by using Map by @dcastil in https://github.com/dcastil/tailwind-merge/pull/105
Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v1.3.0...v1.4.0
Thanks to @charkour for sponsoring tailwind-merge! ❤️
Add support for Tailwind v3.1 by @dcastil in https://github.com/dcastil/tailwind-merge/pull/103
Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v1.2.1...v1.3.0
Thanks to @charkour for sponsoring tailwind-merge! ❤️
Fix isArbitraryWeight incorrectly using weight: instead of number: for disambiguation for arbitrary values by @liuqiang1357 in https://github.com/dcas
weight: instead of number: for disambiguation for arbitrary values by @liuqiang1357 in https://github.com/dcastil/tailwind-merge/pull/85Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v1.2.0...v1.2.1
Thanks to @charkour for sponsoring tailwind-merge! ❤️
Add prefix support by @dcastil in https://github.com/dcastil/tailwind-merge/pull/78
Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v1.1.1...v1.2.0
Thanks to @charkour for sponsoring tailwind-merge! ❤️
Fix TypeScript types not being linked correctly in package.json by @navin-moorthy and @dcastil in https://github.com/dcastil/tailwind-merge/pull/75
Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v1.1.0...v1.1.1
Fix missing arbitrary value support in some class groups by @dcastil in https://github.com/dcastil/tailwind-merge/pull/73
grayscale, invert, sepia, grow, shrink, object-position, shadow, drop-shadow, rotate, skew and transform-originbreak-inside classes being merged incorrectlyoverline, underline-offset, content-nonebg-repeeat → bg-repeatisArbitraryShadow validator"type": "module" from the package.json. I did test the new npm package output in Node and in the browser, but it's hard to account for every possible build system tailwind-merge is used in. If some issues come up with bundling tailwind-merge, please open an issue!Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v1.0.0...v1.1.0
There are no breaking changes in the tailwind-merge types and some breaking changes for a small number of users in the return values, so you should ge…
v1! 🎉
After being 5 months on v0 I think it's time to release a stable version of tailwind-merge. Tailwind v3 was released yesterday and it's no coincidence that I'm releasing tailwind-merge v1 today. I added full support for Tailwind v3 so you can update both at once.
There are no breaking changes in the tailwind-merge types and some breaking changes for a small number of users in the return values, so you should get through smoothly.
By the way, you can now sponsor this project. 😊
twMerge, extendTailwindMerge
overflow-ellipsis and overflow-clip will not get merged with class truncate anymore, but the new Tailwind v3 classes text-ellipsis and text-clip will. (https://github.com/dcastil/tailwind-merge/pull/63/commits/65b03e48914ac5d7d52eea9ec178b204d30609c9, https://github.com/dcastil/tailwind-merge/pull/63)decoration-slice and decoration-clone won't get merged anymore and box-decoration-slide nad box-decoration-clone will (https://github.com/dcastil/tailwind-merge/pull/63/commits/bfe2cc9bb221107fa0bf363cc325ddbb04677f43, https://github.com/dcastil/tailwind-merge/pull/63)getDefaultConfig
outline since it was removed in Tailwind v3 (https://github.com/dcastil/tailwind-merge/pull/63/commits/55ab167b7167519873c5dd4d258dc62212d1659a, https://github.com/dcastil/tailwind-merge/pull/63)vertival-alignment (yes, the typo was in the code) to vertical-align (https://github.com/dcastil/tailwind-merge/pull/63/commits/1269ce68ae39807ceadbecc98c0929fdfdb446d0, https://github.com/dcastil/tailwind-merge/pull/63)flex-basis, flex-grow and flex-shrink to basis, grow and shrink to stay consistent with Tailwind v3 (https://github.com/dcastil/tailwind-merge/pull/63/commits/e6d8912e47bf9a89346b9b0cc822fb2bff2af172, https://github.com/dcastil/tailwind-merge/pull/63)validators
isCustomLength and isCustomValue were renamed to isArbitraryLength and isArbitraryValue to be consistent with naming in Tailwind v3 documentation (https://github.com/dcastil/tailwind-merge/pull/63/commits/adc3c02c7f035069beec1c62777ec008172587ab, https://github.com/dcastil/tailwind-merge/pull/63)[--my-var:20px]![--my-very-important-var: 21px]size, position, url, weight and familyisTshirtSize, isArbitrarySize, isArbitraryPosition, isArbitraryUrl and isArbitraryWeight, check them out in the documentation! (https://github.com/dcastil/tailwind-merge/pull/63/commits/fec2b18870f6806e602009632b52b9fe89ebfb83, https://github.com/dcastil/tailwind-merge/pull/63/commits/f8acd7ca5be6cc40ad4c1cbdee7522bbc44c7870, https://github.com/dcastil/tailwind-merge/pull/63)Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v0.9.0...v1.0.0
Mimic theme from Tailwind config in tailwind-merge config by @dcastil in https://github.com/dcastil/tailwind-merge/pull/55
spacing, borderRadius, etc. More on that in the theme docs.Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v0.8.2...v0.9.0
Fix custom values for list-style-type missing in default config by @dcastil in https://github.com/dcastil/tailwind-merge/pull/53
Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v0.8.1...v0.8.2
Fix missing support for custom values in some class groups in default config by @dcastil in https://github.com/dcastil/tailwind-merge/pull/52
Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v0.8.0...v0.8.1
This is a big release with breaking changes. These were necessary to improve the API before the coming v1.0.0 release and to add better plugin support…
This is a big release with breaking changes. These were necessary to improve the API before the coming v1.0.0 release and to add better plugin support. If you feel like writing a plugin, check out the plugins section in the docs!
: in them which look like Tailwind classes after the prefix. tailwind-merge will treat those as Tailwind classes and resolve conflicts incorrectly. (https://github.com/dcastil/tailwind-merge/pull/50)createTailwindMerge
getDefaultConfig callback anymore. You need to call the exported function getDefaultConfig instead to get the default config. (https://github.com/dcastil/tailwind-merge/pull/42)createTailwindMerge anyway. Use the new and much simpler to use extendTailwindMerge instead. (https://github.com/dcastil/tailwind-merge/pull/49)extendTailwindMerge function by @dcastil in https://github.com/dcastil/tailwind-merge/pull/49mergeConfigs function by @dcastil in https://github.com/dcastil/tailwind-merge/pull/45createConfig functions by @dcastil in https://github.com/dcastil/tailwind-merge/pull/40Config type to the package exportsFull Changelog: https://github.com/dcastil/tailwind-merge/compare/v0.7.1...v0.8.0
Fix CommonJS imports not working by @navin-moorthy and @dcastil in https://github.com/dcastil/tailwind-merge/pull/31
Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v0.7.0...v0.7.1
Allow passing false to twMerge by @dcastil in https://github.com/dcastil/tailwind-merge/pull/25
false to twMerge by @dcastil in https://github.com/dcastil/tailwind-merge/pull/25Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v0.6.0...v0.7.0
Allow passing null as argument to twMerge #20 by @dcastil
null as argument to twMerge #20 by @dcastilFull Changelog: https://github.com/dcastil/tailwind-merge/compare/v0.5.2...v0.6.0
Add support for custom classes like cursor-[grab] by @dcastil in https://github.com/dcastil/tailwind-merge/pull/19
cursor-[grab] by @dcastil in https://github.com/dcastil/tailwind-merge/pull/19Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v0.5.1...v0.5.2
Fix incorrect conflict between ring and shadow by @dcastil in https://github.com/dcastil/tailwind-merge/pull/15
Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v0.5.0...v0.5.1
Add support for Tailwind CSS v2.2.6 by @dcastil in https://github.com/dcastil/tailwind-merge/pull/8
twMerge initialization until first call by @dcastil in https://github.com/dcastil/tailwind-merge/pull/7Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v0.4.0...v0.5.0
(Breaking change) Simplify config by @dcastil in https://github.com/dcastil/tailwind-merge/pull/3
createTailwindMerge
getDefaultConfig changed. (https://github.com/dcastil/tailwind-merge/pull/3)
dynamicClasses and standaloneClasses were merged into classGroupsconflictingGroups were renamed to conflictingClassGroupsclassGroups object instead of full path to class group. E.g. dynamicClasses.foo.0 → foo.Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v0.3.0...v0.4.0
Enable named class group collections by @dcastil in 16a31751fdfd87c39683fb4506dec6a0bf118772
dynamicClasses.flex.direction instead of just index-based ones like dynamicClasses.flex.0. More info on this in the createTailwindMerge() API reference.Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v0.2.0...v0.3.0
Add support for important modifier by @dcastil in 17a9e9d9d805ba585372e01a9eefae1dba89368b
bottom-auto not being detected as Tailwind classesby @dcastil in ec65b84f0aab57d1305019e4a143772d675798a2Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v0.1.2...v0.2.0
Fix errors when importing tailwind-merge as third party dependency. by @dcastil in 3335956da15fdcc484904976864816413fad68f6
Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v0.1.1...v0.1.2
No changes here. Just testing automated npm publish.
No changes here. Just testing automated npm publish.
Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v0.1.0...v0.1.1
First published version of tailwind-merge. 🎉
First published version of tailwind-merge. 🎉
Full Changelog: https://github.com/dcastil/tailwind-merge/commits/v0.1.0
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.