WarUI

High-contrast theme and forced-colors support

GRID-A25-F03P0beyond-baselinePlanned

A dedicated high-contrast theme provides 7:1 text contrast, thicker borders and non-color selection cues. When the operating system enables forced colors, the grid maps its states to system colors instead of breaking.

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 sorting, row selection, a cell in an error state and a focused cell, in the high-contrast theme.

Expected behavior

In high-contrast mode, every state (selected, focused, error, sorted) is distinguishable without color. Under forced colors, borders and focus use system colors such as Highlight and CanvasText, and remain visible.

Planned API surface

theme option ('high-contrast')forced-colors media handling--war-grid-selection-outline-width token--war-border-width-strong token

Acceptance criteria

  • Text contrast is at least 7:1 and non-text UI contrast is at least 4.5:1 in the high-contrast theme (pending)
  • Selection, error and sort states each have a non-color indicator (outline, icon or pattern) (pending)
  • Under @media (forced-colors: active), focus and selection indicators remain visible (pending)
  • Icons remain visible under forced colors by rendering in currentColor (pending)
  • No information is conveyed solely by background color (pending)