Releases: dcastil/tailwind-merge
v2.4.0
New Features
- Allow hooking into class parsing logic (experimental) by @dcastil in #444
- There is no info to this in the docs because this is experimental, but there is a new
experimentalParseClassName
property in the config that allows you to customize how tailwind-merge recognizes classes. If you're interested, you can read how to use it in the inline JSDocs and subscribe to #385 for upcoming more powerful low-level functionality.
- There is no info to this in the docs because this is experimental, but there is a new
- Create security policy by @dcastil in #439
- Added documentation on how to report potential vulnerabilities
- Avoid
@babel/runtime
dependency by @dcastil in #431- Now no dependencies in tailwind-merge anymore. This dependency was only used in the
tailwind-merge/es5
bundle anyway which I don't optimize for.
- Now no dependencies in tailwind-merge anymore. This dependency was only used in the
Documentation
- Comment/typo fixes by @barvian in #443
- Fix typo in doc/recipes.md by @dsernst in #428
- Add tailwind-merge-dotnet to similar packages by @desmondinho in #415
Other
- Added GitHub Action that adds context-v2 label to every issue, discussion and PR by @Pritam1211 in #434
- Replace size-limit action with own metrics-report action by @dcastil in #433
Full Changelog: v2.3.0...v2.4.0
Thanks to @brandonmcconnell, @manavm1990, @langy, @jamesreaco and @microsoft for sponsoring tailwind-merge! ❤️
v2.3.0
New Features
- Add support for mix-blend-plus-darker utility by @dcastil in #403
- Added support for bigint in ClassNameValue type by @LarsArtmann in #402
Documentation
Full Changelog: v2.2.2...v2.3.0
Thanks to @brandonmcconnell, @manavm1990, @langy and @jamesreaco for sponsoring tailwind-merge! ❤️
v2.2.2
Bug Fixes
Documentation
- Fix minor typos in
configuration.md
by @stephan281094 in #372
Full Changelog: v2.2.1...v2.2.2
Thanks to @brandonmcconnell, @manavm1990, @langy, a private sponsor and @jamesreaco for sponsoring tailwind-merge! ❤️
v2.2.1
Bug Fixes
Full Changelog: v2.2.0...v2.2.1
Thanks to @brandonmcconnell, @manavm1990 and @langy for sponsoring tailwind-merge! ❤️
v2.2.0
New Features
Full Changelog: v2.1.0...v2.2.0
Thanks to @brandonmcconnell, @manavm1990, @ErwinAI and @langy for sponsoring tailwind-merge! ❤️
v2.1.0
New Features
Bug Fixes
Documentation
Full Changelog: v2.0.0...v2.1.0
Thanks to @brandonmcconnell, @manavm1990, @ErwinAI and @langy for sponsoring tailwind-merge! ❤️
v2.0.0
The tailwind-merge v2 release has been sitting here almost finished for 2 months already. But the timing was never quite right, especially thinking about the increased support needed after the release. In the meantime, the product of the company I work at launched in public beta and I married. Thank you for your patience.
This release focuses on making it easier to configure the library for new users. Check out the migration guide and if you have any questions, feel free to create an issue.
Breaking Changes
- Fix
background-image
andbackground-position
being merged incorrectly by @dcastil in #300- Values for
background-position
andbackground-size
can look very similar and Tailwind CSS uses the samebg-
prefix for both groups. This results in some limitations for tailwind-merge. If you use background position or background size with arbitrary values, please read this section about how to use them.
- Values for
- Make types of available keys more strict and configurable through generics by @kachkaev in #279
- Make it possible to override elements with
extendTailwindMerge
by @dcastil in #294 - Separate validators better by @dcastil in #292
- Make
conflictingClassGroupModifiers
in config non-optional by @dcastil in #291 - Move separator to config by @dcastil in #290
- Remove
module
field from package.json by @dcastil in #289 - Remove deprecated exports by @dcastil in #288
- Transpile lib to more modern JS by @dcastil in #287
New Features
- Make types of available keys more strict and configurable through generics by @kachkaev in #279
- Make it possible to override elements with
extendTailwindMerge
by @dcastil in #294 - Separate validators better by @dcastil in #292
- Make
conflictingClassGroupModifiers
in config non-optional by @dcastil in #291 - Move separator to config by @dcastil in #290
- Remove
module
field from package.json by @dcastil in #289 - Remove deprecated exports by @dcastil in #288
- Transpile lib to more modern JS by @dcastil in #287
- Add ES5 bundle by @dcastil in #286
Bug Fixes
- Fix touch action classes overriding each other incorrectly by @dcastil in #313
- Fix
background-image
andbackground-position
being merged incorrectly by @dcastil in #300 - Fix number validators accidentally returning
true
for empty strings by @dcastil in #295 - Rename lazy-initializaton.test.ts to lazy-initialization.test.ts by @CrutchTheClutch in #284
Documentation
- Explain limitations of arbitrary values in
bg-size
andbg-position
class groups in docs by @dcastil in #328
Full Changelog: v1.14.0...v2.0.0
Thanks to @quezlatch, @brandonmcconnell, @manavm1990 and @ErwinAI for sponsoring tailwind-merge! ❤️
v1.14.0
New Features
- Improve support for arbitrary values by @dcastil in #263
- Previously, tailwind-merge checked the content of the arbitrary value portion of a class in most cases to understand whether the type of the arbitrary value is correct (e.g. it checked for number followed by length unit for the length type). That lead to the issue that a class like
mt-[calc(theme(fontSize.4xl)/1.125)]
would not be recognized correctly because no length unit is present in the arbitrary value. - I changed the check of the arbitrary value to also pass when a
calc()
,min()
,max()
andclamp()
function is used in the arbitrary value. - In ambiguous cases, you can use data type labels to mark the type of a class. Read more
- Moreover, I removed the check where the type of the arbitrary value is unambiguous. In the class
mt-[…]
the arbitrary value can only be a length, so I don't check for it. A consequence of this is that if you use non-Tailwind classes likemt-[this-is-totally-not-tailwind]
, tailwind-merge will recognize it as a Tailwind class from now on. Please don't use classes that look like Tailwind classes with arbitrary value but aren't Tailwind classes with tailwind-merge (in default config) to prevent incorrect merging behavior.
- Previously, tailwind-merge checked the content of the arbitrary value portion of a class in most cases to understand whether the type of the arbitrary value is correct (e.g. it checked for number followed by length unit for the length type). That lead to the issue that a class like
Bug Fixes
- Fix
col-span-full
class missing in default config by @dcastil in #267 - Fix arbitrary value with no present length unit not being recognized by @dcastil in #263
Documentation
Full Changelog: v1.13.2...v1.14.0
v1.13.2
Bug Fixes
- Fix TypeScript issue when using
moduleResolution: node16
by @LiamMartens in #245
Documentation
- Fix grammar and typos in docs by @jmmarco in #249
- Add tailwind-merge-php to similar packages in docs by @JamesHemery in #246
Full Changelog: v1.13.1...v1.13.2
Thanks to @bluetch for sponsoring tailwind-merge! ❤️
v1.13.1
Bug Fixes
- Fix
basis-auto
andbasis-full
not being merged correctly by @lukasz-kapica in #242
Full Changelog: v1.13.0...v1.13.1