[csswg-drafts] [css-cascade-6] Handle sibling-proximity in @scope (#7751)

tabatkins has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-cascade-6] Handle sibling-proximity in @scope ==
Branching off of #7233...

Currently, `>>` is a shorthand for writing an `@scope`. That is, anytime you see `.foo >> .bar {...}`, it's equivalent to `@scope .foo { .bar {...}}`.

Now that we've agreed to add `++` (or `~~`) to do sibling proximity, it would be nice to keep the consistency between the two syntaxes.

I suggest `@scope siblings ... {}`, where the `...` is the current scope prelude stuff. If you specify `siblings` the lower bound, and all contained selectors, are auto-scoped to be siblings of the upper bound element, and we apply sibling-distance proximity as the tiebreaker rather than ancestor-distance proximity.

Need to be careful with the definitions to make sure descendant-scopes can still be nested; I guess descendant-scopes would scope the upper bound as a sibling but switch back to normal scoping for their lower bound. I believe this'll reproduce the behavior of `.foo >> .bar ++ .baz >> .qux`.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7751 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 15 September 2022 21:42:39 UTC