|
| 1 | +--- |
| 2 | +title: Colors |
| 3 | +order: 1 |
| 4 | +--- |
| 5 | + |
| 6 | +# Colors |
| 7 | + |
| 8 | +Use semantic color tokens instead of hardcoded values. Semantic tokens automatically adapt to light and dark modes. |
| 9 | + |
| 10 | +## Text Colors |
| 11 | + |
| 12 | +| Token | CSS Variable | Tailwind Class | |
| 13 | +|-------|--------------|----------------| |
| 14 | +| Default | `--color-text-default` | `text-default` | |
| 15 | +| Subtle | `--color-text-subtle` | `text-subtle` | |
| 16 | +| Subtlest | `--color-text-subtlest` | `text-subtlest` | |
| 17 | +| Disabled | `--color-text-disabled` | `text-disabled` | |
| 18 | +| Inverse | `--color-text-inverse` | `text-inverse` | |
| 19 | +| Brand | `--color-text-brand-default` | `text-brand-default` | |
| 20 | +| Success | `--color-text-success` | `text-success` | |
| 21 | +| Danger | `--color-text-danger` | `text-danger` | |
| 22 | +| Warning | `--color-text-warning-default` | `text-warning-default` | |
| 23 | +| Information | `--color-text-information` | `text-information` | |
| 24 | + |
| 25 | +## Background Colors |
| 26 | + |
| 27 | +| Token | CSS Variable | Tailwind Class | |
| 28 | +|-------|--------------|----------------| |
| 29 | +| Surface Default | `--color-elevation-surface-default` | `bg-elevation-surface-default` | |
| 30 | +| Surface Raised | `--color-elevation-surface-raised` | `bg-elevation-surface-raised` | |
| 31 | +| Surface Overlay | `--color-elevation-surface-overlay` | `bg-elevation-surface-overlay` | |
| 32 | +| Surface Sunken | `--color-elevation-surface-sunken` | `bg-elevation-surface-sunken` | |
| 33 | + |
| 34 | +## Border Colors |
| 35 | + |
| 36 | +| Token | CSS Variable | Tailwind Class | |
| 37 | +|-------|--------------|----------------| |
| 38 | +| Default | `--color-border-default` | `border-default` | |
| 39 | +| Subtle | `--color-border-subtle` | `border-subtle` | |
| 40 | +| Bold | `--color-border-bold` | `border-bold` | |
| 41 | + |
| 42 | +## Interactive Colors |
| 43 | + |
| 44 | +| Token | CSS Variable | Tailwind Class | |
| 45 | +|-------|--------------|----------------| |
| 46 | +| Primary | `--color-interactive-primary` | `bg-interactive-primary` | |
| 47 | +| Primary Hover | `--color-interactive-primary-hover` | `bg-interactive-primary-hover` | |
| 48 | +| On Interactive | `--color-text-on-interactive` | `text-on-interactive` | |
| 49 | + |
| 50 | +## Example |
| 51 | + |
| 52 | +```html |
| 53 | +<div class="bg-elevation-surface-default border border-default text-default p-200"> |
| 54 | + <p class="text-subtle">Secondary text</p> |
| 55 | + <button class="bg-interactive-primary text-on-interactive px-200 py-100 rounded-md"> |
| 56 | + Action |
| 57 | + </button> |
| 58 | +</div> |
| 59 | +``` |
| 60 | + |
| 61 | +## Do's and Don'ts |
| 62 | + |
| 63 | +| Do | Don't | Why | |
| 64 | +|----|-------|-----| |
| 65 | +| `text-default` | `text-gray-900` | Adapts to dark mode | |
| 66 | +| `text-subtle` | `text-gray-600` | Maintains contrast | |
| 67 | +| `bg-elevation-surface-default` | `bg-white` | Theme-aware | |
| 68 | +| `border-default` | `border-gray-200` | Consistent | |
| 69 | + |
| 70 | +## Accent Colors |
| 71 | + |
| 72 | +For specific accent needs, semantic accent tokens are available: |
| 73 | + |
| 74 | +- `text-accent-gray-default`, `text-accent-gray-bold` |
| 75 | +- `text-accent-blue-default`, `text-accent-blue-bold` |
| 76 | +- `text-accent-teal-default`, `text-accent-teal-bold` |
| 77 | +- `text-accent-green-default`, `text-accent-green-bold` |
| 78 | +- `text-accent-yellow-default`, `text-accent-yellow-bold` |
| 79 | +- `text-accent-orange-default`, `text-accent-orange-bold` |
| 80 | +- `text-accent-red-default`, `text-accent-red-bold` |
| 81 | +- `text-accent-magenta-default`, `text-accent-magenta-bold` |
| 82 | +- `text-accent-purple-default`, `text-accent-purple-bold` |
0 commit comments