Re: [csswg-drafts] [css-cascade-6] Scoping the subject of a `:has()` selector (#9841)

So `:in-scope` would be an opt-in way to limit the selector to the scope. This is somewhat similar to [CSS Modules `:local()` references](https://github.com/css-modules/css-modules/blob/master/docs%2Fcomposition.md#exceptions).

There is some potential for confusion as you'd have to figure out which parts of the selector are automatically in scope and which ones need `:in-scope`. But I think authors could get used to it.

Do we also need something like `:out-of-scope`? Maybe not, since only the subject of the selector is required to be within scope. e.g. `html :scope` will automatically match.

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


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

Received on Thursday, 3 July 2025 12:46:10 UTC