diff: skip selector-list factoring in the canonical projection - #215
Open
samoht wants to merge 1 commit into
Open
diff: skip selector-list factoring in the canonical projection#215samoht wants to merge 1 commit into
samoht wants to merge 1 commit into
Conversation
Factoring depends on how the input grouped its selectors, so a sheet written factored and one written inline canonicalised to different forms and the differ reported the gap as a missing declaration.
This file contains hidden or 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
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.
Selector-list factoring is input-shape dependent: whether a shared declaration can be lifted depends on how the input grouped its selectors, and once lifted, an intervening rule writing the same property can make putting it back unsafe. The canonical projection was therefore not confluent - the same stylesheet written factored and written inline mapped to different forms.
In a Tailwind parity run this showed up as
.text-xs\/4losing a declaration:expand_listsundoes the grouping but cannot restore the merge, because.text-xssits between the two rules and writesline-heighttoo. The differ then pairs the first rule and reports the second's declaration as missing. Both sides now canonicalise to the reference's single rule.Css.optimizegains?factor(defaulttrue); only the canonical projection passesfalse, sofmt --minifystill factors.