Skip to content

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.

3 participants