I am encountering an issue with a CSS variable:
:root{
--red: hsl(0, 100%, 74%);
}
Despite defining the variable, it does not work in the following code snippet:
.page-wrapper{
background-image: linear-gradient(hsla(var(--red),.6), hsla(var(--red),.6)), url(./images/bg-intro-desktop.png);
} /**** This does not work for some reason****/
However, when I substitute var(--red)
with its actual values, the code functions correctly:
.page-wrapper{
background-image: linear-gradient(hsla(0, 100%, 74%,.6), hsla(0, 100%, 74%,.6)), url(./images/bg-intro-desktop.png);
} /**** This works well ****/
If anyone has insights on resolving this issue, I would greatly appreciate your assistance!