← Back to release summary

Forced colors mode

Category
CSS
Type
New or changed feature
Status
Enabled by default (Chrome 89)
Intent stage
Prepare to ship

Summary

Adds the 'forced-colors' media feature, which is used to detect if the user agent has enabled a forced colors mode where it enforces a user-chosen limited color palette on the page. Adds the 'forced-color-adjust' property, which allows authors to opt particular elements out of forced colors mode, restoring full control over the colors to CSS.

Motivation

The High Contrast Windows accessibility feature[1] was first introduced to increase the readability of text through color contrast. The goal of High Contrast is to ensure a certain level of contrast between foreground and background colors. One common problem arises with background images. If text lies atop an image, altering the color of the text in High Contrast will not guarantee its readability. One option would be to override images to allow text readability. This solution, however, is not an ideal one, as it can alter the context of a webpage for users under High Contrast. The 'forced-colors' media feature and 'forced-color-adjust' property allow web developers to detect the presence of features such as High Contrast and adjust their content accordingly. For extended background on motivations, please refer to the explainer. [1] https://docs.microsoft.com/en-us/windows/desktop/w8cookbook/high-contrast-mode

Standards & signals

Explainers: https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/master/Accessibility/HighContrast/explainer.md

View on chromestatus.com