tailwind-merge 1.6.0
New Features
- Add support for arrays as argument by @dcastil in https://github.com/dcastil/tailwind-merge/pull/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
joinfunction 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 https://github.com/dcastil/tailwind-merge/discussions/137#discussioncomment-3481605.
- You can now use arbitrarily nested arrays as arguments to
Bug Fixes
- Replace matchAll with exec by @dcastil in https://github.com/dcastil/tailwind-merge/pull/133
- This makes tailwind-merge work in older browsers which don't support
String.prototype.matchAll()
- This makes tailwind-merge work in older browsers which don't support
Other
- Add recipes section to docs by @dcastil in https://github.com/dcastil/tailwind-merge/pull/134
- Split docs into multiple files by @dcastil in https://github.com/dcastil/tailwind-merge/pull/131
- Add comments to released PRs and their related issues by @dcastil in https://github.com/dcastil/tailwind-merge/pull/130
- Add tests to check actual CJS and ESM package exports by @dcastil in https://github.com/dcastil/tailwind-merge/pull/129
- Remove ts files from npm package by @dcastil in https://github.com/dcastil/tailwind-merge/pull/128
Full Changelog: https://github.com/dcastil/tailwind-merge/compare/v1.5.1...v1.6.0
Thanks to @charkour for sponsoring tailwind-merge! ❤️