What is Forced Color Adjust?
The forced-color-adjust property is a CSS feature that gives developers granular control over how their elements behave when users enable forced colors mode in their operating system. When users activate accessibility features like Windows High Contrast Mode or macOS Increase Contrast, browsers automatically adjust colors across web pages to ensure consistency and readability. However, this automatic adjustment doesn't always work well for every component--color pickers, data visualizations, and branded elements may need to maintain their original colors to remain functional or recognizable.
The property allows you to opt specific elements out of forced colors mode while leaving the rest of your page properly adjusted. This targeted approach means you don't have to choose between full accessibility compliance and component functionality. Instead, you can create an experience that respects user preferences while maintaining critical visual elements that rely on specific colors.
Forced colors mode works by replacing most author-defined colors with a limited palette of system colors. Background colors are removed, text colors are mapped to CanvasText, and box shadows disappear. A "backplate" is drawn behind text to ensure legibility. These changes benefit users who need high contrast to read content, but they can break components that depend on color for functionality or meaning.
The forced-color-adjust property offers three distinct values, each serving a specific purpose in your accessibility toolkit.
auto (Default)
Allows elements to have their colors adjusted by the user agent when forced colors mode is active. This is the default behavior and works well for most content areas.
none (Opt Out)
Completely opt elements out of forced colors mode. Essential for color pickers, data visualizations, and branded components that need to maintain their original colors.
preserve-parent-color
Allows elements to inherit their color relationship from their parent. Useful for inline elements, badges, and tooltips that should match their surrounding context.
Basic Syntax
The forced-color-adjust property applies to all elements and text, and it is inherited by default. Here are the basic syntax patterns:
/* Default behavior - colors adjusted automatically */
.element {
forced-color-adjust: auto;
}
/* Opt out of forced colors mode entirely */
.color-picker {
forced-color-adjust: none;
}
/* Inherit parent color relationship */
.badge {
forced-color-adjust: preserve-parent-color;
}
For most use cases, you'll apply the property to specific components rather than global containers. This targeted approach ensures that the majority of your page benefits from forced colors adjustments while critical components maintain their functionality.
The property is designed to only take effect when forced colors mode is active, so you don't need to wrap it in a media query. However, you can combine it with the @media (forced-colors: active) query when you need to add additional styles specifically for forced colors users.
Common Use Cases
Color Pickers and Palettes
Color pickers represent the clearest case for forced-color-adjust: none. The entire purpose of a color picker is to let users see and select from a range of colors. If all those colors were replaced with system colors, the picker would lose its functionality entirely.
When implementing a color picker, apply the property to the entire component including swatches, previews, and custom inputs. This ensures the picker works exactly as intended regardless of accessibility settings.
Data Visualizations and Charts
Charts and data visualizations use color to encode information--different series are distinguished by different colors, and users read the legend to understand what each color represents. When forced colors mode changes those colors, the connection between chart and legend breaks.
For data visualizations, use forced-color-adjust: none to preserve your color scheme. Consider adding additional indicators beyond color--patterns, labels, or direct legend connections that work regardless of color. This multi-modal approach ensures your data visualization components remain accessible.
Branded Components and Logos
Brand recognition often depends on specific colors. A logo, branded button, or company-colored element might lose its association if the colors are changed. For these elements, forced-color-adjust: none preserves brand identity while the rest of the page remains accessible.
Form Controls and Interactive Elements
Custom checkboxes, radio buttons, or toggle switches may need additional attention to ensure they're clearly interactive in forced colors mode. Combining forced-color-adjust with explicit border styles ensures these controls remain usable. Consider how your CSS styling approach handles these interactive states.
1/* Regular mode: custom focus ring with box-shadow */2*:focus {3 outline-color: transparent;4 box-shadow: 0 0 0 3px var(--focus-color);5}6 7/* Forced colors mode: box-shadow removed, outline visible */8@media (forced-colors: active) {9 *:focus {10 box-shadow: none;11 outline: 2px solid LinkText;12 }13}Best Practices
Test in Multiple Browsers
Forced colors mode works differently across browsers in subtle ways. Firefox and Chromium-based browsers handle transparent borders differently, and newer CSS features like color-mix() may behave inconsistently. Always test your forced colors styles in Firefox, Chrome, and Edge to catch these differences.
To test without changing system settings, use browser DevTools. Press Ctrl/Cmd+Shift+P, type "forced", and select "Emulate CSS forced-colors: active".
Don't Over-Use none
While forced-color-adjust: none is powerful, it should be used sparingly. Every element you opt out of forced colors mode is an element that might not work well with the user's accessibility settings. Reserve it for components where color is fundamental to functionality.
Most content should use the default auto behavior. If you're using it for aesthetic preference, reconsider--your design should work within the constraints of forced colors mode.
Provide Alternative Visual Cues
Even when preserving colors, consider adding non-color indicators for important information. If your chart uses color to distinguish data series, also include labels or patterns. This multi-modal approach ensures your content remains accessible regardless of user settings.
Combine with Other Accessibility Features
Users who enable high contrast may also prefer reduced motion or custom font sizes. Consider how your forced colors styles interact with these other preferences for a cohesive accessible experience.
For teams looking to ensure their web properties meet the highest accessibility standards, professional web development services can help audit and improve your site's accessibility implementation.
Frequently Asked Questions
Why Forced Colors Matters
4%
of Windows users have forced colors enabled
3
values: auto, none, preserve-parent-color
2+
major browser engines supporting the feature
Sources
- MDN Web Docs - forced-color-adjust - Official documentation for CSS forced-color-adjust property
- W3C CSS Color Adjustment Module Level 1 - Official specification for forced colors mode
- Polypane - Forced Colors Explained - Practical implementation guide with examples
- CSSence - Forced Colors Mode Strategies - Developer strategies for real-world implementation
- Microsoft - Change color contrast in Windows - Windows accessibility settings documentation