- From: Benoît Rouleau via GitHub <noreply@w3.org>
- Date: Sat, 24 Jan 2026 22:22:40 +0000
- To: public-css-archive@w3.org
I believe my proposal in #13213 would make it possible to achieve what is being proposed here, with no change to `@scope`. Correct me if I'm wrong / misunderstanding the goal of this proposal, but it seems to me that by simply adding a `presentational` keyword that works similarly to `revert` except that it doesn't revert styles from presentational attributes (like `revert-layer`), it would be possible to fully isolate a scope with this relatively simple code:
```css
@layer ^strong {
@scope (.no-styles-from-outside-plz) {
& { all: initial; }
* { all: presentational; }
/* isolated styles here */
}
}
```
- Everything is in a `^strong` layer which defeats any CSS that comes before or after it, including unlayered styles (of course if there was _another_ strong layer defined after it – or is it before? – it could override some of our styles, but that would likely be intentional).
- Inside the scope, we prevent outside styles from leaking in with two rules that have zero specificity so that styles that follow are not affected by them:
- `& { all: initial; }` blocks inheritance on the scope root (reminder: `&` is short for `:where(:scope)` in that context)
- `* { all: presentational; }` blocks the cascade from outside our `@scope`, without affecting inheritance within it.
Thoughts?
--
GitHub Notification of comment by benface
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11002#issuecomment-3795639646 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Saturday, 24 January 2026 22:22:41 UTC