Is there a way to set the value of a property for a CSS class dynamically, without using a compiler or javascript.
:root {
--color-0 : red;
--color-1 : blue;
--color-3 : yellow;
}
.bg-color-[*] {
background-color: var(--color-[*]);
}
Then in my html I could pass in the numeric value that is used to select the correct variable
<div class="bg-color-1">This background should be red</div>
<div class="bg-color-2">This background should be blue</div>
<div class="bg-color-3">This background should be yellow</div>