Hello, I’m not sure if this is the correct place to ask this, but I didn’t find any other topic where to ask it . Sorry for the possible inconvenience.
Doing the CSS lessons, I found something that looks like a contradiction.
In the lesson: “Basic CSS: Inherit CSS VariablesPassed” it says that “When you create a variable, it is available for you to use inside the selector in which you create it. This happens because CSS variables are inherited, just like ordinary properties.
To make use of inheritance, CSS variables are often defined in the :root element.”
For what I have researched, that is how it works. This is ok.
But in a previous lesson: " Basic CSS: Attach a Fallback value to a CSS VariablePassed", we use in the exercise a variable declared inside a selector different to :root or body selector. So: ¿how does it work? it shouldn’t be possible to use this variable out of the selector where it was created… isn’t it?
So, it looks like a contradiction that we could use a variable that was not created inside :root or body selector.
Why does it happens? is it just a mistake or have I missed something?
Thank you very much for your assitance.