Frontend Recipes

Color

Paper, ink, and one accent reserved for interaction.

Pure white ground, near-black ink, and one accent: Emerald #047857.

There is no secondary brand colour, no gradient, and no tint scale. That is not a limitation of effort — it is the system. When everything is neutral except the one thing you can act on, affordances stop competing with decoration.

Ground and ink

Paper--fr-paper#FFFFFF / #0A0A0APage ground
Ink--fr-ink#262626 / #F5F5F5Text, control edges
Ink muted--fr-ink-muted#525252 / #A3A3A3Body copy, secondary text
Ink subtle--fr-ink-subtle#737373 / #7A7A7AMicro-labels, placeholders
Sunken--fr-surface-sunken#F5F5F5 / #1C1C1CInline code, recessed stages
Rule--fr-rule#E5E5E5 / #3A3A3AOutlines, section boundaries
Rule strong--fr-rule-strong#262626 / #F5F5F5Control edges, hard shadow
Rule soft--fr-rule-soft#EDEDED / #2A2A2AInternal dividers

The ground is pure #FFFFFF, and separation comes from rules rather than from tinted surfaces. A page and a card are the same colour; what distinguishes them is a 1px line, which is why the system reads as a technical drawing rather than a stack of panels.

That line is --fr-rule at #E5E5E5, a hairline neutral. Ink is reserved for what has to be found by touch and keyboard — a control's edge, an active marker — so the page reads as one surface rather than a wireframe.

Ink is #262626, not black. It measures 15.13:1 on white — comfortably AAA — and avoids the glare of a pure #000 on a pure white field while still reading as ink at every size.

The accent

Emerald--fr-accent#047857 / #34D399Focus, links, active state
Accent soft--fr-accent-soft#ECFDF5 / #052E22Selected fills, badges
Accent hover--fr-accent-hover#065F46 / #6EE7B7Hovered links and actions
Accent bright--fr-accent-bright#10B981 / #34D399Ornament only — marks, icons, arrows

#047857 is emerald-700, used as the library's only accent at 5.48:1 on white.

It has exactly four jobs, and a given view uses it for one of them:

  1. The primary button — the action the user came to do.
  2. The focus ring, on views with no primary action.
  3. The active indicator in navigation.
  4. Inline links inside prose, and selected fills via --fr-accent-soft.

The second emerald is not an accent

--fr-accent-bright is #10B981, emerald-500, and it measures 2.54:1 on white — it fails AA for text by a wide margin.

It exists because the brightest emerald is the one thing that reads as this system at a glance: the mark's right-hand bar, the arrow that trails a link, the icon in front of a row. Those are ornament. So the token is deliberately restricted:

  • Allowed: marks, icons, decorative arrows, the bar in the logo, a hover hairline.
  • Forbidden: a label, a link's text, a button fill, a focus ring, anything a reader must be able to read or target.

The split mirrors the accent's own rule. --fr-accent is the colour of doing; --fr-accent-bright is the colour of pointing. One is legible, one is loud, and the loud one never carries a word.

Status colours

Danger--fr-danger#A81F24 / #FCA5A5Destructive actions, errors
Success--fr-success#15803D / #86EFACConfirmations, positive state
Warning--fr-warning#7A5312 / #E2B262Caution, non-blocking

Each is tuned for AA on its own ground: danger 7.28:1, success 5.02:1, warning 6.83:1 on white. None of them is the accent, so a status never reads as interactivity.

success stays a true green rather than a second emerald on purpose. The badge page shows its accent and success tones side by side, and two emeralds there would be indistinguishable — which would cost the tone its whole meaning.

Contrast

Every text/background pairing in the library meets WCAG AA at minimum.

| Pairing | Ratio | Result | | --- | --- | --- | | Ink on paper | 15.13:1 | AAA | | Ink muted on paper | 7.81:1 | AAA | | Ink subtle on paper | 4.74:1 | AA | | Emerald on paper | 5.48:1 | AA | | White on Emerald | 5.48:1 | AA | | Emerald on accent-soft | 5.21:1 | AA | | Danger on paper | 7.28:1 | AA |

These are the light-theme values. The dark theme is tuned separately rather than inverted — inverting a palette is how you end up with #FFFFFF text on pure black, which smears on OLED displays and reads louder than it needs to. The dark accent lifts to #34D399, which measures 10.30:1 on the #0A0A0A ground.

Dark mode

Dark mode swaps the token set wholesale. Nothing in a component knows which theme is active; components read tokens, and the tokens change.

html
<html data-theme="dark">

See Theming for the mechanism and how to override it.

Colour is never the only signal

Every place colour conveys something, shape or text conveys it too:

  • An error field has a red rule and an error message with a square bullet.
  • A selected tab has a green indicator and different type weight.
  • A checked checkbox has a filled ink square and a drawn tick.
  • A badge has a tone colour and a bordered box with a label.

That is what makes the palette safe for the roughly one in twelve men with some form of colour vision deficiency, and it is a hard rule for any new component.