Full answer
Form controls are drawn by the browser, which is why they look different on each system. There are two main ways to restyle them.
The simple way is accent-color. It sets the main colour of checkboxes, radio buttons, range sliders and progress bars. One line gives the control your brand colour, and the browser still draws it, so keyboard behaviour, focus rings and high-contrast modes keep working.
The deeper way is appearance: none, which removes the native drawing. You then paint the control yourself with borders, backgrounds and a pseudo-element for the tick. This gives full control, but you must rebuild what the browser gave you: a visible focus style, a checked and an unchecked look, a disabled look, and enough colour contrast.
Keep the real input element. Do not replace it with a div, because the input already has the right role, keyboard support and form submission. Always keep a label connected to it.
The first checkbox is the native control in the brand colour. The second is drawn by CSS: it has an empty box when unchecked, and a blue background with a tick after the user checks it. Clicking the label toggles it, and a keyboard user sees a clear outline when the box has focus.
Check each state in a screen reader and with forced colours. Custom drawings sometimes disappear there, so keep a visible border.
<style>
.native { accent-color: #0a6cff; }
.custom {
appearance: none;
width: 1.25rem; height: 1.25rem;
border: 2px solid #444; border-radius: 4px;
display: inline-grid; place-content: center;
vertical-align: middle; margin: 0 0.5rem 0 0;
}
.custom::before {
content: ""; width: 0.6rem; height: 0.6rem;
transform: scale(0); transition: transform 0.1s;
background: #fff; clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0, 43% 62%);
}
.custom:checked { background: #0a6cff; border-color: #0a6cff; }
.custom:checked::before { transform: scale(1); }
.custom:focus-visible { outline: 3px solid #0a6cff; outline-offset: 2px; }
.custom:disabled { opacity: 0.5; }
</style>
<label><input class="native" type="checkbox" id="n" checked> Email me updates</label>
<label><input class="custom" type="checkbox" id="c"> I accept the terms</label>Run in Chrome 156 (headless) as a page; the snippet is wrapped in a minimal HTML document with doctype, charset and viewport meta tag. Two full runs gave identical results, and the measured values in the answer come from them.
Key points
- accent-color recolours native controls and keeps their behaviour.
- appearance: none removes native drawing and gives full control.
- Rebuild all states: checked, focus-visible, disabled.
- Keep the real input and its label for keyboard and screen readers.
- Check contrast and forced-colors mode for custom drawings.
Common mistakes
- Using appearance: none and forgetting the focus style, so keyboard users cannot see where they are.
- Hiding the input with display: none and building a fake control from divs. It removes keyboard and screen reader support.
- Setting a custom checked colour that fails the contrast ratio against the page background.
Follow-ups
- What does accent-color not change?
- Why is it better to keep the real input element than to build the control from divs?
Tips
- Start with accent-color. Say that you only go to appearance: none when the design needs it.
- Test every state: unchecked, checked, focus, disabled, and forced colours.