WarUI

Automatic theme from system preferences

GRID-A25-F04P1baselinePlanned

With theme set to 'auto', the grid follows prefers-color-scheme and prefers-contrast and updates live when the operating system setting changes. Applications get correct behavior with no JavaScript listeners of their own.

Planned. This page shows the specification from issue #205. The live example, source for every framework and the API reference replace it when the feature ships.

Live example

A grid with theme 'auto' and a label showing the resolved theme.

Expected behavior

The resolvedTheme label and the grid styling follow emulated media changes immediately. Choosing an explicit theme stops automatic following.

Planned API surface

theme option ('auto')resolvedTheme propertythemechange event

Acceptance criteria

  • theme 'auto' resolves to dark when prefers-color-scheme is dark (pending)
  • prefers-contrast: more resolves to high-contrast and takes precedence over the color scheme (pending)
  • A live media change updates the grid and fires themechange with reason 'system' (pending)
  • resolvedTheme always reports the concrete theme that is applied (pending)
  • Destroying the grid removes its media query listeners (pending)