Is there a way to dynamically change the text color of a span element based on its content without using nth-child or inline classes? Unfortunately, due to CMS restrictions, those options are not available. If this can be achieved solely with CSS, that would be ideal. Otherwise, what alternative method could be used?
Thank you in advance.
.selected-color span.value{
color:grey;
}
.selected-color .value{
color:grey; /*default color*/
}
<div class="selected-color">
<div class="value">red</div>
<div class="value">green</div>
<div class="value">blue</div>
<div class="value">yellow</div>
</div>