Skip to content

Migrate theme(…) to --theme(…), migrate calc(var(--spacing)*x) to --spacing(x) #15579

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

Merged
merged 6 commits into from
Jan 9, 2025

Conversation

RobinMalfait
Copy link
Member

This PR improves the codemod tool to simplify 2 things:

  1. Whenever you have a theme(…) call, we try to change it to a var(…), but if that doesn't work for some reason, we will make sure to at least convert it to the more modern --theme(…).
  2. When converting theme(spacing.2), we used to convert it to calc(var(--spacing)*2), but now we will convert it to --spacing(2) instead.

@RobinMalfait RobinMalfait requested a review from a team as a code owner January 9, 2025 12:15
@RobinMalfait RobinMalfait force-pushed the feat/migrate-css-functions branch from bebaf72 to c64290b Compare January 9, 2025 12:16
@RobinMalfait RobinMalfait marked this pull request as draft January 9, 2025 12:31
@RobinMalfait
Copy link
Member Author

RobinMalfait commented Jan 9, 2025

TODO:

  • Make sure that we only use --theme() if it's using the modern syntax, not the old dot-notation based syntax.

@RobinMalfait RobinMalfait force-pushed the feat/migrate-css-functions branch from ba9bc9b to 0bfae7a Compare January 9, 2025 15:53
@RobinMalfait RobinMalfait marked this pull request as ready for review January 9, 2025 15:54
Only inject `var(…)` for CSS variables, not CSS functions that look like
variables. This simplifies it by just checking for a `(`.
@RobinMalfait RobinMalfait merged commit 82589eb into next Jan 9, 2025
5 checks passed
@RobinMalfait RobinMalfait deleted the feat/migrate-css-functions branch January 9, 2025 16:17
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