Issue
Hi i am trying to use css variables to predefine colors for example.
Here is my app.component.css
:root {
--main-bg1: rgb(26, 28, 29);
--main-bg2: rgb(66, 77, 79);
--main-bg3: rgb(93, 109, 112);
}
Problem is that when i use this variable in other components it wont work. For example
.some-class{
background-color: var(--main-bg1);
}
How can i make this work in angular?
Solution
Move this:
:root {
--main-bg1: rgb(26, 28, 29);
--main-bg2: rgb(66, 77, 79);
--main-bg3: rgb(93, 109, 112);
}
to styles.css
and then it will work
Answered By - robert
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.