Forced-colors Mode

suggest change

The standard forced-colors media feature detects when the user agent restricts colors to a user-chosen palette:

.button {
  border: 2px solid transparent;
}

@media (forced-colors: active) {
  .button {
    border-color: ButtonText;
  }
}

Use system color keywords such as Canvas, CanvasText, ButtonFace, ButtonText, and LinkText so controls adapt to the selected palette.

Browsers may suppress shadows, background images, and authored colors in this mode. Do not rely on color or background images alone to communicate state. For example, retain a visible border or text label for selected controls.

forced-color-adjust: none opts an element out of automatic adjustment, but it can make content unreadable and should be reserved for cases where preserving the original colors is essential and has been tested.

The former -ms-high-contrast query was specific to legacy Microsoft browsers; use forced-colors for modern browser targets.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents