← Chrome 159 reference · All APIs
v159 · css · enabled by default
AccentColor & AccentColorText follows accent-color value
AccentColor and AccentColorText resolve at computed-value time to the element’s effective accent-color property and a contrasting foreground color for it, instead of only reflecting the OS-level platform accent color. When accent-color is auto (or when Forced Colors Mode is active and not opted out), both keywords fall back to the browser/OS system accent colors.
at a glance
| Shipped in | Chrome 159 (desktop, Android), enabled by default — filed under “Enabled by default” in the milestone=159 listing; Android WebView listed as unconfirmed (null) in the ChromeStatus API record |
|---|---|
| Origin trial / flag | No origin trial, no user-facing chrome://flags toggle. ChromeStatus records Finch flag name CSSSystemAccentColorKeyword (not present as a standalone entry in runtime_enabled_features.json5 on main as of 2026-11-24) |
| Specification | CSS Color Module Level 4 §6.2 System Colors (AccentColor, AccentColorText); CSS Basic User Interface Module Level 4 §7.1 accent-color |
| CSSWG issue | w3c/csswg-drafts#5900 — resolution that AccentColor takes its value from accent-color unless Forced Colors Mode is active |
| Intent | blink-dev Intent to Ship |
| Tracking bug | issues.chromium.org/536420071 |
| Web platform tests | css/css-ui/accent-color-keyword-* and forced-colors-mode/accent-color-keyword-forced-colors.html |
| ChromeStatus | 6207138742534144 — AccentColor & AccentColorText follows accent-color value |
why it exists
Chromium previously exposed AccentColor and AccentColorText only as platform system colors (returning the OS accent color when accent-color was auto, or a fixed default otherwise — see the Chrome 150 system-colors page). That left custom controls and accented surfaces unable to stay in sync with an author-specified accent-color value without duplicating custom properties alongside accent-color. By making AccentColor and AccentColorText follow the element’s computed accent-color, a single inherited accent-color declaration themes both native form controls (<input type="checkbox">, <input type="range">, <progress>) and custom UI components, while preserving an accessible contrasting foreground color automatically.
Syntax
No new CSS property or keyword syntax is introduced; the existing CSS Color 4 <system-color> keywords change how they resolve against the CSS UI 4 accent-color property:
/* CSS Color 4 — existing <system-color> keywords (case-insensitive) */
<system-color> = AccentColor | AccentColorText | ...
/* CSS UI 4 — accent-color property (inherited, initial: auto) */
accent-color: auto | <color>;
/* Usage anywhere a <color> is accepted */
background-color: AccentColor;
color: AccentColorText;
border-color: color-mix(in srgb, AccentColor 60%, Canvas);
“To maintain consistency with widget accent color styling,
AccentColortakes its value fromaccent-color, unless Forced Colors Mode is enabled.AccentColorTexttakes its value from the contrasting foreground color toAccentColoras is described for widget accent color styling.”
This reference covers four parts of the Chrome 159 contract: AccentColor resolution (inherited, own, registered properties, color functions, and 2D canvas), AccentColorText contrast resolution, cyclic and currentcolor resolution, and Forced Colors Mode and animation updates.
accent-color.
AccentColor resolution — inputs and outputs
Inputs. The keyword AccentColor (case-insensitive) is accepted in any CSS property or function taking a <color> value, in registered custom properties declared with syntax: "<color>" (via @property or CSS.registerProperty()), inside CSS color functions (color-mix(), light-dark(), relative color syntax such as rgb(from AccentColor r g b), contrast-color(AccentColor), alpha(from AccentColor / 0.5)), in box-shadow and filter: drop-shadow(), and in HTML <canvas> 2D context color strings (ctx.fillStyle = "AccentColor").
Outputs. Resolution evaluates at computed-value time against the element’s effective accent-color property:
Element’s effective accent-color | Resolved AccentColor | Notes |
|---|---|---|
Explicit <color> on the element | That computed <color> | Overrides any ancestor accent-color |
Inherited <color> from an ancestor | The inherited computed <color> | Updates immediately when ancestor accent-color mutates |
auto (or initial) | Browser/OS default system accent color | Matches the pre-159 system accent behavior |
currentcolor | Used value of the element’s own color | See cyclic resolution if color also references AccentColor |
Active Forced Colors Mode (forced-color-adjust: auto) | User’s forced system accent color | Author accent-color is ignored; see Forced Colors Mode |
On a 2D <canvas> element, setting ctx.fillStyle = "AccentColor" or a color function referencing AccentColor resolves against the <canvas> element’s own or inherited accent-color at the time the style is assigned; resetting canvas.style.accentColor = "initial" returns the default system accent color.
AccentColor.
AccentColorText resolution — contrasting foreground
Inputs. AccentColorText is accepted anywhere a <color> value is valid, and pairs with an AccentColor background so text or iconography placed on top of an accented surface remains legible.
Outputs. When the element’s effective accent-color is a non-auto color (inherited or set on the element itself), AccentColorText resolves to a browser-chosen contrasting foreground color for that accent-color — matching the contrast pairing specified for widget accent colors in CSS UI 4. In Chromium’s WPT suite, light accent colors (such as rgb(255, 165, 0) or rgb(245, 245, 245)) produce rgb(0, 0, 0) and dark accent colors (such as rgb(10, 10, 10)) produce rgb(255, 255, 255). When accent-color is auto (or Forced Colors Mode is active without opt-out), AccentColorText resolves to the browser/OS system accent text color.
AccentColorText; CSS UI 4 §7.1.
Cyclic and currentcolor resolution
Because accent-color is itself a color property and accepts currentcolor or <system-color>, self-referential combinations require deterministic cycle breaking:
| Declaration on child element | Cycle? | Resolved result |
|---|---|---|
accent-color: currentcolor (with own color: C) | No | accent-color resolves against this element’s own used color (C), not the parent’s; AccentColor on this element mirrors C |
accent-color: AccentColor (or AccentColorText) | Yes (self-reference) | Resolves against the parent element’s computed accent-color instead of forming a loop |
color: AccentColor; accent-color: currentcolor | Yes (two-property cycle) | Breaks the cycle on color by falling back to the parent element’s computed color |
Using AccentColor or AccentColorText in any other property (including color when accent-color is not currentcolor) resolves normally against the element’s own computed accent-color.
Forced Colors Mode, animations, and lifecycle
Forced Colors Mode. Under active Forced Colors Mode (@media (forced-colors: active)) with the default forced-color-adjust: auto, AccentColor and AccentColorText do not mirror an author-specified accent-color: both keep the user’s forced system accent palette so author colors cannot override high-contrast accessibility preferences. Setting forced-color-adjust: none opts the element out of forced colors and restores mirroring of the element’s accent-color.
Dynamic updates & animations. Both AccentColor and AccentColorText remain live across style mutations and Web Animations / CSS transitions. When an element animates to or from AccentColor, AccentColorText, or a color expression containing them (light-dark(), color-mix(), rgb(from AccentColor ...), contrast-color(), alpha(from AccentColor ...), box-shadow, filter: drop-shadow()), mutating an ancestor’s or the element’s accent-color mid-animation immediately updates the interpolated computed color.
Lifecycle. accent-color is an inherited CSS property; changing it triggers normal style recalculation and repaint on descendants referencing AccentColor or AccentColorText. On <canvas>, ctx.fillStyle snapshots the resolved color when assigned, so script must reassign ctx.fillStyle and redraw after changing accent-color.
Errors, unsupported browsers, and feature detection
CSS color values do not throw exceptions on unsupported resolution behavior. Crucially, CSS.supports("color", "AccentColor") and CSS.supports("color", "AccentColorText") return true even in browsers where AccentColor and AccentColorText ignore accent-color (such as Chrome 149–158, Firefox 103+, and Safari 16.5+), because both keywords parse as valid <system-color> values in all of them. An author who relies solely on @supports (color: AccentColor) will still see the OS or fixed blue/white/black accent colors in engines that have not shipped this change.
- Runtime detection: create a detached or hidden probe element with an explicit
accent-color(for examplergb(1, 2, 3)) andbackground-color: AccentColor, append it to the document, and comparegetComputedStyle(el).backgroundColor === "rgb(1, 2, 3)". - Progressive CSS fallback: set a custom property alongside
accent-color(e.g.--brand-accent) when identical colors across Chrome < 159, Firefox, and Safari are required, or accept graceful fallback to the browser’s system accent color where brand-exact matching is optional. - Invalid
accent-colorvalues: malformed declarations are dropped at parse time per standard CSS error handling, leaving the inherited value orauto.
Context and exposure
AccentColor and AccentColorText are CSS <system-color> values usable in any document stylesheet, shadow DOM stylesheet, inline style attribute, registered custom property, or HTML <canvas> 2D context. They require no secure context, no permission, no user activation, and no JavaScript. They are not available in Web Workers except where an offscreen canvas does not have a DOM element’s computed style (OffscreenCanvas has no element accent-color).
Examples
No interactive demo exists yet on the Chrome Platform Showcase for Chrome 159. The feature owner’s standalone sample is live at kyerebo.github.io/demos/system-accent-color/.
Syncing custom buttons and native controls with one accent-color
<section class="theme-card">
<label><input type="checkbox" checked> Enable alerts</label>
<button class="accent-cta" type="button">Save preferences</button>
</section>
<style>
.theme-card {
/* Single source of truth for both native inputs and custom UI */
accent-color: #0b57d0;
}
.theme-card[data-tone="amber"] {
/* Light accent: AccentColorText flips automatically to dark text */
accent-color: rgb(255, 165, 0);
}
.accent-cta {
background-color: AccentColor;
color: AccentColorText;
border: 2px solid color-mix(in srgb, AccentColor 70%, black);
padding: 0.5rem 1rem;
}
</style>
Source: CSS Color 4 §6.2; WPT accent-color-text-keyword-resolution.html.
Detecting accent-color following vs fixed system keywords
function accentColorKeywordFollowsProperty() {
const probe = document.createElement("div");
probe.style.position = "absolute";
probe.style.visibility = "hidden";
probe.style.accentColor = "rgb(1, 2, 3)";
probe.style.backgroundColor = "AccentColor";
document.body.append(probe);
const follows = getComputedStyle(probe).backgroundColor === "rgb(1, 2, 3)";
probe.remove();
return follows;
}
if (!accentColorKeywordFollowsProperty()) {
document.documentElement.classList.add("fallback-accent-vars");
}
Source: WPT accent-color-keyword-resolution.html (probe pattern derived from the test assertion).
Avoiding self-referential cycles and handling Forced Colors Mode
/* Parent defines an accent-color */
.panel {
accent-color: rgb(20, 40, 60);
}
/* Child copies parent's accent-color without creating a cycle */
.panel > .child {
accent-color: AccentColor; /* resolves to rgb(20, 40, 60) */
background-color: AccentColor; /* rgb(20, 40, 60) */
color: AccentColorText; /* contrasting white */
}
/* In Forced Colors Mode, leave forced-color-adjust at its default (auto)
so AccentColor / AccentColorText respect the user's high-contrast palette. */
@media (forced-colors: active) {
.accent-cta {
outline: 2px solid AccentColor;
}
}
Source: WPT accent-color-keyword-cyclic.html; WPT accent-color-keyword-forced-colors.html.
Browser compatibility
| Browser | Follows accent-color | Evidence / notes | Base AccentColor / AccentColorText (BCD) |
|---|---|---|---|
| Chrome (desktop, Android) | 159 | Enabled by default on desktop and Android per ChromeStatus (Android WebView status is null / unconfirmed in the API record) | 149 desktop (fixed blue/white outside installed web apps); Chrome Android false in BCD |
| Edge | Unknown (in dev) | Chromium-based; wpt.fyi Edge 160.0.4408.0 passes 4/4 cyclic, 4/7 resolution, 2/2 computed-time, 1/12 animation, and 2/3 forced-colors subtests (2026-11-24) | 149 (mirror) |
| Firefox | No release | Mozilla standards position: Positive; no shipped release yet | 103 (fixed blue / white) |
| Safari | In development | WebKit PR #74949 in progress; ChromeStatus lists Safari view as Shipped/Shipping citing that PR, but no stable Safari version is confirmed | 16.5 (fixed blue / black) |
Security and privacy
Resolving AccentColor and AccentColorText from the element’s own CSS accent-color value introduces no new storage, network capability, permission, or cross-origin data channel: when accent-color is author-specified, the resolved color comes solely from the page’s own stylesheet. When accent-color is auto (or in Forced Colors Mode), the behavior matches existing system-color resolution; CSS Color 4 notes that system colors can expose OS theme preferences (such as dark mode or user accent color) and allows user agents to return fixed fallback colors (as Firefox, Safari, and non-installed Chrome contexts do) to limit fingerprinting. Chromium’s ChromeStatus record notes no new security risks and lists security/privacy reviews as Pending (checked 2026-11-24).
Specifications
see also
- gendn Chrome 150 — AccentColor and AccentColorText system colors (earlier OS-accent-only rollout)
- MDN —
<system-color> - MDN —
accent-color - Author demo — system-accent-color
- w3c/csswg-drafts#5900 — CSSWG discussion & resolution
- ChromeStatus — AccentColor & AccentColorText follows accent-color value (6207138742534144)