Standard · Version 1.0 · 2026-10-04

Template Interface Color Standard

One set of rules, colors and role names for interfaces that are readable in light and dark. It is built on the WCAG 2.2 contrast rules and lines up with the colors GitHub and Google Chrome ship today, so what you learn here carries over to the tools you already use.

Standards: Color · Web design

1. The rules

Six rules. A design that follows them meets WCAG 2.2 AA for color. The palette and roles below exist to make them easy to keep.

  1. Text contrast: 4.5:1. Body text needs at least 4.5:1 against its background. Large text (24px, or 18.66px bold) needs 3:1. WCAG 1.4.3
  2. Interface contrast: 3:1. Borders that show where a control is, icons that carry meaning and the focus ring need 3:1 against what is next to them. WCAG 1.4.11
  3. Never color alone. Pair every status color with a word or an icon, and underline links inside text. WCAG 1.4.1
  4. Use roles, not raw colors. Write --ti-color-danger, not #c5001a. Roles keep meaning consistent and make dark mode a swap, not a redesign.
  5. Light and dark together. Every role has a light and a dark value, and both must pass. Respect the visitor's system setting and let them override it.
  6. One accent, status colors for status. One brand accent marks actions and links. Green, yellow, red and teal mean success, warning, danger and info, and nothing else.

2. Grades: contrast you can read off the number

Every color has a grade from 0 (white) to 100 (black), set by how light it is, not by its hue. The grades are spaced so the gap between two grades tells you the contrast, whatever the hues. The idea comes from the U.S. Web Design System's “magic number”; this standard's grades are its own and checked across every pair.

40

grades apart: at least 3:1. Borders, icons, focus rings, large text.

Worst pair in the palette: 3.35:1
50

grades apart: at least 4.5:1. All body text (AA).

Worst pair in the palette: 4.54:1
70

grades apart: at least 7:1. Enhanced contrast (AAA).

Worst pair in the palette: 8.37:1

Try a pair

Text
Background
The quick brown fox reads clearly.

3. The palette

Ten hues, each at eleven grades, plus white (grade 0) and black (grade 100). Gray carries the slight cool cast of GitHub's and Chrome's grays; blue sits between GitHub's and Chrome's blues. Select a swatch to copy its token.

Hue \ grade510203040506070809095
GrayCool neutral, matching the slight blue cast of GitHub's and Chrome's grays#e8eef6#d8dee5#bac0c7#9fa5ac#878c93#71767d#5c6168#494e54#363a40#20252a#13171c
BlueLinks, primary actions and focus: the accent both GitHub and Chrome use#e4efff#c9dfff#98c1ff#68a5ff#378aff#0070f1#005cc9#0049a3#00377d#002253#001538
TealInformation and secondary accents#c6f7f4#9aece8#25d4d0#00b7b3#009c99#008380#006d6a#005755#004140#002a28#001a19
GreenSuccess and confirmation#d6f6da#b7eabd#77d386#0abd4d#00a240#008835#00712a#005a20#004416#002b0b#001c05
YellowWarnings and attention#fcedc8#f4dba0#e5ba45#cb9e00#ad8600#927100#795d00#614a00#493700#2f2200#1e1500
OrangeHighlights and severe warnings#ffeadd#ffd5bc#ffac79#ff811a#dd6c00#bb5a00#9b4a00#7d3a00#602b00#3f1a00#2a0f00
RedErrors and destructive actions#ffe9e6#ffd3ce#ffa9a0#ff7d73#fe4745#e3272d#c5001a#9f0013#7a000c#510005#370002
PinkExpressive brand and data colors#ffe8f0#ffd1e1#ffa4c8#ff75b1#e75699#cd3d82#b4226d#990059#750043#4e002b#34001b
PurpleExpressive brand and data colors#f1ebff#e4d7ff#cdb2ff#b98fff#a86bfd#9253e4#7e3bcb#6a21b4#550098#370066#240046
BrownEarthy brand and illustration colors#ffeada#ffd6b5#e3b793#c79c79#ad8361#966d4c#805838#6b4524#55310f#3b1d00#271100

4. Roles

Fifteen named jobs. Build with these, never with the palette directly, and light and dark mode follow for free. The grades are chosen so every required pairing clears its rule by the numbers.

Light

Release notes

Body text in the text role. Muted text for dates and captions. A link in the accent role.

Primary actionFocused
  • Saved: success role with an icon
  • Check the date: warning role
  • Payment failed: danger role
  • New version: info role

Accent tint background with text on it.

Dark

Release notes

Body text in the text role. Muted text for dates and captions. A link in the accent role.

Primary actionFocused
  • Saved: success role with an icon
  • Check the date: warning role
  • Payment failed: danger role
  • New version: info role

Accent tint background with text on it.

