v150 · CSS · PWA
AccentColor and AccentColorText system colors
Chrome 150 ships the AccentColor and AccentColorText CSS system color keywords to stable — in installed web app contexts. A web app can now paint any element in the user's OS accent color using color: AccentColor or background: AccentColor, and pair it with the automatically-computed readable foreground using color: AccentColorText.
concepts
-
System Palette Explorer
A live grid showing AccentColor and AccentColorText applied to UI patterns — buttons, badges, borders, and focus rings. Compare each pattern against hardcoded hex colours and
accent-color: autoto understand when the system keywords add value. -
Web App Theme Preview
Simulate an installed web app whose primary brand colour is wired to
AccentColor. Pick different simulated OS accent colours and watch the entire app update — headers, buttons, focus rings — without touching any CSS variables or theme logic. -
PWA Settings Panel
A complete settings UI — header, tab strip, toggle switches, focus rings, primary and secondary buttons — all themed from
AccentColorandAccentColorText. Pick any simulated OS accent and a live contrast checker confirmsAccentColorTextalways produces a readable foreground. -
Contrast Explorer
Pick any simulated OS accent color; the demo computes
AccentColorTextusing the browser's algorithm (black or white, whichever gives higher contrast), then shows WCAG AA/AAA pass/fail for every pairing. A card grid shows filled buttons, outline borders, focus rings, and headers with measured contrast ratios. -
UI Components
A gallery of eight component types — buttons (primary, outline, ghost), badges, tab strip, toggle switches, progress bars, focus rings, header bar, and links — all themed from
AccentColor/AccentColorTextCSS variables. Change the simulated accent from a preset palette or a color picker and every component updates instantly. -
Forced Colors & AccentColor
AccentColoris a CSS Color 4 system color — it carries special authority in@media (forced-colors: active)mode. Toggle a forced-colors simulation to see how primary buttons, badges, progress bars, and focus rings adapt:AccentColormaps toHighlightandAccentColorTextmaps toHighlightTextautomatically, with no extra CSS needed. -
Titlebar Overlay & AccentColor
The complete PWA chrome story: when Window Controls Overlay is enabled, the app can paint the system titlebar area using
env(titlebar-area-*)CSS variables sized to the OS chrome. Wiring that area toAccentColor/AccentColorTextmakes the titlebar match the OS accent automatically — no JS, no hard-coded hex, WCAG-safe foreground guaranteed.
why it shipped
CSS has defined system color keywords since CSS Color 4, but browsers were slow to expose AccentColor and AccentColorText because doing so on the open web creates a fingerprinting vector — every site would receive a stable, user-specific signal. Chrome 150 resolves this tension by gating the keywords behind the installed web app context: they only resolve to the OS value when the page is running as an installed PWA. Arbitrary websites still see a fallback neutral colour. This means a task-manager app or note-taking PWA can use background: AccentColor; color: AccentColorText to produce a header that feels native on every OS without shipping OS-specific CSS.
what the keywords expose
AccentColor— the OS highlight colour (e.g. macOS Highlight Color, Windows Personalisation accent)AccentColorText— a browser-computed high-contrast foreground for text painted over AccentColor (black or white)- Both resolve in
color,background-color,border-color,outline-color, SVGfill/stroke, and anywhere else<color>is accepted - On the open web (non-installed page): both keywords resolve to a neutral fallback — no fingerprint exposed
references
implementation reference
Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