Improve upgrade tool to pretty print --spacing(2)
#15596
Merged
+43
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 tom-[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:
But a simpler solution, is to wrap the
--spacing(2)
in parens to remove the underscores and improve the readability of the---
characters.