CSS accent-color Property

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 4 Examples
Forms & UI

What You’ll Learn

The accent-color property lets you change the built-in highlight color of certain form controls. It is a simple way to make checkboxes, radio buttons, sliders, and progress bars match your site theme without rebuilding them from scratch.

01

Native Controls

Style browser controls safely.

02

Syntax

Use one clear CSS property.

03

Color Values

Named, hex, rgb, hsl, variables.

04

Inheritance

Set it once on a parent.

05

Accessibility

Keep contrast readable.

06

Fallbacks

Understand browser behavior.

Definition and Usage

The accent-color CSS property sets the accent color used by the browser for selected or active parts of supported form controls. For example, it can turn a checked checkbox red, make a selected radio button purple, or color the filled track of a range input.

💡
Beginner Tip

Use accent-color when you want native form controls to match your brand color while keeping their built-in keyboard and screen-reader behavior.

📝 Syntax

Write accent-color like any other CSS property. The value is usually a color:

syntax.css
selector {
  accent-color: color;
}

Basic Example

accent-color.css
input[type="checkbox"] {
  accent-color: red;
}

Syntax Rules

  • Apply accent-color to the control itself or a parent container.
  • The value is any valid CSS color, plus the keyword auto.
  • The property is inherited, so one rule can style many controls.
  • Unsupported browsers ignore it and keep default native control colors.

⚡ Quick Reference

QuestionAnswer
Initial valueauto
Applies toAll elements, but only supported controls visibly use it
InheritedYes
AnimatableBy computed color value
Common useCheckboxes, radio buttons, sliders, and progress bars

💎 Property Values

The accent-color property accepts standard CSS color values. It also accepts auto, which lets the browser choose the default system accent color.

ValueExampleMeaning
Named coloraccent-color: red;Uses a CSS color name
Hex coloraccent-color: #2563eb;Uses a hexadecimal color
RGB or HSLaccent-color: hsl(142 72% 29%);Uses functional color notation
CSS variableaccent-color: var(--brand);Uses a reusable theme color
autoaccent-color: auto;Uses the browser or system default
red #2563eb green purple

Supported Form Controls

accent-color works on native controls where the browser exposes a visible accent. The most common controls are:

  • <input type="checkbox"> — changes the checked mark or checked background color.
  • <input type="radio"> — changes the selected radio indicator.
  • <input type="range"> — changes the active part of the slider in supporting browsers.
  • <progress> — changes the progress fill in supporting browsers.

👀 Live Preview

These controls use the same red accent color from the reference example:

65%

Examples Gallery

Try accent-color with checkboxes, radio buttons, sliders, and theme variables.

📚 Common Form Controls

Use accent-color to theme native checkboxes, radio buttons, sliders, and progress elements without rebuilding them from scratch.

Example 1 — Checkbox Accent Color

This is the simplest use case. Select a checkbox and let the browser draw it using your chosen color.

checkbox-accent.html
<style>
  input[type="checkbox"] {
    accent-color: red;
  }
</style>

<label>
  <input type="checkbox" checked>
  Check me out!
</label>
Try It Yourself

How It Works

The checkbox remains a normal browser checkbox, but its checked state uses red as the accent color.

Example 2 — Radio Button Group

Apply accent-color to a group of radio buttons to make the selected option match your theme.

radio-accent.html
<style>
  .plan-options {
    accent-color: #2563eb;
  }
</style>

<div class="plan-options">
  <label><input type="radio" name="plan" checked> Basic</label>
  <label><input type="radio" name="plan"> Pro</label>
</div>
Try It Yourself

How It Works

Because accent-color is inherited, setting it on .plan-options styles supported controls inside the group.

Example 3 — Range Slider and Progress

Use the same accent color for interactive progress-like controls.

range-progress-accent.html
<style>
  input[type="range"],
  progress {
    accent-color: seagreen;
  }
</style>

<input type="range" value="70">
<progress value="70" max="100">70%</progress>
Try It Yourself

How It Works

