tailwindcss/packages
Robin Malfait e46b3d74ee
Canonicalization: make hex colors case insensitive (#20298)
This PR fixes an issue where hex-based colors in arbitrary properties
and values were considered case-sensitive even though they are
case-insensitive in CSS.

If you look at the linked issue, there is this input CSS:
```css
@theme {
  --color-brand-purple: #3f3cbb;
}
```

We expect that both `bg-[#3f3cbb]` and `bg-[#3F3CBB]` get canonicalized
to `color-brand-purple` but before this pr, only the first one would get
canonicalized that way (since it's a perfect match).

Technically a bunch more values are case-insensitive but a lot of them
_are_ sensitive so to get this 100% correct, a lot more parsing needs to
happen. I think we can start with this and expand the logic when needed.

Fixes: #20295

## Test plan

1. Added a regression test based on the linked issue
2. Added tests for arbitrary properties (`[color:#fff]` vs
`[color:#FFF]`), and tests for arbitrary properties (`bg-[#fff]` vs
`bg-[#FFF]`)
2026-07-02 00:04:44 +02:00
..
@tailwindcss-browser 4.3.2 (#20281) 2026-06-29 10:10:00 -04:00
@tailwindcss-cli Add --poll option to @tailwindcss/cli (#20297) 2026-07-01 21:25:26 +02:00
@tailwindcss-node 4.3.2 (#20281) 2026-06-29 10:10:00 -04:00
@tailwindcss-postcss 4.3.2 (#20281) 2026-06-29 10:10:00 -04:00
@tailwindcss-standalone 4.3.2 (#20281) 2026-06-29 10:10:00 -04:00
@tailwindcss-upgrade 4.3.2 (#20281) 2026-06-29 10:10:00 -04:00
@tailwindcss-vite 4.3.2 (#20281) 2026-06-29 10:10:00 -04:00
@tailwindcss-webpack 4.3.2 (#20281) 2026-06-29 10:10:00 -04:00
internal-example-plugin Prefix internal modules with internal-* (#14074) 2024-07-29 10:58:07 -04:00
tailwindcss Canonicalization: make hex colors case insensitive (#20298) 2026-07-02 00:04:44 +02:00
tsconfig.base.json Improve debug logs (#15303) 2024-12-11 15:27:20 +01:00