samedi 4 juin 2022

How can I add an accent-color to indeterminate checkbox state

Chrome version 102.

How to add an accent-color to indeterminate checkbox state?

<input type="checkbox" class="my-checkbox"/> 

.my-checkbox {
   accent-color: blue
}

//checkbox is blue when checked

const checkbox = document.getElementById("my-checkbox");
checkbox.indeterminate = true; 

//checkbox color turns grey



Aucun commentaire:

Enregistrer un commentaire