Skip to content

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

Merged
RobinMalfait merged 3 commits into
nextfrom
fix/pretty-print-spacing-function
Jan 10, 2025
Merged

Improve upgrade tool to pretty print --spacing(2)#15596
RobinMalfait merged 3 commits into
nextfrom
fix/pretty-print-spacing-function

Conversation

@RobinMalfait

Copy link
Copy Markdown
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
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