tailwindcss/packages
Rózsa Zoltán aa817fb6de
fix: don't break CSS keywords when formatting math expressions (#18220)
Fixes #18219

## Summary

In an arbitrary value, if there's a non-numeric character both before
and after a hyphen, there's no need for a space.

## Test plan

`decodeArbitraryValue` will correctly format special CSS values like
`fit-content`. I believe spaces are only necessary if there's a digit
either before or after the hyphen.

```js
decodeArbitraryValue('min(fit-content,calc(100dvh-4rem))')
```

This way, the result of the following arbitrary value will also be
correct:

```html
<div class="min-h-[min(fit-content,calc(100dvh-4rem))]"></div>
```

```css
.min-h-\[min\(fit-content\,calc\(100dvh-4rem\)\)\] {
  min-height: min(fit-content, calc(100dvh - 4rem));
}
```

---------

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2025-06-10 10:38:31 -04:00
..
@tailwindcss-browser Release v4.1.8 (#18164) 2025-05-28 17:01:27 +02:00
@tailwindcss-cli Release v4.1.8 (#18164) 2025-05-28 17:01:27 +02:00
@tailwindcss-node Release v4.1.8 (#18164) 2025-05-28 17:01:27 +02:00
@tailwindcss-postcss Release v4.1.8 (#18164) 2025-05-28 17:01:27 +02:00
@tailwindcss-standalone Update bun 1.2.13 → 1.2.15 (patch) (#18252) 2025-06-09 09:23:05 -04:00
@tailwindcss-upgrade docs: fix typo ("a arbitrary" -> "an arbitrary") (#18227) 2025-06-05 09:30:31 +00:00
@tailwindcss-vite Release v4.1.8 (#18164) 2025-05-28 17:01:27 +02:00
internal-example-plugin Prefix internal modules with internal-* (#14074) 2024-07-29 10:58:07 -04:00
tailwindcss fix: don't break CSS keywords when formatting math expressions (#18220) 2025-06-10 10:38:31 -04:00
tsconfig.base.json Improve debug logs (#15303) 2024-12-11 15:27:20 +01:00