Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure we migrate theme(spacing.1) to var(--spacing-1) correctly #14724

Merged
merged 4 commits into from
Oct 19, 2024

Conversation

RobinMalfait
Copy link
Member

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:

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

@RobinMalfait RobinMalfait requested a review from a team as a code owner October 18, 2024 19:58
`theme(spacing.1)` wasn't converted because we generated `--spacing-`
and that doesn't exist therefore we kept it as-is.
@RobinMalfait RobinMalfait force-pushed the robin/ensure_we_migrate_theme_spacing.1_correctly branch from 1fb81c3 to 72ac8c3 Compare October 18, 2024 20:47
CHANGELOG.md Outdated Show resolved Hide resolved
@RobinMalfait RobinMalfait merged commit 5ce37c4 into next Oct 19, 2024
1 check passed
@RobinMalfait RobinMalfait deleted the robin/ensure_we_migrate_theme_spacing.1_correctly branch October 19, 2024 13:19
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.

2 participants