I want to change the accent color of checkboxes, sliders, radio buttons and select components. Is there any easy method for doing so?
I want to change the accent color of checkboxes, sliders, radio buttons and select components. Is there any easy method for doing so?
You can use the new accent-color property if you are using Chrome version 93+.
#checkbox {
accent-color: limegreen;
}
<input type="checkbox" id="checkbox"/>
Browser support is still limited though. It will be supported in the next versions of Firefox and Edge too.
Using filter: hue-rotate for your inputs is useful
hue-rotate is counted in degrees that means that you can use 0-360deg
(This is supported in every browser)
Here's an example:
input {
filter: hue-rotate(320deg)
}
<input type="checkbox" checked><br>
<input type="radio" checked><br>
<input type="range">