github dcastil/tailwind-merge v1.6.0

latest releases: v3.3.1, v3.3.0, v3.2.0...
3 years ago

New Features

  • Add support for arrays as argument by @dcastil in #127
    • You can now use arbitrarily nested arrays as arguments to twMerge. That's especially handy for nested conditions.
      twMerge('…', someBool && ['…', anotherBool && '…'])
    • The joining of arguments is done with a new 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.
    • Why no objects as arguments? You can read about my reasoning in #137 (comment).

Bug Fixes

  • Replace matchAll with exec by @dcastil in #133
    • This makes tailwind-merge work in older browsers which don't support String.prototype.matchAll()

Other

  • Add recipes section to docs by @dcastil in #134
  • Split docs into multiple files by @dcastil in #131
  • Add comments to released PRs and their related issues by @dcastil in #130
  • Add tests to check actual CJS and ESM package exports by @dcastil in #129
  • Remove ts files from npm package by @dcastil in #128

Full Changelog: v1.5.1...v1.6.0

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

Don't miss a new tailwind-merge release

NewReleases is sending notifications on new releases.