Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

forced-color-adjust — controlling forced color adjustment

The forced-color-adjust property controls adaptation to the user's forced color palette. Disabling this protection requires care.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

forced-color-adjust: auto | none | preserve-parent-color;

forced-color-adjust controls color adjustment in forced colors mode; it does not activate that mode. It is inherited, initially auto, and not animatable.

auto lets the browser adjust colors. none disables adjustment. Apply it narrowly, only while meeting the user's color and contrast needs yourself.

preserve-parent-color behaves like none, except that inherited color takes the parent's used color in this mode. This includes currentColor and inherit; the value is intended for embedded SVG.

The example compares default adjustment with preserving a swatch's color. Labels remain outside the elements using none.

Examples

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>forced-color-adjust</title>
<style>
  .swatch {
    display: inline-block;
    width: 3rem;
    height: 3rem;
    background-color: #0066cc;
    border: 2px solid CanvasText;
  }
  .preserved { forced-color-adjust: none; }
</style>
<p>auto: <span class="swatch" role="img" aria-label="Blue sample; automatic adjustment"></span></p>
<p>none: <span class="swatch preserved" role="img" aria-label="Blue sample; original color preserved"></span></p>
</html>

Result

Two labeled squares. With forced colors inactive, both interiors are #0066cc. With forced colors active, auto permits palette adjustment; none preserves #0066cc. The adjusted color depends on the active palette.

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources