Skip to content

Status pairs and contrast

Aurora has eight status hues: ice, teal, violet, gold, ok, bad, skip and muted. Each hue has three tokens.

Token Use Here
--x The hue. Dots, meters, count badges, borders, and text on a page or a panel. --ok
--x-fg Text on the --x-bg fill: pills and badges. --ok-fg text
--x-bg The tinted fill behind --x-fg. fill

Text on a solid hue fill uses --on-status.

A pill is text in a hue on a tint of the same hue. Before 0.4, Aurora had a dark theme only, and drew a pill with one colour: the hue for the text, and the hue with hex alpha 1c (11%) for the fill. In the dark theme that works. In the light theme it does not: a hue that is clear as a dot is too light as text on its own tint.

So the text of a pill is its own token, --x-fg. In the light theme it is a darker step of the hue. In the dark theme it is the same as the hue.

Hue Light: --x Light: --x-fg Dark: --x Dark: --x-fg
ice #1f60cc #174ca6 #7fb2ff #7fb2ff
ok #15793b #126a33 #4bd07f #4bd07f
bad #c22a2a #a51f1f #f06464 #f06464

The token reference has each value.

--x-bg is not a value of its own. It is the hue at 11%:

--ok-bg: color-mix(in srgb, var(--ok) 11%, transparent);

So the fill changes with the hue in each theme, hyper too, and a product that changes a hue does not have to change the fill.

tests/contrast.rs puts each fill over each surface that a pill sits on (the page and the panels), and checks the -fg text on the result. Each pair must meet 4.5:1, in the light, the dark and the hyper theme. The same test checks each text token on each surface, and the hues as graphics at 3:1. See Rules and checks.

You give a component the hue, and it takes the pair:

  • Pill color=token::OK uses --ok-fg on --ok-bg.
  • StatusBadge status="failed" picks bad, and uses --bad-fg on --bad-bg.
  • fg_for(token::OK) and fill_for(token::OK) give the pair for your own markup.
completed failed running cancelled skipped pending