Skip to content

Releases: dcastil/tailwind-merge

v2.2.1

22 Jan 16:00
22dc7bb
Compare
Choose a tag to compare

Bug Fixes

  • Fix stroke-color being incorrectly detected as stroke-width by @dcastil in #371

Full Changelog: v2.2.0...v2.2.1

Thanks to @brandonmcconnell, @manavm1990 and @langy for sponsoring tailwind-merge! ❤️

v2.2.0

21 Dec 20:05
e874a79
Compare
Choose a tag to compare

New Features

Full Changelog: v2.1.0...v2.2.0

Thanks to @brandonmcconnell, @manavm1990, @ErwinAI and @langy for sponsoring tailwind-merge! ❤️

v2.1.0

02 Dec 17:00
381f117
Compare
Choose a tag to compare

New Features

  • Add ClassValidator type to package exports by @dcastil in #348

Bug Fixes

  • Fix display class not removed when it precedes line-clamp class by @dcastil in #347

Documentation

Full Changelog: v2.0.0...v2.1.0

Thanks to @brandonmcconnell, @manavm1990, @ErwinAI and @langy for sponsoring tailwind-merge! ❤️

v2.0.0

29 Oct 13:50
1b6ebb5
Compare
Choose a tag to compare

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 and background-position being merged incorrectly by @dcastil in #300
    • Values for background-position and background-size can look very similar and Tailwind CSS uses the same bg- 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.
  • 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

Bug Fixes

  • Fix touch action classes overriding each other incorrectly by @dcastil in #313
  • Fix background-image and background-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 and bg-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

16 Jul 15:21
788822b
Compare
Choose a tag to compare

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() and clamp() 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 like mt-[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.

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

  • Add missing info about where to call config functions to docs by @dcastil in #264

Full Changelog: v1.13.2...v1.14.0

v1.13.2

15 Jun 21:00
d66158a
Compare
Choose a tag to compare

Bug Fixes

  • Fix TypeScript issue when using moduleResolution: node16 by @LiamMartens in #245

Documentation

Full Changelog: v1.13.1...v1.13.2

Thanks to @bluetch for sponsoring tailwind-merge! ❤️

v1.13.1

08 Jun 08:06
e0ddd7c
Compare
Choose a tag to compare

Bug Fixes

Full Changelog: v1.13.0...v1.13.1

v1.13.0

01 Jun 17:40
2ad9e75
Compare
Choose a tag to compare

This release focuses on improvements to the docs.

Bug Fixes

Documentation

  • Add intro video from Simon Vrachliotis to docs by @dcastil in #239
    • @simonswiss made an intro video to tailwind-merge which I added to the docs. Check it out here!
  • Add docs about when to use tailwind-merge by @dcastil in #230
    • I added a new page to the docs about when and how to use tailwind-merge which should help you to decide whether you should use it and what alternative approaches exist.
  • Make it clearer in docs that tailwind-merge supports composition of class strings by @dcastil in #229

Other

  • Add npm package provenance by @dcastil in #219
    • GitHub introduced a new security feature to verify which source commit and build file were used for a specific npm package version. tailwind-merge now publishes provenance signatures alongside all releases on npm. Read more on the GitHub blog.

Full Changelog: v1.12.0...v1.13.0

v1.12.0

05 Apr 09:10
2fd82af
Compare
Choose a tag to compare

With this release tailwind-merge supports all features introduced in Tailwind CSS v3.3.

New Features

  • Add support for postfix modifier by @dcastil in #214
    • This adds support for line-height modifiers in font-size utilities like text-lg/7 and more potential postfix modifiers in the future (learn more).
    • All classes are checked for postfix modifiers since there will be more in the future and they'll be configurable with plugins.
    • tailwind-merge can't know from the class syntax alone whether something is a modifier or not. E.g. there is w-1/2 which doesn't contain a modifier. So tailwind-merge always checks whether class without potential modifier exists and if it doesn't it checks for full class. This behavior might get reversed in the next major version as a breaking change (learn more).
    • Added conflictingClassGroupModifiers object to tailwind-merge config (learn more).

Full Changelog: v1.11.0...v1.12.0

v1.11.0

29 Mar 08:05
a8af8d1
Compare
Choose a tag to compare

New Features

  • Add support for Tailwind CSS v3.3 except line-height shorthand by @dcastil in #210
    • The line-height shorthand in font-size utilities (text-lg/7) introduced in Tailwind CSS v3.3 is not yet supported in tailwind-merge because that feature is a bit more involved. I'll add support for it in a future release. More info in #211.
    • Added new validator isPercent which is needed internally for the default scale of color stop positions.
    • New theme key gradientColorStopPositions supported in tailwind-merge.
    • New logical properties like ps-0 (padding-inline-start: 0px;) are de-duplicated away when using the matching property for all sides afterwards like in this case p-0, but not when using single axis sides like px-0 because padding-inline-start can also be the top or bottom padding depending on writing mode.
      • Basically twMerge('ps-0 p-0') === 'p-0' && twMerge('ps-0 px-0') === 'ps-0 px-0'.
      • If you want to use logical properties and know which writing modes your app is limited to, add the right conflicts yourself to your tailwind-merge config.

Full Changelog: v1.10.0...v1.11.0

Thanks to @brandonmcconnell for sponsoring tailwind-merge! ❤️