Color usage
Each Matrix color means one thing. Neutral does the work, coral warns of danger, teal confirms, gold highlights and green is the brand. Pick by meaning, with semantic tokens.
This guide decides which color a thing gets and which token carries it. It applies to every text, surface, border and status in the product. Swatches, scales and contrast ratios are on Colors.
Ask one question: what does this color have to say?
| If it says… | Use | Tokens |
|---|---|---|
| Nothing; it's structure, text or an action | Neutral | primary, foreground, muted-foreground, border, accent, card, background |
| "This will destroy something" or "this went wrong" | Coral | destructive, destructive-text, tint-destructive-* |
| "Done", "connected", "it worked" | Teal | success, success-text, tint-success-* |
| "Look here", "careful" | Gold | ring, attention, warning, tint-warning-* |
| "This is Matrix" | Green | brand, tint-brand-* (and the hover of primary and links) |
| "For your information" | Blue | info, info-text, tint-info-* |
If the answer is "nothing", it's neutral. Most of every screen should be.
Neutral does the work
Actions, text, borders, hover and selection are all neutral. Links are neutral and underlined, not blue. The main button is the dark neutral bg-primary and turns brand green on hover.
| Job | Class |
|---|---|
| Page background | bg-background |
| Card or panel | bg-card |
| Menu, popover, dialog | bg-popover |
| Hover or selected row | bg-accent (on a card it steps one shade darker automatically) |
| Inset well, disabled fill | bg-muted |
| Body text | text-foreground |
| Secondary text, help, placeholders | text-muted-foreground |
| Borders and dividers | border-border (inputs: border-input, the same color) |
| Menu and select dividers | bg-tint-neutral-border, a step softer (set in menu-styles.ts) |
Coral means danger, only
Coral is for delete, remove and errors. Nothing else: not hover, not selection, not "new", not decoration. Every extra use teaches people to ignore it, and then the one real warning gets missed.
Status text uses the darker -text step
The plain status fills are too light to read as text. For words, use text-destructive-text, text-success-text, text-warning-text or text-info-text. For a chip or banner, use a tint set (bg-tint-success-fill border-tint-success-border text-tint-success-text), or better, a Badge.
Semantic tokens, never raw steps
bg-primary, not bg-neutral-800; text-destructive-text, not text-coral-600. Raw steps are for illustrations and these docs. Tailwind's default palette (gray-*, red-*, blue-*) is not Matrix's and never appears in product code, and neither do hex or rgb values. If a shade is missing, ask for a token instead of mixing one.
Accessibility: never color alone
Every status color comes with a word or an icon, so it reads for people who can't tell the colors apart. Text pairs in the system already pass contrast (4.5:1 or better); a hand-picked color may not.
Not covered here
Which button variant to use is Actions. How an error looks in a form is Forms. Dark mode isn't designed yet: don't add dark: classes.
Checklist
- Every color is a semantic token class.
- Coral appears only on destructive actions and errors.
- Every status color has a word or an icon next to it.
- No
gray-*,red-*,blue-*, hex or rgb in the diff.