Repository navigation
Arbitrary values: Fix color() and light-dark() being classified as lengths - #712
Merged
dcastil merged 1 commit intoSep 6, 2026
Merged
Conversation
|
This was addressed in release v3.6.0-dev.0e4856ca9f23c541650709ce27c6674c65d3dd1a. |
|
This was addressed in release tailwind-merge@3.7.0. |
desmondinho
added a commit
to desmondinho/tailwind-merge-dotnet
that referenced
this pull request
Oct 11, 2026
* fix(validators): classify `color()` and `light-dark()` arbitrary values as colors Arbitrary values using these functions with percentages were classified as lengths instead of colors. Ports dcastil/tailwind-merge#712 (v3.7.0). * fix(config): bare `bg-conic` not merging with other background image classes Ports dcastil/tailwind-merge#708 (v3.7.0). * fix(config): `columns-auto` not conflicting with other `columns` classes Ports dcastil/tailwind-merge#707 (v3.7.0). * fix(config): container sizes like `inline-2xl` not merging Adds the container theme scale to the inline size groups and points the inline/block size groups to their own Tailwind docs pages. Ports dcastil/tailwind-merge#706 (v3.7.0). * fix(config): `max-h-none` missing in max-h class group Ports dcastil/tailwind-merge#704 (v3.7.0). * fix(config): axis shorthands like `px` not overriding logical sides like `ps` Since Tailwind CSS v4 the axis utilities compile to logical shorthand properties (px -> padding-inline), which fully override their logical-side longhands (ps -> padding-inline-start). Applies to padding, margin, inset, border width, border color, scroll margin and scroll padding. Ports dcastil/tailwind-merge#705 (v3.7.0). * fix(config): `leading-none` being removed when the leading theme scale is overridden Ports dcastil/tailwind-merge#689 (v3.7.0). * fix(config): deprecated `shadow-inner` being classified as shadow color instead of shadow Ports dcastil/tailwind-merge#703 (v3.7.0). * fix(validators): arbitrary values using `color-mix()` not being detected as colors Was missed when porting dcastil/tailwind-merge#591 (v3.3.1). * fix(config): arbitrary variables not supported in background image classes `bg-(image:--x)` / `bg-(url:--x)` were classified as background colors and `bg-linear-(--x)`, `bg-radial-(--x)`, `bg-conic-(--x)` were not recognized. Aligns the bg-image class group with upstream tailwind-merge, where these have been supported since v3.0.0. * fix(config): `lh` values missing in h, min-h and max-h class groups Adds support for Tailwind CSS v4.1.5 `h-lh`, `min-h-lh` and `max-h-lh` utilities. Was missed when porting dcastil/tailwind-merge#575 (v3.3.0). * style(config): move `auto` to the top of the columns class group * style(config): move `containerTheme` after the strings in the inline sizing scale * style(config): order arbitrary variable validators after arbitrary value validators in the bg-image class group * fix(config): blur theme sizes like `blur-sm` not merging The blur and backdrop-blur scales didn't use the blur theme and only accepted arbitrary lengths, so `blur-sm blur-lg` wasn't merged and arbitrary variables like `blur-(--x)` weren't recognized. Aligns the scale with upstream tailwind-merge (since v3.0.0). * fix(config): arbitrary variables like `z-(--x)` not supported in z-index classes `V.IsInteger` was listed twice instead of `V.IsArbitraryVariable`. * fix(config): non-length arbitrary values not supported in outline-offset classes Values like `outline-offset-(--x)` or `outline-offset-[var(--x)]` weren't recognized because only arbitrary lengths were accepted. Aligns the group with upstream tailwind-merge (since v3.0.0). * fix(config): arbitrary font-family and font-weight classes merging incorrectly Unlabeled arbitrary values and variables in `font-*` classes are now treated as font weights, and font families need the `family-name:` label, matching Tailwind CSS. Adds the `IsArbitraryWeight`, `IsArbitraryFamilyName` and `IsArbitraryVariableWeight` validators. Was missed when porting dcastil/tailwind-merge#635 (v3.4.1). * fix(validators): number validators accepting `NaN` and thousands separators and depending on the current culture `IsNumber` accepted values like `NaN` and `1,000`, and `IsInteger` parsed with the current culture, so `-1` wasn't an integer in cultures like fa-IR or ar-SA. Both now parse invariantly like upstream tailwind-merge's `Number()`-based checks, which also makes `IsInteger` accept values like `1.0`, `1e3` and integers beyond the int range. * test: port upstream wonky inputs tests * test: port missing upstream test cases * style(config): order `IsArbitraryWeight` before `IsArbitraryVariableWeight` in the font-weight class group
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #710
twMerge('text-sm text-[color(display-p3_1_0_0/50%)]')removestext-smbecause the percentage inside the color is mistaken for a length. The same issue affectslight-dark()and other prefixes shared by colors and lengths, including border and stroke utilities.Add
colorandlight-darkto the existingcolorFunctionRegexexclusion used byisLengthOnly, following the treatment ofcolor-mix()in #591. This preserves unrelated size utilities and correctly resolves color-to-color conflicts. The fix covers lowercase function names and retains the existing case-sensitive matching behavior.Regression tests cover both class orders, text-color replacement, and preservation of font size, border width, and stroke width. Two documentation examples are included in the existing example test, and relevant testing guidance is updated.
Validation:
pnpm lint,pnpm test:types,pnpm build, andpnpm test:exportspass, including TypeScript 3.8 declaration compatibility.