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

Improve upgrade tool to pretty print --spacing(2) #15596

Merged
merged 3 commits into from
Jan 10, 2025

Conversation

RobinMalfait
Copy link
Member

This PR improves the upgrade tool to make sure that newly upgraded --spacing(2) CSS functions is pretty printed to prevent unambiguous looking classes (even though it compiles correctly).

If you have a class such as m-[calc(100dvh-theme(spacing.2))], then we used to convert it to m-[calc(100dvh-calc(var(--spacing)*2))]. But recently we introduced the --spacing(2) CSS function which means that the output now looks like this instead: m-[calc(100dvh---spacing(2))].

The triple - is valid because the first - is the minus sign, the next two - characters are from the function.

One solution is to introduce spaces via underscores:

m-[calc(100dvh_-_--spacing(2))]

But a simpler solution, is to wrap the --spacing(2) in parens to remove the underscores and improve the readability of the --- characters.

m-[calc(100dvh-(--spacing(2)))]

@RobinMalfait RobinMalfait requested a review from a team as a code owner January 10, 2025 11:34
@RobinMalfait RobinMalfait enabled auto-merge (squash) January 10, 2025 11:43
@RobinMalfait RobinMalfait force-pushed the fix/pretty-print-spacing-function branch from cf98fac to f6e4745 Compare January 10, 2025 13:15
@RobinMalfait RobinMalfait merged commit b4a20af into next Jan 10, 2025
5 checks passed
@RobinMalfait RobinMalfait deleted the fix/pretty-print-spacing-function branch January 10, 2025 14:07
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