- From: Oriol Brufau via GitHub <noreply@w3.org>
- Date: Tue, 12 May 2026 19:12:19 +0000
- To: public-css-archive@w3.org
I think the problem is with `revert-rule`, not `revert`. Instead of
> the cascaded value is rolled back such that the [specified value](https://drafts.csswg.org/css-cascade-5/#specified-value) is calculated as if the current [style rule](https://drafts.csswg.org/css-syntax-3/#style-rule) had not been present at all
I think it should rather behave exactly as `revert-layer` would, if each rule was wrapped inside a sublayer.
E.g. here `revert-layer` has a different behavior than removing the layer:
```html
<!DOCTYPE html>
<style>
#foo {
@layer { color: magenta }
@layer { color: revert-layer !important; }
@layer { color: cyan; }
}
#bar {
@layer { color: magenta }
/*@layer { color: revert-layer !important; }*/
@layer { color: cyan; }
}
</style>
<div id="foo">magenta</div>
<div id="bar">cyan</div>
```
--
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13916#issuecomment-4433874264 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 12 May 2026 19:12:23 UTC