It turns out revert
is the one I wanted all along.
It rolls back styles to the expected browser default for each element,
rather than using the specification default for each property.
- MDN documentation
- CodePen demo
I’ve often used initial
and unset
in my CSS –
global keywords that can be applied to any property.
The difference is small, but important:
unset
allows inheritance,
while initial
does not.
But then Firefox implemented revert
and I was confused –
how is this one different from the others?!
revert
do in CSS?
and how is it different from unset
or initial
?
Repost from Mozilla Developer
It turns out revert
is the one I wanted all along.
It rolls back styles to the expected browser default for each element,
rather than using the specification default for each property.