I’m new with LESS and I cannot figure out how to apply variable to input field with specific data- attribute. This is my problem:
I have multiple input fields
<input type=“text” data-value=“white” />
<input type=“text” data-value=“yellow” />
<input type=“text” data-value=“red” />
and each input field has a backround image according to data-value attribute, like this:
input[data-value=“white”]{
background-image: url(“../images/white.svg”);
}
input[data-value=“yellow”]{
background-image: url(“../images/yellow.svg”);
}
input[data-value=“red”]{
background-image: url(“../images/red.svg”);
}
How can I shortend this with LESS?
Thank you in advance!