[csswg-drafts] [css-cascade-6] reusable named scopes (#10336)

mayank99 has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-cascade-6] reusable named scopes ==
_(This was originally posted in https://github.com/w3c/csswg-drafts/issues/9742#issuecomment-2002084564 but moved to its issue later.)_

Proposal:

A scope _statement_, similar to a layer statement, could be used to create a reusable named scope. For example:

```css
@scope foo (.start) to (.end);
```

A reusable named scope can then be used without specifying `<scope-start>`/`<scope-end>`:

```css
@scope foo {
  p { color: red; }
}
```

The main thing this enables is avoiding the need to repeat selectors for every use.

---

Open questions:
- how do we handle duplicate scope names?
- how do we differentiate between [named scopes](https://github.com/w3c/csswg-drafts/issues/9742) and reusable named scopes?

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10336 using your GitHub account


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

Received on Wednesday, 15 May 2024 04:30:23 UTC