I have a component that declares and use a css variable "--test: red"
But I want to re-declare this variable with a new color outside this component.
https://stackblitz.com/edit/js-va9k9q?file=style.css
Is this rule right?
:root *{
--test: green;
}
Why * is required? If I remove this, it doesn't work
:root *{
--test: green;
}
#app {
--test: red;
}
#app h1{
background-color: var(--test);
}
Html
<html>
<body>
<div id="app"><h1>Example</h1></div>
</body>
</html>
The final result must have a green background-color
