accent-color
Limited availability97% of users
Sets the accent color for user-interface controls like checkboxes, radio buttons and range sliders. It allows you to style native forms with your brand color with a single line of CSS.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyComingNot in yet, so not every major browser supports it.
The old way and the modern waySee the snippet: Styling form controls without rebuilding them →
Old way 8 lines
input[type="checkbox"] {
appearance: none;
width: 1.25rem;
height: 1.25rem;
border: 2px solid ...;
background: ...;
border-radius: ...;
}Modern 3 lines
input[type="checkbox"],input[type="radio"] {
accent-color: #7c3aed;
}See how modern your own CSS is.Check your CSS →
Quick facts
- Initial value
auto- Inherited
- Yes
- Applies to
- all elements
- Animation type
- byComputedValueType
Quick example
form.brand-theme {
accent-color: var(--primary-color);
/* styles all native checkboxes and radio buttons to match your brand */
}Values
autoRelated snippet
Styling form controls without rebuilding themColors →accent-color browser support
BaselineLimited availabilityThis feature is not Baseline because it does not work in some of the most widely-used browsers.Not ready for production without a fallback.
Usage97%of people can use this3% use a browser without it.
Browsers
93+
92+
26.2+
93+Mobile
92+Android
26.2+iOS