Re: [csswg-drafts] [css-cascade-6] Should the scope proximity calculation be impacted by nesting scopes? (#10795)

> Hm, there is a divergence, though? As in, more specific scope selectors don't necessarily equate to "more deeply nested?" e.g. `@scope (.foo.bar.baz) { .target { /*...*/ } }` versus `@scope(.a) { @scope (.b) { .target { /*...*/ } } }`

They're not identical. But it's a similar heuristic to approximate the narrowness of the selector targeting, rather than anything more nuanced about the DOM structure (which we can't currently do).

> Also, we're firmly in the realm of edge cases, but if there's an implicit selector in the nesting, what's the proposed specificity? e.g. `@scope (.a) { @scope (.b) { @scope { .target { /*...*/ } } } }`

Currently scope roots have no impact on specificity, so `.target` gives us a specificity of `[0,1,0]`. The implicit selector there only works in a DOM-nested context, and doesn't impact the specificity calculation.

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


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

Received on Thursday, 24 October 2024 22:13:47 UTC