I'm trying to style a label that has a checkbox inside of it. I want the label to change color when the checkbox is selected.
<label>
<input type="checkbox">
</label>
Using SASS and the ampersand, this should be possible with:
input {
background-color: red;
&:checked {
label & {
background-color: green;
}
}
}
I ran a test and this worked, however, this doesn't work in Shopify. In fact, Shopify doesn't seem to compile it at all. Am I missing something?