The accent-color property lets you customize the accent color of form controls like checkboxes, radio buttons, and range sliders. Here's how to use it.
Basic Usage#
Supported Elements#
Brand Theming#
Dark Mode Support#
Form Styling#
Checkbox Group#
Radio Button Group#
Range Slider#
Progress Indicators#
Toggle Switch with accent-color#
Semantic Colors#
Survey/Rating#
Accessibility#
Auto Value#
Best Practices#
Usage:
✓ Set at :root for consistency
✓ Use CSS custom properties
✓ Match brand colors
✓ Support dark mode
Accessibility:
✓ Ensure sufficient contrast
✓ Test with high contrast mode
✓ Maintain focus visibility
✓ Don't rely on color alone
Supported Elements:
✓ checkbox
✓ radio
✓ range
✓ progress
✓ meter
Avoid:
✗ Over-customizing native controls
✗ Forgetting focus states
✗ Inconsistent colors
✗ Poor contrast ratios
Conclusion#
The accent-color property provides a simple way to theme native form controls with your brand colors. Apply it at the root level for consistency, use CSS custom properties for easy theming, and ensure you support both light and dark modes. It works with checkboxes, radio buttons, range sliders, and progress elements, making it easy to create cohesive form designs while maintaining native accessibility features.