Re: [csswg-drafts] [css-cascade-6] A way for <style> elements to scope to their parent element (#6606)

@andruud As far as I know, this is not currently implemented in Chrome, can you implement the new behavior in Chrome?

> Finally, we could allow `@scope` without any selector clauses, which would scope the styles to the parent of the stylesheet's owner node (or the containing tree for constructable stylesheets with no owner node).
> https://github.com/oddbird/css-sandbox/pull/22/files#diff-959903105b7abdfb2fa2540f104fdd8d7f347e6f339814fdf5e57f7e65f235e9

```html
<div>
  <style>
    @scope {
      p { color: red; }
    }
  </style>
  <p>this is red</p>
</div>
<p>not red</p>
```

That would be equivalent to:

```html
<div id="foo">
  <style>
    @scope (#foo) {
      p { color: red; }
    }
  </style>
  <p>this is red</p>
</div>
<p>not red</p>
```

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


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

Received on Thursday, 27 October 2022 14:39:37 UTC