CSS Function

accent-color

The accent-color property sets the accent color for UI controls like checkboxes, radio buttons, range sliders, and progress bars.

Syntax

accent-color: auto | <color>

Parameters

NameTypeRequiredDescription
autokeywordNoUses the UA default accent color
colorcolorNoAny valid CSS color value

Examples

Brand-colored checkboxes

Applies blue-500 to checkbox fill color.

css
input[type="checkbox"] {
  accent-color: #3b82f6;
}

Global accent

Sets a global accent color for all form controls.

css
:root {
  accent-color: oklch(0.65 0.25 260);
}

Tailwind utility

Tailwind provides accent-{color} utilities.

html
<input type="checkbox" class="accent-blue-500" />

Browser Support

Chrome

v93++

Firefox

v92++

Safari

v15.4++

Edge

v93++

Opera

v79++

Tailwind Equivalent

You can achieve similar results in Tailwind CSS using the following utility classes:

accent-{color}: accent-blue-500, accent-red-600, etc.

Frequently Asked Questions

Which elements does accent-color affect?
Checkboxes, radio buttons, range inputs, and progress bars. It does not affect buttons, text inputs, or select menus.
Does accent-color automatically adjust text contrast?
Yes. Browsers automatically choose a contrasting text/checkmark color to ensure readability against the accent color.

Explore CSS Color Tools

Try our free tools to work with accent-color and other CSS color functions.

Open Tools