<form>
<label>
<input type="checkbox">
Make this red when checked
</label>
</form>
<button>Make this red too!</button>
<style>
body:has([type="checkbox"]:checked) label,
body:has([type="checkbox"]:checked) button {
color: red;
}
</style>
change label css when checkbox checked