CSS accent-color Form Previewer
The accent-color property recolors native form controls without replacing them with custom widgets. This previewer renders a checkbox, a pair of radio buttons, a range slider and a progress bar in a light card and a dark card at once, so you can judge one color against both backgrounds. Pick from the color input, type a six-digit hex, or use one of six swatches, then copy the one-line rule.
How to preview an accent color
- Choose a color with the picker next to Accent color, or type a six-digit hex such as
#6E56CFinto the text field. Invalid hex is ignored until it is complete. - Or click one of the six Swatches: purple, blue, green, red, amber or teal.
- Compare the controls in the Light scheme and Dark scheme cards. Both update together.
- Click Copy to copy a
:root { accent-color: ... }rule.
What accent-color touches and what it does not
accent-color applies to checkboxes, radio buttons, range inputs and the progress element. It does not restyle selects, text inputs, buttons or date pickers. The property is inherited, so setting it on :root tints every supported control on the page at once, and you can override it on a single form or fieldset when one section needs its own color.
The browser picks the check mark color itself so it contrasts with your accent, which is convenient but out of your control. Test the accent against both backgrounds: a dark navy that reads well on white can nearly vanish on near-black, and a pale tint does the reverse. That is why the light and dark cards sit side by side.
Native controls keep their built-in keyboard and assistive technology behavior, which is the main reason to prefer this property over a custom-drawn checkbox. The preview does not measure contrast, so check the accent against the card background for WCAG 1.4.11 non-text contrast (3:1) with a contrast tool, especially for the filled checkbox and the slider track.