Re: [w3ctag/design-reviews] Early design review of light-DOM CSS Scope proposal (#593)

> I don't quite understand how to read the pen, but…

Your clarifications/comments (on most of these) are the same conclusions I came to, so we're on the same page here, even if I'm not communicating it clearly. :+1:

> Not a huge fan of the repetition of the scope root. No reason to disallow selector lists as the lower boundary (or even both), there is precedent of pseudo-classes accepting selector lists.

Makes sense. :+1:

> `S` was a variable that could be any selector, not a type selector. E.g. what does `@scope (.foo) to (.foo)` match? It seems to me that it would match `.foo` and not its descendants, but I'm not sure.

I understood that, but figured I could demonstrate it with a type as well as with a class or anything else. I had intended lower-boundaries to be _descendants_ of the scope, never the scope itself. So I would expect `@scope (.foo) to (.foo)` would match `.foo` and all descendants until hitting a lower boundary of another element with class `.foo`. I think this behavior is more useful because it would allow authors to develop naming patterns like:

```css
@scope (.scope-media) to ([class|='scope']) {
  /* automatically end this scope when we encounter another */
}
```

If we wanted to allow single-element scopes, I would rather we use something like `@scope (.foo) to (:scope)`.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/593#issuecomment-771019890

Received on Monday, 1 February 2021 17:24:28 UTC