Looping through a switch and applying a backgroun image to the buttons

I'm using OSC with Resolume - the VJ software. I have a switch that shows thumbnails (downloaded separately from Resolume). Currently I have a rather long winded approach in which I reference each button individually. Is there a way of turning this into a loop.

value {font-size: 0;
background-size: cover;

}

value:nth-child(1) {
color: blue;
background-image: url("/Thumbnails/12-1.png");
}

value:nth-child(2) {
color: blue;
background-image: url("/Thumbnails/12-2.png");
}

Yep

value {
  font-size: 0;
  background-size: cover;
  color: blue;
}

JS{

var css = ""
for (var n=1; n<=2; i++) {
  css += `
  value:nth-child(${i}) {
    background-image: url("/Thumbnails/12-${i}.png");
  }`
} 
return css

}

References:

Thanks. Looks fairly straight forward. I struggle a bit with the documentation but this makes more sense to me. It's just creating a big string of CSS! Didn't realise you can put JS in there like that. Cheers!