JSFiddle - React, Tailwind, and code Playground
by fersterin
HTML
<form action="">
<input type="checkbox" id="check1">
<label for="check1">Lorem ipsum dolor sit amet.</label>
</form>
CSS
[type="checkbox"]:not(:checked) + label {
background: lightgreen;
color: white
}
[type="checkbox"]:checked + label {
background: yellow;
}