-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Minify arbitrary values when printing candidates #14720
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @RobinMalfait and the rest of your teammates on Graphite |
RobinMalfait
commented
Oct 18, 2024
'hover:peer-[&_p]:', | ||
'hover:peer-[&_p]:focus:', | ||
'peer-[&:hover]:peer-[&_p]:', | ||
['', ''], // no variant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created a tuple with in
and out
(similar to the candidate above)
RobinMalfait
changed the title
Simplify candidate printing
Minify arbitrary values when printing candidates
Oct 18, 2024
adamwathan
reviewed
Oct 18, 2024
adamwathan
reviewed
Oct 18, 2024
This was referenced Oct 18, 2024
This is the only thing where I know we _don't_ want spaces. But this was already handled when adding spaces internally.
RobinMalfait
force-pushed
the
robin/simplify_candidate_printing
branch
from
October 18, 2024 18:11
c22846e
to
8500630
Compare
adamwathan
reviewed
Oct 18, 2024
adamwathan
approved these changes
Oct 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 will optimize and simplify the candidates when printing the candidate again after running codemods.
When we parse a candidate, we will add spaces around operators, for example
p-[calc(1px+1px)]]
will internally be handled ascalc(1px + 1px)
. Before this change, we would re-print this as:p-[calc(1px_+_1px)]
.This PR changes that by simplifying the candidate again so that the output is
p-[calc(1px+1px)]
. In addition, if you wrotep-[calc(1px_+_1px)]
then we will also simplify it to the concise formp-[calc(1px_+_1px)]
.Some examples:
Input:
Output before:
Output after:
This is alternative implementation to #14717 and #14718
Closes: #14717
Closes: #14718