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.
- 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
- 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
- Never color alone. Pair every status color with a word or an icon, and underline links inside text. WCAG 1.4.1
- Use roles, not raw colors. Write
--ti-color-danger, not#c5001a. Roles keep meaning consistent and make dark mode a swap, not a redesign. - 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.
- 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.
grades apart: at least 3:1. Borders, icons, focus rings, large text.
Worst pair in the palette: 3.35:1grades apart: at least 4.5:1. All body text (AA).
Worst pair in the palette: 4.54:1grades apart: at least 7:1. Enhanced contrast (AAA).
Worst pair in the palette: 8.37:1Try a pair
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 \ grade | 5 | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 95 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 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.
- ✓ Saved: success role with an icon
- ! Check the date: warning role
- ✕ Payment failed: danger role
- i 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.
- ✓ Saved: success role with an icon
- ! Check the date: warning role
- ✕ Payment failed: danger role
- i New version: info role
Accent tint background with text on it.
| Role | Use it for | Light | Dark |
|---|---|---|---|
--ti-color-canvasCanvas | The page background | #ffffffwhite-0 | #13171cgray-95 |
--ti-color-surfaceSurface | Cards, panels, table headers, code blocks | #e8eef6gray-5 | #20252agray-90 |
--ti-color-textText | Body text and headings | #20252agray-90 | #e8eef6gray-5 |
--ti-color-text-mutedMuted text | Secondary text, captions, placeholders | #5c6168gray-60 | #878c93gray-40 |
--ti-color-borderBorder | Dividers and decorative outlines | #bac0c7gray-20 | #363a40gray-80 |
--ti-color-border-strongStrong border | Input and control outlines that must be seen (3:1) | #71767dgray-50 | #71767dgray-50 |
--ti-color-accentAccent | Links and accent text | #005cc9blue-60 | #378affblue-40 |
--ti-color-accent-bgAccent fill | Primary buttons and selected items | #005cc9blue-60 | #378affblue-40 |
--ti-color-on-accentOn accent | Text and icons on the accent fill | #ffffffwhite-0 | #13171cgray-95 |
--ti-color-accent-mutedAccent tint | Highlighted rows, info banners | #e4efffblue-5 | #002253blue-90 |
--ti-color-successSuccess | Confirmation text and icons | #00712agreen-60 | #00a240green-40 |
--ti-color-warningWarning | Caution text and icons | #795d00yellow-60 | #ad8600yellow-40 |
--ti-color-dangerDanger | Errors and destructive actions | #c5001ared-60 | #fe4745red-40 |
--ti-color-infoInfo | Neutral notices | #006d6ateal-60 | #009c99teal-40 |
--ti-color-focusFocus ring | The 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.
| Pairing | Needs | Light | Dark |
|---|---|---|---|
text on canvas | 4.5:1 | 15.45:1 | 15.42:1 |
text on surface | 4.5:1 | 13.23:1 | 13.23:1 |
text-muted on canvas | 4.5:1 | 6.24:1 | 5.32:1 |
text-muted on surface | 4.5:1 | 5.35:1 | 4.56:1 |
accent on canvas | 4.5:1 | 6.22:1 | 5.35:1 |
accent on surface | 4.5:1 | 5.33:1 | 4.59:1 |
on-accent on accent-bg | 4.5:1 | 6.22:1 | 5.35:1 |
text on accent-muted | 4.5:1 | 13.31:1 | 13.29:1 |
accent on accent-muted | 4.5:1 | 5.36:1 | 4.61:1 |
success on canvas | 4.5:1 | 6.18:1 | 5.35:1 |
warning on canvas | 4.5:1 | 6.22:1 | 5.30:1 |
danger on canvas | 4.5:1 | 6.20:1 | 5.31:1 |
info on canvas | 4.5:1 | 6.18:1 | 5.33:1 |
success on surface | 4.5:1 | 5.30:1 | 4.59:1 |
warning on surface | 4.5:1 | 5.33:1 | 4.55:1 |
danger on surface | 4.5:1 | 5.31:1 | 4.56:1 |
info on surface | 4.5:1 | 5.30:1 | 4.57:1 |
border-strong on canvas | 3:1 | 4.58:1 | 3.93:1 |
border-strong on surface | 3:1 | 3.92:1 | 3.38:1 |
focus on canvas | 3:1 | 4.58:1 | 3.93:1 |
focus on surface | 3:1 | 3.92:1 | 3.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
| Role | This standard | GitHub (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:1 | No baseline role |
danger | #c5001a6.20:1 | #d1242f5.24:1 | #b3261e6.54:1 |
focus | #0070f14.58:1 | #0969da5.19:1 | #0b57d06.39:1 |
Dark
| Role | This standard | GitHub (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:1 | No baseline role |
danger | #fe47455.31:1 | #f851495.65:1 | #f2b8b59.65:1 |
focus | #0070f13.93:1 | #1f6feb4.08:1 | #a8c7fa9.59:1 |
- Borders. GitHub's default border is decorative and sits below 3:1 on purpose. This standard splits it in two:
borderfor decoration andborder-strong(shown in the table) for anything a person must see to use a control. - Warning. Chrome's baseline theme has no warning role; it uses its error and primary colors. This standard keeps one, as GitHub does.
- Accent. All three blues pass 4.5:1 on their canvas. Chrome's dark accent is a pale blue with dark text on its buttons; GitHub and this standard use a stronger blue with light text.
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
- Copy
tokens.cssinto your project and load it before your own styles. Design tools can importtokens.json, which follows the W3C design tokens format. - 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); } - Dark mode follows the visitor's system setting. To offer a switch, set
data-theme="dark"ordata-theme="light"on<html>. - To use your brand, override only the accent roles with the values from section 7.
9. Checklist before you ship
10. Sources and versions
- WCAG 2.2: contrast formula and success criteria 1.4.1, 1.4.3 and 1.4.11.
- GitHub Primer: role colors from
@primer/primitives11.10.0, functional light and dark themes. - Chromium
ui/color: Chrome's reference palette (ref_color_mixer.cc) and its role mapping (sys_color_mixer.cc), default theme. - U.S. Web Design System: the grade and “magic number” idea.
- W3C Design Tokens Community Group: the format of
tokens.json.
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.