CSS now has a way to say "pretend this rule didn't set this property": the revert-rule keyword. It has been Baseline Newly available since September 2026, and it's the missing piece between revert and revert-layer, which both throw away much more than you usually want.
The demo above is a small cascade lab. The card is a real element with real CSS: an inline style, two rules in a theme layer, one rule in a base layer and the browser default. Change the value of a level to revert-rule, revert-layer or revert and the stack shows which declaration ends up winning, while the browser paints the result.
The three ways to roll back the cascade
Until now we had two "undo" keywords, and both work on big groups of declarations:
revertrolls back to the previous origin. Inside your own styles, that means falling all the way back to the browser's default styles.revert-layerrolls back to the previous cascade layer. Every other rule in the same layer is ignored too.revert-rulerolls back only the current style rule. Other rules in the same layer still apply.
The specification puts it precisely: the cascaded value is rolled back "as if the current style rule had not been present at all." Then the cascade simply picks the next declaration in line: another rule in the same layer, an earlier layer, another origin, or the inherited or initial value.
Try it in the demo. With .chip.hot { background: revert-rule } the card turns teal, because the plain .chip rule in the same layer takes over. Switch to revert-layer and the whole theme layer is skipped, so you get the dark base background. With revert you lose all your author styles for that property and end up with a transparent card.
The code
This is the stylesheet the demo writes into a <style> element. JavaScript only swaps the value of each declaration, so the browser does the actual cascade:
@layer base, theme;
@layer base {
.chip { background: var(--g-base); border-radius: 18px; }
}
@layer theme {
.chip { background: var(--g-chip); border-radius: 28px; }
.chip.hot {
background: revert-rule; /* act as if this rule didn't set background */
border-radius: if(style(--shape: sharp): 4px; else: revert-rule);
}
}
The background: revert-rule line on its own is a teaching example. If you always want the previous rule to win, you can just delete the line. The keyword earns its place in two situations.
Inside if(). This is the use case both the specification and Chromium's intent to ship highlight. if() returns a value depending on a condition, but if you wanted the else branch to keep what another rule set, you had to copy that rule's value into it. With revert-rule the else branch can mean "do nothing here". In the demo, tick --shape: sharp: the corner becomes 4px. Untick it and the declaration steps aside, so the 28px from .chip comes back. The .chip.hot rule doesn't need to know what that radius is.
In the style attribute. MDN notes that the style attribute counts as its own style rule, so style="color: revert-rule" falls back to whatever your stylesheet says. The demo's top level lets you check this: an inline revert-rule hands control back to .chip.hot.
Two more details from MDN that the demo confirms. You can chain them: if .chip.hot and .chip both say revert-rule, the cascade skips both and lands on the base layer. It also works on any property, including the all shorthand.
Browser support and gotchas
According to webstatus.dev and MDN's compatibility data, revert-rule shipped in Firefox 150, Chrome and Edge 148, and Safari 27. That made it Baseline Newly available in September 2026. I ran the demo in current Chromium, Firefox and WebKit, and in all three the computed background matched the expected winner in every combination.
Things to keep in mind:
- Old browsers drop the declaration. An unknown keyword makes the whole declaration invalid, and invalid declarations are ignored. For a plain
background: revert-rulethat happens to give the same result, which is why the demo still makes sense there. Don't rely on that onceif()or anything else is in the value. To detect support, use@supports (color: revert-rule)orCSS.supports('color', 'revert-rule'), as the demo does. if()is not Baseline. MDN lists it as limited availability. Its compatibility data has it in Chrome and Edge 137 and Safari 27.3, but not in Firefox. In the demo, Firefox shows a warning and the corner stays rounded. Treatif()withrevert-ruleas progressive enhancement and make sure the result you get without it is acceptable.- Animations are a special case. The specification says that inside the animation origin,
revert-rulebehaves likerevert-layer. - It isn't a specificity tool.
revert-ruledoesn't make a rule lose to anything. It removes that one declaration from the competition, and only for the element the rule matches.
What to keep an eye on
if()reaching Firefox. That's when theif(...; else: revert-rule)pattern becomes safe for core styles rather than just enhancements.- Design systems. A component rule that only applies a token under a condition, and otherwise leaves the value to whoever set it before, is exactly what this keyword allows. I expect it to replace a fair number of "re-declare the default" overrides.
- The spec is still a draft. CSS Cascading and Inheritance Level 5 is an Editor's Draft, so the edge cases could still be refined.