.interface-design/system.md
Extracted from codebase. Source of truth for UI consistency.
gap-2) — used in 55% of layoutsp-2) or 16px (p-4)var(--scene-padding)| Token | Value | Usage |
|---|---|---|
--radius-sm | 4px (0.25rem) | Small elements, tags |
--radius | 6px (0.375rem) | Default — buttons, inputs, cards |
--radius-lg | 10px (0.625rem) | Popovers, menus, larger containers |
full | 9999px | Avatars, pills, circular elements |
Prefer rounded (default) for most elements. Use rounded-lg for popovers and elevated containers.
Borders-first. Shadows are rare and intentional.
var(--color-border-primary) — posthog-3000 warm grayvar(--color-border-secondary) — darker variant--color-border-info, --color-border-warning, --color-border-error, --color-border-successvar(--shadow-elevation-3000) = 0 3px 0 <border-color> — only for elevated cards and toastsvar(--modal-shadow-elevation) = 0px 16px 16px -16px rgb(0 0 0 / 35%)Do not add shadows for general UI. Reserve for modals, dropdowns, and hover-elevated cards.
| Token | Light | Dark |
|---|---|---|
--color-accent | HSL(19, 100%, 48%) orange | HSL(43, 94%, 57%) yellow |
--color-accent-hover | +10% lightness | +10% lightness |
--color-accent-active | +15% lightness | +15% lightness |
--color-accent-inverted | Yellow | Orange |
| Token | Light | Dark |
|---|---|---|
bg-primary | posthog-3000-50 | neutral-cool-950 |
bg-surface-primary | white | neutral-cool-850 |
bg-surface-secondary | posthog-3000-100 | neutral-cool-900 |
bg-surface-tertiary | posthog-3000-150 | neutral-cool-950 |
bg-fill-primary | white | neutral-cool-900 |
bg-fill-secondary | posthog-3000-25 | neutral-cool-850 |
bg-fill-tertiary | posthog-3000-50 | neutral-cool-800 |
Use bg-fill-highlight-{50,100,150,200} for subtle black overlays (light mode) or white overlays (dark mode). These use color-mix() for transparency.
| Token | Light | Dark |
|---|---|---|
text-primary | neutral-950 | neutral-100 |
text-secondary | neutral-750 | neutral-350 |
text-tertiary | neutral-600 | neutral-400 |
text-success | green-600 | green-400 |
text-warning | yellow-700 | yellow-400 |
text-error | red-600 | red-400 |
| Token | Value |
|---|---|
danger | #db3707 |
warning | #f7a501 |
success | #388600 |
15 series colors (--data-color-1 through --data-color-15) for charts. Some override in dark mode. Always use hex for Chart.js compatibility.
| Token | Value |
|---|---|
--brand-blue | #1d4aff |
--brand-red | #f54e00 |
--brand-yellow | #f9bd2b |
--brand-key | #000 (light) / #fff (dark) |
| Property | Value |
|---|---|
| Base size | 14px |
| Line height | 1.5715 |
| Font sans | -apple-system, BlinkMacSystemFont, Inter, ... |
| Font title | MatterSQ, -apple-system, Inter, ... |
| Font mono | ui-monospace, SFMono-Regular, SF Mono, Menlo, ... |
| Font medium | 500 |
| Font semibold | 600 |
| Level | Size | Weight | Font |
|---|---|---|---|
| h1 | 1.75rem | 500 | font-title |
| h2 | 1.3125rem | 500 | font-title |
| h3 | 1rem | 500 | font-title |
| h5 | 0.6875rem | 600 | font-title, uppercase, letter-spacing 0.075em |
| Size | Height | H-Padding | V-Padding | Font Size |
|---|---|---|---|---|
| xxsmall | 20px | 4px | 2px | 0.6875rem |
| xsmall | 26px | 6px | 4px | 0.75rem |
| small | 33px | 8px | 8px | inherit |
| medium | 37px | 12px | 4px | 0.875rem |
| large | 49px | 12px | 12px | 1rem |
var(--radius) (6px)| Size | Height | H-Padding | V-Padding |
|---|---|---|---|
| xsmall | 24px | 4px | 2px |
| small | 32px | 4px | 2px |
| medium | 37px | 8px | 4px |
| large | 48px | — | — |
1px solid var(--color-border-primary)var(--radius) (6px)box-shadow: 0 0 0 3px var(--color-bg-fill-highlight-75)1px solid (default border color)p-6)var(--radius) (6px)bg-surface-primarybox-shadow: var(--shadow-elevation-3000) + scale(1.01)1px solid var(--border-bold)var(--radius) (6px)var(--modal-shadow-elevation)1rem)rgb(0 0 0 / 20%), blur 5pxbg-surface-primary1px solid var(--color-border-primary)var(--radius-lg) (10px)var(--shadow-elevation-3000)0.75rem)1px solid var(--secondary-3000-button-border)var(--radius) (6px)var(--shadow-elevation-3000)| Token | Value |
|---|---|
--project-navbar-width | 215px |
--project-navbar-width-collapsed | 45px |
--project-panel-width | 245px |
--side-panel-bar-width | 40px |
| Token | Value |
|---|---|
| sm | 576px |
| md | 768px |
| lg | 992px |
| xl | 1200px |
| 2xl | 1600px |
[theme="dark"] on bodydarkMode: ['selector', '[theme="dark"]']| Token | Value |
|---|---|
--z-top | 9999 |
--z-bottom-notice | 1450 |
--z-tooltip | 1300 |
--z-popover | 1200 |
--z-modal | 1100 |
--z-hedgehog-buddy | 1050 |
--z-drawer | 900 |
--z-main-nav | 750 |
--z-lemon-sidebar | 700 |
--z-top-navigation | 550 |
--z-content-overlay | 500 |
--z-raised | 5 |
box-shadow 0.1s ease-in-out--opacity-disabled)Three-tier architecture:
frontend/src/lib/ui/) — Low-level React primitives (Button, Combobox, DropdownMenu, etc.)frontend/src/lib/lemon-ui/) — 50+ published components (LemonButton, LemonInput, LemonModal, LemonTable, etc.)frontend/src/lib/components/) — Feature-specific composed components built on Lemon UIAlways prefer Lemon UI components over custom implementations.