I would like to do something like this
html
<div class="myClass" givenValue="myValue">myText</div>
scss
.myClass {
@if (givenValue < 0) {
color: red;
} @else {
color: black;
}
}
The goal is really to move style things from html to scss. For example in angular it's possible to use ngClass but that's not what I want to do.
I know in it's possible to do this
html
<div class="fill-color" style="--color: blue;">Test</div>
scss
.fill-color {
color: var(--color);
}
It's the idea but unfortunately, it's not the solution for my case because I have an integer and @if statement.
Thank you in advance for your advices!