tailwindcss/packages
Robin Malfait 5ce37c45c2
Ensure we migrate theme(spacing.1) to var(--spacing-1) correctly (#14724)
This PR fixes an issue where `theme(…)` calls that contain a `.1`
weren't correctly converted to `var(--spacing-1)`. The reason for this
is that `.1` has some special meaning in cases like
`fontSize.xs.1.lineHeight` where it should be converted to
`--font-size-xs--line-height`, not `--font-size-xs-1-line-height`.

To solve this, we make sure to only apply the `--` check if the `1`
occurs somewhere in the middle instead of at the very end.

With this change, the following migrations will happen correctly:

```diff
- [--value:theme(spacing.1)]
+ [--value:var(--spacing-1)]
```

```diff
- [--value:theme(fontSize.xs.1.lineHeight)]
+ [--value:var(--font-size-xs--line-height)]
```

---------

Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
2024-10-19 15:19:10 +02:00
..
@tailwindcss-cli Prepare v4.0.0-alpha.28 release (#14709) 2024-10-17 17:03:28 -04:00
@tailwindcss-node Prepare v4.0.0-alpha.28 release (#14709) 2024-10-17 17:03:28 -04:00
@tailwindcss-postcss Prepare v4.0.0-alpha.28 release (#14709) 2024-10-17 17:03:28 -04:00
@tailwindcss-standalone Update @types/bun 1.1.10 → 1.1.11 (patch) (#14727) 2024-10-19 15:18:39 +02:00
@tailwindcss-upgrade Ensure we migrate theme(spacing.1) to var(--spacing-1) correctly (#14724) 2024-10-19 15:19:10 +02:00
@tailwindcss-vite Prepare v4.0.0-alpha.28 release (#14709) 2024-10-17 17:03:28 -04:00
internal-example-plugin Prefix internal modules with internal-* (#14074) 2024-07-29 10:58:07 -04:00
tailwindcss Ensure we migrate theme(spacing.1) to var(--spacing-1) correctly (#14724) 2024-10-19 15:19:10 +02:00
tsconfig.base.json introduce v4 codebase 2024-03-05 14:29:15 +01:00