RoleUse it forLightDark
--ti-color-canvasCanvasThe page background#ffffffwhite-0#13171cgray-95
--ti-color-surfaceSurfaceCards, panels, table headers, code blocks#e8eef6gray-5#20252agray-90
--ti-color-textTextBody text and headings#20252agray-90#e8eef6gray-5
--ti-color-text-mutedMuted textSecondary text, captions, placeholders#5c6168gray-60#878c93gray-40
--ti-color-borderBorderDividers and decorative outlines#bac0c7gray-20#363a40gray-80
--ti-color-border-strongStrong borderInput and control outlines that must be seen (3:1)#71767dgray-50#71767dgray-50
--ti-color-accentAccentLinks and accent text#005cc9blue-60#378affblue-40
--ti-color-accent-bgAccent fillPrimary buttons and selected items#005cc9blue-60#378affblue-40
--ti-color-on-accentOn accentText and icons on the accent fill#ffffffwhite-0#13171cgray-95
--ti-color-accent-mutedAccent tintHighlighted rows, info banners#e4efffblue-5#002253blue-90
--ti-color-successSuccessConfirmation text and icons#00712agreen-60#00a240green-40
--ti-color-warningWarningCaution text and icons#795d00yellow-60#ad8600yellow-40
--ti-color-dangerDangerErrors and destructive actions#c5001ared-60#fe4745red-40
--ti-color-infoInfoNeutral notices#006d6ateal-60#009c99teal-40
--ti-color-focusFocus ringThe outline on the focused control (3:1 to what is next to it)#0070f1blue-50#0070f1blue-50

5. Required pairings, checked

Every pairing the roles are meant for, measured with the WCAG 2.2 formula in both modes. All 42 pass. If you add a pairing, add it here and measure it.

PairingNeedsLightDark
text on canvas4.5:115.45:115.42:1
text on surface4.5:113.23:113.23:1
text-muted on canvas4.5:16.24:15.32:1
text-muted on surface4.5:15.35:14.56:1
accent on canvas4.5:16.22:15.35:1
accent on surface4.5:15.33:14.59:1
on-accent on accent-bg4.5:16.22:15.35:1
text on accent-muted4.5:113.31:113.29:1
accent on accent-muted4.5:15.36:14.61:1
success on canvas4.5:16.18:15.35:1
warning on canvas4.5:16.22:15.30:1
danger on canvas4.5:16.20:15.31:1
info on canvas4.5:16.18:15.33:1
success on surface4.5:15.30:14.59:1
warning on surface4.5:15.33:14.55:1
danger on surface4.5:15.31:14.56:1
info on surface4.5:15.30:14.57:1
border-strong on canvas3:14.58:13.93:1
border-strong on surface3:13.92:13.38:1
focus on canvas3:14.58:13.93:1
focus on surface3:13.92:13.37:1

6. Alongside GitHub and Google Chrome

The same roles as GitHub's Primer design system (version 11.10.0) and Google Chrome's default Material 3 theme (from the Chromium source) define them, with each color's contrast against its own canvas. The three agree on the method: neutral canvas, one blue accent, red, green and yellow status colors, lighter tones for dark mode. Where they differ, this standard picks the stricter option.

Light

RoleThis standardGitHub (Primer)Google Chrome
canvas#ffffff#ffffff#ffffff
surface#e8eef6#f6f8fa#f2f2f2
text#20252a15.45:1#1f232815.80:1#1f1f1f16.48:1
text-muted#5c61686.24:1#59636e6.11:1#4747479.29:1
border#71767d4.58:1#d1d9e01.43:1 below 3:1#7477754.53:1
accent#005cc96.22:1#0969da5.19:1#0b57d06.39:1
accent-bg#005cc9#0969da#0b57d0
success#00712a6.18:1#1a7f375.08:1#146c2e6.53:1
warning#795d006.22:1#9a67004.87:1No baseline role
danger#c5001a6.20:1#d1242f5.24:1#b3261e6.54:1
focus#0070f14.58:1#0969da5.19:1#0b57d06.39:1

Dark

RoleThis standardGitHub (Primer)Google Chrome
canvas#13171c#0d1117#1f1f1f
surface#20252a#151b23#282828
text#e8eef615.42:1#f0f6fc17.39:1#e3e3e312.84:1
text-muted#878c935.32:1#9198a16.50:1#c7c7c79.75:1
border#71767d3.93:1#3d444d1.92:1 below 3:1#8e918f5.18:1
accent#378aff5.35:1#4493f86.11:1#a8c7fa9.59:1
accent-bg#378aff#1f6feb#a8c7fa
success#00a2405.35:1#3fb9507.45:1#6dd58c9.06:1
warning#ad86005.30:1#d299227.50:1No baseline role
danger#fe47455.31:1#f851495.65:1#f2b8b59.65:1
focus#0070f13.93:1#1f6feb4.08:1#a8c7fa9.59:1

7. Bring your brand color

A brand color goes in the accent roles. Enter it to see whether it passes as it is, and get the same hue at the grades the accent roles need: 60 on light, 40 on dark.


    

8. Use it

  1. Copy tokens.css into your project and load it before your own styles. Design tools can import tokens.json, which follows the W3C design tokens format.
  2. Style with roles only:
    body { background: var(--ti-color-canvas); color: var(--ti-color-text); }
    a { color: var(--ti-color-accent); }
    .card { background: var(--ti-color-surface); border: 1px solid var(--ti-color-border); }
    input { border: 1px solid var(--ti-color-border-strong); }
    :focus-visible { outline: 2px solid var(--ti-color-focus); outline-offset: 2px; }
    .error { color: var(--ti-color-danger); }
  3. Dark mode follows the visitor's system setting. To offer a switch, set data-theme="dark" or data-theme="light" on <html>.
  4. To use your brand, override only the accent roles with the values from section 7.

9. Checklist before you ship

10. Sources and versions

Version 1.0, 2026-10-04. First release. Colors are generated in OKLCH and every contrast figure on this page is computed, not estimated. Changes will be versioned here.