- From: Shaw Jia via GitHub <sysbot+gh@w3.org>
- Date: Fri, 07 Jul 2023 15:56:20 +0000
- To: public-css-archive@w3.org
> BTW, it seems that what you actually want is a [scoping limit](https://drafts.csswg.org/css-cascade-6/#scoping-limit). Something like
> 
> ```css
> @scope (.select) to (.deselect) {
>   * { /* ... */ }
> }
> ```
Yes that's exactly what I want, I'm trying to MacGyver a rudimentary version of `@scope`, by stacking a few of those selectors:
```
/* not nested */
.select *:not(.deselect, .deselect *),
/* nested x1 */
.deselect .select *:not(.deselect .deselect, .deselect .deselect *),
/* nested x 2 */
.deselect .deselect .select *:not(.deselect .deselect .deselect, .deselect .deselect .deselect *) {
    /* scoped styles */
}
```
Yes, it doesn't support infinite nesting, but realstically you won't be nesting more than one or two times anyways so it's enough for my needs.
Of course, actual `@scope` would be great, but I'm not expecting full browser support to be here anytime soon.
-- 
GitHub Notification of comment by miragecraft
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9038#issuecomment-1625619205 using your GitHub account
-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 7 July 2023 15:56:22 UTC