Skip to content

fix: Correctly enclose negated downleveled interval media queries in parens (Alternative A)#333

Closed
LeoniePhiline wants to merge 2 commits intoparcel-bundler:masterfrom
LeoniePhiline:fix/media-queries-320-alternative-a
Closed

fix: Correctly enclose negated downleveled interval media queries in parens (Alternative A)#333
LeoniePhiline wants to merge 2 commits intoparcel-bundler:masterfrom
LeoniePhiline:fix/media-queries-320-alternative-a

Conversation

@LeoniePhiline
Copy link
Contributor

This is alternative A to #332 for fixing #320.

See #332 for the main proposal. To me, the main proposal is preferable.

This alternative approach uses a boolean flag on the Printer. This is sound here, as the flag is only applied when rendering MediaCondition::Feature inside a MediaCondition::Not. The former does not currently contain nested items which would interact with the flag.
However, the solution could easily become unsound when code is changed such that the code path recurses. In that case, a stack of flags for each layer would be required, as not all nested items should automatically be considered (direct) children of a negated media condition.
Soundness is not enforced by the type system.

To my mind, the original approach at #332 is preferable, as it leverages the existing types for expanding the media feature interval.

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.

1 participant