# DESIGN.md — typst-leaf UI Rehaul This document is the aesthetic reference for the next chunk in `PLAN.md`. Every UI decision in `PLAN.md` should match this guide. Direction is "document editor" — warmth, restraint, a thin layer of leaf. ## Brand - Name: **typst-leaf** — warm, organic, paper-and-ink. - Personality: quiet, considered, a serious editor for prose, papers, and beautiful documents. - Not "developer marketing." Not "dashboard SaaS." Closer to a focused notebook. ## Aesthetic Pillars 1. **Paper, not glass.** Surfaces are warm off-white, not slate. Borders separate panels; we don't blur or float. 2. **Functional color, decorative restraint.** Greens only when communicating success/active/leaf. Use amber for warnings, slate for muted text, rose for errors. No gradients on chrome. 3. **Typography is the interface.** System sans for chrome, monospace for paths/git/lsp status. We say things in words, not icons. 4. **A whisper, not a shout.** Rounded corners are subtle (`rounded-md`). Focus rings are visible but quiet. ## Palette (Tailwind v4 via CSS-first) | Token | Use | Tailwind class | |---|---|---| | Page background | Shell chrome | `bg-stone-50` | | Panel surface | Cards, panels | `bg-white` | | Sidebar | Activity + sections | `bg-stone-50` with inner panels `bg-white` | | Text primary | Body | `text-zinc-800` | | Text muted | Meta | `text-zinc-500` | | Text subtle | File paths | `text-zinc-400` | | Divider | 1px borders | `border-zinc-200` | | Hover surface | Buttons/list rows | `hover:bg-stone-100` | | Accent (primary) | Save, commit | `bg-emerald-600 hover:bg-emerald-700 text-white` | | Accent (soft) | Active file, focus | `bg-emerald-50 text-emerald-800 ring-emerald-200` | | Warning | Behind | `text-amber-600` | | Error | Dirty error | `text-rose-600` | | Pill bg (status) | Status chips | `bg-white border-zinc-200` | We do not introduce dark classes. Tailwind v4 is in CSS-first mode (`@import "tailwindcss"`); tokens live in plain CSS, not `tailwind.config.js`. ## Typography - UI: `font-sans` (system stack already from Tailwind). - Monospace: `font-mono` for paths, git refs, LSP logs, status messages. - Toolbar/header: `text-sm font-medium tracking-tight`. - Meta and toasts: `text-xs text-zinc-500`. - File names: `text-sm font-mono`. ## Layout Skeleton ``` ┌──────────────────────────────────────────────────────────────────────┐ │ TopBar: leaf · [project ▾] · main.typ · Save · ●LSP ◌PRV │ ├──────────┬───────────────────────────────────────────────────────────┤ │ Sidebar │ │ │ Files │ │ │ ▣ main │ Monaco Editor │ │ ▣ lib/ │ │ │ Git │ │ │ ⚙ set │ │ │ ├─────────────────────────────────────┬─────────────────────┤ │ │ Editor (resizable) │ Preview │ │ │ │ (iframe) │ │ │ │ │ └──────────┴─────────────────────────────────────┴─────────────────────┘ │ StatusBar: main · clean · ready · vim:n · 1:23 │ └──────────────────────────────────────────────────────────────────────┘ ``` ## Component Specs (Tailwind) ### TopBar ```tsx
typst-leaf · main.typ LSP · ready PRV · starting
``` ### Sidebar (`PanelSection` + tabs) ```tsx ``` ### ResizableSplit ```tsx
/* editor */
``` ### EmptyState ```tsx
Open a file from the sidebar.
Tip: ⌘P to jump, ⌘S to save.
``` ### Toast ```tsx
Committed a1b2c3d
``` ### Status chips ```tsx LSP · ready ``` ## States - **No project:** large empty state in main area; sidebar shows "No project yet." - **Connecting:** preview shows "starting…" with a quiet spinner (CSS, not library). - **External preview source:** toast "Source outside project — ignored." - **Save error:** rose-600 message in toast + small dot in TopBar file path. - **Git dirty:** emerald-50 row tint + small dot next to filename in tree. ## Motion - Hover: `transition-colors duration-100`. - Splitter drag: no transition. - Toast in/out: 150ms opacity, no spring. ## Accessibility - Visible focus rings: `focus-visible:ring-2 focus-visible:ring-emerald-300 focus-visible:ring-offset-1`. - All interactive controls reachable by keyboard. - Status communicated by text + color, never color alone. ## Don'ts - No gradients on chrome. - No shadows on whitespace panels. - No animated chrome unless it's a real state change. - No emoji decorations in product UI (only as icons in narrow toolbars). ## Thumbnail: vibe check > Imagine a warm, slightly off-white IDE with a single green accent for "commit ready" and a quiet three-dot status footer. It's the IDE equivalent of a blank page of cream paper, not a glass dashboard.