tailwindcss/packages/@tailwindcss-upgrade/src
Robin Malfait 2b13547a0d
Migrate arbitrary values to bare values (#14669)
This PR adds a codemod that can convert arbitrary values to the cleaner
bare values if we can.

For example, some classes use arbitrary values such as `col-start-[16]`,
but in v4 we have bare values for some plugins that don't really need to
adhere to your design system.

In this case, we can convert `col-start-[16]` to just `col-start-16`.

Another use case is for utilities that use fractions. For example the
`aspect-*` plugin.

A custom aspect ratio such as `aspect-[16/9]` can be converted to
`aspect-16/9`.

There are some rules attached to this migration:

1. We can only migrate arbitrary values that is a single positive
integer, or an arbitrary value that is a fraction where the numerator
and denominator are both positive integers.
2. We make sure that some CSS can be generated once its converted to a
bare value.
2024-10-15 09:45:03 +00:00
..
codemods Migrate keyframes from JS to CSS (#14666) 2024-10-15 11:21:19 +02:00
commands/help Add initial codemod tooling (#14434) 2024-09-18 16:45:43 +02:00
template Migrate arbitrary values to bare values (#14669) 2024-10-15 09:45:03 +00:00
utils Detect and migrate static plugin usages (#14648) 2024-10-14 17:45:36 +02:00
index.test.ts Add simple JS config migration (#14639) 2024-10-11 15:27:53 +02:00
index.ts Add simple JS config migration (#14639) 2024-10-11 15:27:53 +02:00
migrate-js-config.ts Migrate keyframes from JS to CSS (#14666) 2024-10-15 11:21:19 +02:00
migrate-postcss.ts Migrate simple PostCSS setup (#14612) 2024-10-10 15:09:14 +02:00
migrate.ts Add simple JS config migration (#14639) 2024-10-11 15:27:53 +02:00
stylesheet.ts Migrate utilities in CSS files imported into layers (#14617) 2024-10-10 15:44:04 +02:00