Re: [csswg-drafts] [css-scoping] Inclusive vs exclusive lower boundary (#6577)

For every application I have for CSS scopes, it would make more sense to have an exclusive lower boundary. Usually one knows the first element down the tree that should be *outside* the scope, like a nested component.

But I also think that both options should be available. While `boundary > *` would semantically be equivalent to an inclusive boundary, giving it its own keyword would both make the code look nicer and signal to the browsers that both options should be reasonably optimised (I can imagine the direct child selector being slower when not specifically optimised)

However, the obvious question is whether mixing the two should be allowed; that is, having a scope end *exclusively* at one selector or *inclusively* at another.

Say we wanted to exclude anything with an ID from the scope, and any child element from a nested component, but while keeping the component inside the scope; would this be valid: `@scope (my-component) to (container-component) until ([id])`?

Of course, there'd still be the fallback of doing `@scope (my-component) until ([id], container-component>*)` in that case, but that has the same problems as not having an implicit boundary in general.

-- 
GitHub Notification of comment by DarkWiiPlayer
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6577#issuecomment-970350709 using your GitHub account


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

Received on Tuesday, 16 November 2021 14:53:11 UTC