Re: [csswg-drafts] [css-cascade-6] The specificity of a scope rule (#8500)

Personally, I can't confirm that scopes adding to the specificity is more intuitive.

Either way of handling this seems easy enough to build a mental model around:

In the *yes* case, one can think of the upper boundary as a sort of fancier descendant selector, as that is, in a sense, what the scope does.

In the *no* case, one can think of scopes the same way as media queries: They only restrict when or where a rule applies.

The latter seems a bit more consistent to me, because

1. `@scope` looks similar to `@media`, so I expect it to work in a similar way.
2. Unless prefixed with `:scope`, selectors inside the scope's block aren't entirely nested inside the scope. This breaks the mental model of concatenating the selectors anyway.

From a practical perspective, I don't see much value in having scopes change specificity, as that is needless overlap with `@layer`s in my view. The two can be easily combined.

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


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

Received on Tuesday, 28 February 2023 15:33:32 UTC