v148 · css · covered on mdn
The revert-rule keyword
A CSS cascade keyword that removes only the declarations from the current style rule while leaving declarations from other rules in the same cascade layer intact. More surgical than revert (which rolls back the entire origin) or revert-layer (which rolls back the entire layer).
this feature is documented on MDN
MDN: revert-rule
MDN documents revert-rule with a full explanation of how it fits in the cascade, comparisons with revert and revert-layer, practical examples, and browser compatibility. gendn doesn't duplicate that here.
quick reference
| Keyword | revert-rule |
|---|---|
| Used as | A CSS property value: color: revert-rule; |
| Effect | Ignores the declaration in the current rule; the property takes the value from any other matching rule in the same or earlier cascade layer |
vs. revert | revert rolls back to the user-agent or user origin; revert-rule stays in the author origin and just skips the current rule's declaration |
vs. revert-layer | revert-layer skips the whole current cascade layer; revert-rule skips only the current rule's declaration |
| Shipped in | Chrome 148 (desktop + Android) |
| ChromeStatus | 5146458504429568 — The revert-rule keyword |
| Spec | CSS Cascade Level 5 — revert-rule |
| Explainer | csswg-drafts / revert-rule-explainer.md |