The filled portions of the controls use seagreen where the browser supports accent styling for those controls.

🎨 Theme & Variables

Store your brand color once and reuse it across every supported form control in a form or layout.

Example 4 — Theme Color with CSS Variables

For real projects, store your brand color in a custom property and reuse it.

theme-accent.css
:root {
  --brand-color: #7c3aed;
}

form {
  accent-color: var(--brand-color);
}
Try It Yourself

How It Works

Changing --brand-color updates every supported control that uses the variable.

♿ Accessibility

  • Keep enough contrast — Choose an accent color that is easy to see against the control background.
  • Do not rely on color alone — Labels, checked states, and text should still explain the choice.
  • Prefer native controls when possible — They already support keyboard navigation and screen readers.
  • Test focus states — Make sure the control remains visible when focused with the keyboard.

🧠 How accent-color Works

1

You set a color in CSS

Apply accent-color to a control or parent element using any standard CSS color value.

CSS rule
2

The browser maps it to native UI

Supported controls use that color for checked marks, selected radio dots, slider tracks, and progress fills.

Rendering
3

Inheritance spreads the theme

Set the property on a form or wrapper and every supported child control inherits the same accent.

Cascade
=

Branded form controls

Native controls keep keyboard and screen-reader behavior while matching your site colors.

Universal Browser Support

accent-color is supported in all modern browsers. Older browsers ignore the property and keep default control styling.

Baseline · Modern browsers

Theme form controls in today’s browsers

Chrome, Edge, Firefox, Safari, and Opera all support accent-color for native form controls in current versions.

94% Modern browser support
Google Chrome 93+ · Desktop & Mobile
Full support
Mozilla Firefox 92+ · Desktop & Mobile
Full support
Apple Safari 15.4+ · macOS & iOS
Full support
Microsoft Edge 93+ · Chromium
Full support
Opera 79+ · Modern versions
Full support

Fallback behavior

When unsupported, controls still work with the browser’s default colors.

💻
Internet Explorer No support · Default native colors remain
None
accent-color property 94% supported

Bottom line: Use accent-color as progressive enhancement. Unsupported browsers still render usable form controls.

Conclusion

The accent-color property is a small but useful CSS feature for styling native form controls. It lets you match checkboxes, radio buttons, sliders, and progress elements to your site colors without losing the benefits of browser-built controls.

For beginners, the main idea is simple: choose a readable color, apply it to supported controls, and let the browser handle the detailed control styling.

💡 Best Practices

✅ Do

  • Use accent-color for simple native form control theming
  • Set it on a parent form when many controls share one color
  • Use CSS variables for brand or theme colors
  • Check contrast in light and dark themes
  • Keep labels clear and descriptive

❌ Don’t

  • Use very light colors that make checked states hard to see
  • Expect every form control to be affected
  • Remove native controls only for visual reasons
  • Depend on color as the only way to communicate state
  • Forget to test in the browsers your audience uses

Key Takeaways

Knowledge Unlocked

Five things to remember about accent-color

Use these points when styling your next form.

5
Core concepts
02

Common Controls

Checkbox, radio, range, progress.

Scope
🖌 03

Color Values

Use any standard CSS color.

Values
🔁 04

Inherited

Can be set on a parent.

Cascade
05

Accessible

Keep contrast clear.

A11y

❓ Frequently Asked Questions

The accent-color property changes the theme color of certain native form controls, such as checkboxes, radio buttons, range sliders, and progress elements.
Common supported elements include input type=checkbox, input type=radio, input type=range, and progress. Browser support can vary slightly by control.
Yes. You can use named colors, hex values, rgb(), hsl(), currentColor, and CSS custom properties.
No. It is best for quick native control theming. Fully custom controls still require custom CSS, but they also require more accessibility care.
Yes, accent-color is inherited. Setting it on a form or parent container can affect supported controls inside that container.

Practice in the Live Editor

Open the HTML editor, apply accent-color, and preview form controls instantly.

HTML Editor →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful