✨ Features
- compiled merge tables; default entry exports
twMerge,twJoin, andclsx tailwind-variants/merge: merger withouttvtailwind-variants/config:twMergeConfigandextendTailwindMerge/createTailwindMerge/createTwMerge/fromTheme/validators/mergeConfigs/getDefaultConfig- multi-extend via
extend: [a, b, c](#297) - empty class lists return
""(#289) - array compound / variant classes apply to the base slot (#263)
- experimental
debugmode - inject
twMergefromtailwind-variants/lite(#307) cacheSizeandprefixon the default tables
⚡ Performance
- hot
tv()about 3.5× vs 3.3.1, over 6× with compound variants cn()about 2× vs 3.3.1 on join-and-merge, over 7× on interpolated arguments, about 2× on unique arbitrary values- pre-merged static core;
class/classNamecached by text - compound variants kept out of cache keys (#317)
🐛 Fixes
- unlabeled
font-[Inter]is family,font-[700]is weight contain-*,bg-gradient-to-*,bg-conic,columns-auto,max-h-none, extra size scales- debug reporter stripped when
NODE_ENVis production compoundSlotsno longer widens variant inference (#316)
🚨 Breaking Changes
- twMergeConfig:
tailwind-variants/configonly; default entry throws - experimentalParseClassName: removed
- cn:
cn("a", 0)→"a";cn(0)→"0" - empty lists:
""instead ofundefined - types: unknown variant / slot keys error
- peers:
tailwind-mergeandtailwindcssremoved - lite: function
twMergeis called (3.3.1 treated it astrue) - twMerge: false:
cxjoin; whitespace normalized at compile
🛠 Chores
pnpm compile-tables- isolated benchmark suites
- pkg.pr.new
- toolchain on Vitest 5, tsup 9, Biome 2.6, pnpm 12; audit clean (#315)
See the v3 to v4 migration guide.
Thanks @danielroe for #317 and @wingkwong for #315.