Brand
Design Tokens

Design Tokens

All visual values are defined in src/brand/tokens.ts. This is the single source of truth. Never hardcode brand values in components — import them from tokens.

import { colors, typography } from '@/brand/tokens'

Colours

Core Palette

midnight
#0f172a
slate
#334155
teal
#0d9488
tealLight
#ccfbf1
amber
#d97706
amberLight
#fef3c7
canvas
#fafaf9
white
#ffffff
stone
#e7e5e4
stoneDark
#78716c

Usage Rules

  • Midnight is the dominant colour. It's used for all primary text and headers.
  • Teal is the action colour. Every clickable element that invites action should be teal.
  • Amber is used sparingly — for warnings, alerts, or a single warm accent. Never for CTAs.
  • Canvas (#fafaf9) is the default page background. Not pure white — warm white.
  • White (#ffffff) is for cards and containers that sit on the canvas.
  • Aim for a ratio of roughly 70% midnight/slate, 20% teal, 10% everything else.

Semantic Mappings

For common UI patterns, use the semantic layer rather than raw colours:

import { semantic } from '@/brand/tokens'
 
// In components:
// color: semantic.text.primary        → midnight
// background: semantic.bg.page        → canvas
// borderColor: semantic.border.default → stone
// background: semantic.button.primary.bg → teal

This makes future palette changes a one-line edit in tokens.ts.


Typography

Typeface

Inter for everything. One family, multiple weights. Consistency over variety.

JetBrains Mono for data: response counts, statistics, code snippets, metadata.

Scale

VariantSizeWeightTrackingLine HeightUse For
display48pxLight (300)-0.02em1.1Hero headlines
h136pxSemibold (600)-0.02em1.2Page titles
h224pxSemibold (600)-0.01em1.3Section headings
h318pxMedium (500)01.4Subsections, card titles
body16pxRegular (400)01.6Prose, descriptions
small14pxRegular (400)01.5Captions, metadata
label12pxMedium (500)0.05em1.0Labels, tags (uppercase)

Rules

  1. Weight does the work — Light for display, Semibold for headings, Regular for body.
  2. Never use Bold (700) in body text. Reserve for UI labels only.
  3. Tight tracking on headings, relaxed line height on body copy.
  4. Monospace for data. If it's a number the user is measuring, it's mono.

Spacing

All spacing follows a 4px base grid. Use Tailwind's spacing utilities where possible (p-4, gap-6, mt-8).

TokenValuePixelsCommon Use
10.25rem4pxTight gaps between related elements
20.5rem8pxInner padding on compact elements
30.75rem12pxBetween label and input
41rem16pxStandard inner padding, mobile page padding
61.5rem24pxCard padding, section gaps
82rem32pxDesktop page padding, between cards
123rem48pxBetween major sections
164rem64pxPage-level vertical rhythm

Border Radius

TokenValueUse For
sm6pxTags, badges, small buttons
md8pxInputs, standard buttons
lg12pxCards, containers
xl16pxLarge cards, sections
full9999pxAvatars, status dots, pills

The general rule: the larger the surface, the larger the radius. But never exceed xl on rectangular elements — it starts looking playful rather than premium.