github dcastil/tailwind-merge tailwind-merge@3.7.1

one hour ago

Bug Fixes

  • Fix font sizes without a line-height modifier removing earlier leading-* classes by @dcastil in #761
    • In Tailwind CSS v4, an earlier leading-* class still applies after a font size like text-lg or text-[1.5rem], so twMerge('leading-6 text-lg') now keeps both classes. Font sizes with a line-height modifier like text-lg/7 still override leading-*.
    • Thanks to @chatman-media for finding this for arbitrary font sizes in #681.
  • Fix arbitrary values using --spacing() being classified as colors instead of lengths by @dcastil in #758
  • Fix mask-circle and mask-ellipse not merging by @0z5a in #756
  • Fix flex-(--var) not merging with other flex classes by @asssslay in #751
  • Fix decoration-(--var) being classified as thickness instead of color by @asssslay in #753
  • Fix arbitrary line-clamp values like line-clamp-[calc(var(--characters)/100)] not merging by @asssslay in #752
  • Fix place-* classes not overriding content-*, items-*, self-* and justify-* classes by @mkantautas in #731
  • Fix lengths using the Q unit not being recognized by @Marve10s in #727
  • Fix brackets and other delimiters inside quoted arbitrary values like data-[label='['] breaking class parsing by @Don-Yin in #730
  • Fix arbitrary values using contrast-color() or device-cmyk() being classified as lengths instead of colors by @Don-Yin in #729
  • Fix sr-only not overriding the position, size, spacing, overflow and white-space classes it resets by @kory-kaai in #726
  • Fix mask-x-* and mask-y-* not overriding the matching edge classes and arbitrary mask stop positions being classified as colors by @Nelmad in #748
    • This also fixes arbitrary values using --alpha() or uppercase color functions like RGB() being classified as lengths instead of colors.
  • Fix postfix modifiers not being recognized on classes with a leading important modifier like !text-lg/7 by @beduldul in #721

Documentation

  • Explain how classes are matched to class groups and how to use validators by @itsthilinar in #750
  • Show how to enforce importing twMerge from one place with ESLint by @oyobbeb in #738
  • Recommend importing twMerge from one project-owned file by @dcastil in b53ceaf and 7fcb814

Full Changelog: v3.7.0...v3.7.1

Thanks to @manavm1990, @langy, @roboflow, @syntaxfm, @getsentry, @codecov, a private sponsor, @block, @openclaw, @sourcegraph, @jbisasky, @FrontendMasters and more via @thnxdev for sponsoring tailwind-merge! ❤️

Don't miss a new tailwind-merge release

NewReleases is sending notifications on new releases.