Answer the question
In order to leave comments, you need to log in
How to specify colors in scss?
For the first time I am building a site for wordpress using sass and the following difficulty arose.
I specify colors through root
:root {
--mycolor-1: #488cff;
--mycolor-2: #ffff8c;
}
$color-1: var(--mycolor-1);
.text-color-1 { color: $color-1; }
.bg-color-1 { background-color: $color-1; }
Answer the question
In order to leave comments, you need to log in
I solved the issue, removed this div to the very bottom of the html, but the question of why z-index did not work remained
You need to prioritize one thing.
I prefer css variables, but I store configs in sass variables:
$color-black: #000;
:root {
--color-black: #{$color-black}
}
.class {
color: $color-black; // fallback
color: var(--color-black);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question