Does 'color: revert;' inherit parent element's color value, or reset to browser default for the selected element?

https://jsfiddle.net/cd1o3j6x/1/

It’s extended from the example in this learning section.

it resets the property to its inherited value if it inherits from its parent or to the default value established by the user agent’s stylesheet

(from https://developer.mozilla.org/en-US/docs/Web/CSS/revert)

So why does the “revert” link I added render blue while its parent has color property of green?

My browser is Edge 99.

Hi @casinero.triste and welcome to the community :wave:

Nice catch!
I think this sentence from the “revert” article is wrong and should be removed. The user-agent stylesheet takes precedence over whether the property is inherited or not when using revert. This is nicely shown by your example code.

Could you open an issue on GitHub: Issue with “revert”
It would also make sense to post your code there that shows the behavior and ask to extend the example on https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Cascade_and_inheritance

Thanks for reporting and have a nice day,
Michael

1 Like

@mikoMK Thank you for your reply.
I’ve opened an issue as you said by the way.

1 Like

Thank you very much!
Let’s see if they agree. :blush:

Reference: