Color Beginner

Styling form controls without rebuilding them

The old way was appearance: none plus dozens of lines to rebuild the control. accent-color changes the native control color in one property.

Modern
3 lines
1input[type="checkbox"],
2input[type="radio"] {
3  accent-color: #7c3aed;
4}
Old 20+ lines
1input[type="checkbox"] {
2  appearance: none;
3  width: 1.25rem; height: 1.25rem;
4  border: 2px solid ...;
5  background: ...; border-radius: ...;
6  /* + :checked state, focus, etc. */
7}
Widely available Since 2022 93% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2022.

93+
92+
15.4+
93+
native controls, one property
accent-color: var(--accent);
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more
⚑

One property

Set the accent color. Checkboxes, radios, range, and progress use it. No rebuild.

✦

Native behavior kept

Focus, keyboard, and screen reader behavior stay intact. You only change the color.

∞

Theme friendly

Use a custom property. Dark mode or theme switch updates controls automatically.

Lines Saved
20+ β†’ 3
85%+ less code
Old Approach
appearance: none
Rebuild from scratch
Modern Approach
accent-color
Native control, one property

How it works

To style checkboxes and radios you used to set appearance: none and then rebuild the control with width, height, border, background, border-radius, and :checked states. Dozens of lines and you had to handle focus and accessibility yourself.

accent-color tells the browser which color to use for the control's accent (check mark, radio dot, range thumb). The control stays native, so focus and keyboard behavior are unchanged. One line, theme-aware if you use a variable.

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC