Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
davesnx
force-pushed
the
grammar-font-face-metrics
branch
from
September 22, 2026 12:46
ca959c5 to
898109f
Compare
davesnx
force-pushed
the
parser-nested-relative-selector
branch
3 times, most recently
from
September 23, 2026 06:11
68fe3df to
d4cacfe
Compare
`.parent { > .child {} }` means `.parent { & > .child {} }`. Rules inside
another rule's block now parse their prelude with
`parse_nested_selector_list`, which reads an item that starts with a
combinator as a `RelativeSelector`; the root of `[%css]`,
`[%styled.global]` and a raw stylesheet keeps rejecting it because there
is no parent to resolve against. `Selector_nesting.compute_new_prefix`
rewrites the relative selector into the explicit-`&` shape first, so both
spellings produce the same AST and the same class.
`[%styled.global]` also rejects a leading combinator inside an at-rule
block with no enclosing style rule through `needs_parent_selector`, with
the same error a parentless `&` gives, instead of shipping an unresolved
`&` in the extracted CSS.
davesnx
force-pushed
the
grammar-font-face-metrics
branch
from
September 23, 2026 06:39
a0cbd06 to
1c6b4f6
Compare
davesnx
force-pushed
the
parser-nested-relative-selector
branch
from
September 23, 2026 06:39
d4cacfe to
42eaf9c
Compare
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.
A nested rule whose prelude starts with a combinator (
.parent { > .child {} },+ .sib {},~ .sib {}) failed withParse error while reading token '>', although CSS Nesting defines it as& > .child; only a:has(> img)payload accepted a leading combinator. Rules inside another rule's block, or an at-rule's block, now parse their prelude withparse_nested_selector_list, which reads an item starting with a combinator as aRelativeSelector.Selector_nesting.compute_new_prefixrewrites it into the explicit-&shape before substitution, so both spellings produce the same AST, the same class and the same CSS. The root of[%css],[%styled.global]and a raw stylesheet keeps rejecting a leading combinator, because there is no parent to resolve against.[%styled.global]also rejects a leading combinator inside an at-rule block with no enclosing style rule (@media print { > .a {} }) with the same "no parent selector to resolve against" error a parentless&gives. Before, that input compiled and shipped a literal unresolved&in the extracted CSS.Evidence at b3ba860:
Parser_test.re: 8 shorthand cases red before and green after; 2 cases guard the root-level rejection.packages/ppx/test/css-support/nested-relative-selectors.t: each shorthand form and its&spelling render to an identical class and CSS.reason-styled-global2-top-level-relative-selector-error.t: the at-rule case errors with the caret on> .a; it compiled silently before.make format-check,make build,make test: all exit 0.Risk: two-way door. Only previously failing inputs parse, plus the new rejection of a
[%styled.global]input that was silently broken; a revert restores both.