Skip to content

Convert , to in grid-cols-[…], grid-rows-[…], and object-[…]#14927

Merged
adamwathan merged 4 commits intonextfrom
fix/migrate-comma-to-spaces
Nov 11, 2024
Merged

Convert , to in grid-cols-[…], grid-rows-[…], and object-[…]#14927
adamwathan merged 4 commits intonextfrom
fix/migrate-comma-to-spaces

Conversation

@RobinMalfait
Copy link
Member

@RobinMalfait RobinMalfait commented Nov 8, 2024

This PR converts legacy commas in arbitrary values to spaces.

In Tailwind CSS v3, we allowed commas in arbitrary values for grid-cols-[…], grid-rows-[…], and object-[…] for backwards compatibility. The underlying CSS value did use spaces instead of commas.

This PR adds a code mod where convert the commas to spaces when we see them.

Test plan:

Running this on Catalyst it goes from this:

image

To the expected value of:

image

@RobinMalfait RobinMalfait changed the title Convert , to in legacy arbitrary values Convert , to in grid-cols-[…], grid-rows-[…], and object-[…] Nov 8, 2024
@RobinMalfait RobinMalfait marked this pull request as ready for review November 8, 2024 16:25
@RobinMalfait RobinMalfait requested a review from a team as a code owner November 8, 2024 16:25
@RobinMalfait RobinMalfait force-pushed the fix/migrate-comma-to-spaces branch from e4ec750 to 590d3f5 Compare November 9, 2024 00:55
Copy link
Contributor

@philipp-spiess philipp-spiess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Great to see the impact on this on Catalyst in your test plan 😎

CHANGELOG.md Outdated
- _Upgrade (experimental)_: Remove whitespace around `,` separator when print arbitrary values ([#14838](https://github.com/tailwindlabs/tailwindcss/pull/14838))
- _Upgrade (experimental)_: Fix crash during upgrade when content globs escape root of project ([#14896](https://github.com/tailwindlabs/tailwindcss/pull/14896))
- _Upgrade (experimental)_: Don't convert `theme(…/15%)` to modifier unless it is the entire arbitrary value of a utility ([#14922](https://github.com/tailwindlabs/tailwindcss/pull/14922))
- _Upgrade (experimental)_: Convert `,` to ` ` in `grid-cols-[…]`, `grid-rows-[…]`, and `object-[…]` ([#14927](https://github.com/tailwindlabs/tailwindcss/pull/14927))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this is a tid bit clearer?

Suggested change
- _Upgrade (experimental)_: Convert `,` to ` ` in `grid-cols-[…]`, `grid-rows-[…]`, and `object-[…]` ([#14927](https://github.com/tailwindlabs/tailwindcss/pull/14927))
- _Upgrade (experimental)_: Convert `,` to ` ` in arbitrary values of `grid-cols-[…]`, `grid-rows-[…]`, and `object-[…]` ([#14927](https://github.com/tailwindlabs/tailwindcss/pull/14927))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants