Packages

tailwind-merge

3.7.1 · 19 Nov 2026MIT118.2M / weekRepositorynpmAtom feed

Your version

2.0.0

major29 Oct 2023Where it was published

2.6.2 is the newest release of 2.x.

In short

9 breaking1 new3 fixed1 internal

  • Breaking

    Fix background-image and background-position being merged incorrectly

  • Breaking

    Make types of available keys more strict and configurable through generics

  • Breaking

    Make it possible to override elements with extendTailwindMerge

  • Breaking

    Separate validators better

  • Breaking

    Make conflictingClassGroupModifiers in config non-optional

  • Breaking

    Move separator to config

  • Breaking

    Remove module field from package.json

  • Breaking

    Remove deprecated exports

Release note

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

  • Breaking

    Fix background-image and background-position being merged incorrectly

    • 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.

  • Breaking

    Make types of available keys more strict and configurable through generics

  • Breaking

    Make it possible to override elements with extendTailwindMerge

  • Breaking

    Separate validators better

  • Breaking

    Make conflictingClassGroupModifiers in config non-optional

  • Breaking

    Move separator to config

  • Breaking

    Remove module field from package.json

  • Breaking

    Remove deprecated exports

  • Breaking

    Transpile lib to more modern JS

New Features

  • Make types of available keys more strict and configurable through generics

  • Make it possible to override elements with extendTailwindMerge

  • Separate validators better

  • Make conflictingClassGroupModifiers in config non-optional

  • Move separator to config

  • Remove module field from package.json

  • Removed

    Remove deprecated exports

  • Transpile lib to more modern JS

  • Add ES5 bundle

Bug Fixes

  • Fix touch action classes overriding each other incorrectly

  • Fix background-image and background-position being merged incorrectly

  • Fix number validators accidentally returning true for empty strings

  • Rename lazy-initializaton.test.ts to lazy-initialization.test.ts

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.