|
| 1 | +# Design System — idstack |
| 2 | + |
| 3 | +This file is the source of truth for idstack's visual system. Any visual or UI decision (font, color, spacing, radius, motion) must be grounded here. The canonical implementations are `templates/assets/idstack.css` (per-skill HTML reports + course dashboard) and the inline `<style>` block in `docs/index.html` (idstack.org landing page); when this file changes, both implementations update in the same PR. |
| 4 | + |
| 5 | +## Product context |
| 6 | + |
| 7 | +- **What this is:** Open-source set of skills for evidence-based instructional design. Runs in Claude Code and OpenAI Codex CLI. 11 skills, 108 peer-reviewed studies across 11 research domains, every recommendation tagged with its evidence tier T1–T5. |
| 8 | +- **Who it's for:** Instructional designers (university, K-12, corporate L&D), faculty doing their own course design, course-design teams. **Downstream stakeholders:** deans, faculty senates, accreditation reviewers — they read the HTML reports the designer hands them. |
| 9 | +- **Space:** Edtech / instructional design. Adjacent inspiration: open-access academic publishing (eLife), evidence-based-medicine reference (UpToDate, Cochrane), modern dev tools (Linear, Cursor). |
| 10 | +- **Project type:** Hybrid — three surfaces share one system: |
| 11 | + 1. Marketing landing (`idstack.org`) — drives discovery + install. |
| 12 | + 2. CLI tool — terminal interaction, text-only, design-irrelevant. |
| 13 | + 3. Stakeholder deliverables — branded HTML reports + `index.html` course dashboard under `.idstack/exports/<course-slug>/`. Audience: designer + their stakeholders. |
| 14 | + |
| 15 | +## Memorable thing |
| 16 | + |
| 17 | +**Proof.** This is evidence applied to course design — every claim is cited and tier-rated, like a clinical reference. Every design decision serves this. The visual hierarchy is built around tier badges and citations; the artifact survives a dean's skepticism on first read. |
| 18 | + |
| 19 | +## Aesthetic direction |
| 20 | + |
| 21 | +- **Direction:** Academic publication × clinical reference. eLife meets UpToDate. The product feels like a peer-reviewed deliverable, not a SaaS dashboard. |
| 22 | +- **Decoration level:** Minimal-with-purpose. The only decoration is functional — tier-color borders on findings, severity-coded chips, mono citation marks. No gradients, no illustrations, no stock photos, no decorative blobs anywhere. |
| 23 | +- **Mood:** Quiet authority. The page rhythm is set by typography and tier markers. Reads as defensible without needing to be told it's defensible. |
| 24 | +- **Reference sites consulted:** elifesciences.org (energy + restraint), uptodate.com (evidence-tier convention), linear.app (modern restraint). Anti-references (what NOT to do): qualitymatters.org (association look), stripe.com gradient hero (overused signature pattern). |
| 25 | + |
| 26 | +## Typography |
| 27 | + |
| 28 | +- **Display + body:** **Source Serif 4** (Adobe / open source). Body-serif is the deliberate commitment — every paragraph reinforces the publication mood. Source Serif 4 has multiple optical sizes (`opsz` axis) so the same family handles 13px captions through 65px hero headlines without going off-design. |
| 29 | +- **UI / labels / badges / table cells:** **Public Sans** (USWDS / open source). Designed for US-government documents; reads as "official record" rather than "SaaS chrome." Anti-Inter. |
| 30 | +- **Citations / IDs / code / file paths:** **JetBrains Mono** (open source). Citations like `[Alignment-14] [T1]` are the academic-paper convention rendered in mono — load-bearing, not decorative. |
| 31 | +- **Loading:** Google Fonts via one `<link>` in each HTML surface (`docs/index.html`, `templates/report.html.tmpl`, `templates/index.html.tmpl`). System-font fallbacks are preserved in `--font-*` tokens so the page is legible even when the network is unavailable. Total weight ~120kb woff2 for the variable axes used. |
| 32 | +- **Scale (modular, ratio 1.250 — major third), base 1rem = 17px:** |
| 33 | + |
| 34 | + | Token | rem | px | Role | |
| 35 | + |---|---|---|---| |
| 36 | + | `h1` | 3.82 | 65 | Page title (report header, landing hero) | |
| 37 | + | `h2` | 2.44 | 41 | Section heading | |
| 38 | + | `h3` | 1.95 | 33 | Subsection heading | |
| 39 | + | `h4` | 1.56 | 27 | Finding card title | |
| 40 | + | `h5` | 1.25 | 21 | Inline emphasis heading | |
| 41 | + | `body` | 1.00 | 17 | Default paragraph | |
| 42 | + | `small` | 0.80 | 14 | Captions, mono citations, badges | |
| 43 | + |
| 44 | +- **Line heights:** 1.65 body · 1.20 display · 1.40 UI. |
| 45 | + |
| 46 | +## Color |
| 47 | + |
| 48 | +Restrained. Two-color annotation set (rust + prussian blue) for primary marks; tier and severity palettes do the work of differentiating findings. |
| 49 | + |
| 50 | +**Background / ink / rules:** |
| 51 | + |
| 52 | +| Token | Hex | Role | |
| 53 | +|---|---|---| |
| 54 | +| `--bg` | `#faf8f3` | Pristine ivory — pages, page backgrounds. NOT pure white (too sterile), NOT parchment-warm (too cozy). | |
| 55 | +| `--raised` | `#ffffff` | Card / surface backgrounds — finding cards, swatches. | |
| 56 | +| `--ink` | `#1a1815` | Body text and primary headings. Warm near-black. | |
| 57 | +| `--ink-soft` | `#3a352e` | Secondary text, captions over `--raised`. | |
| 58 | +| `--ink-muted` | `#6b6358` | Tertiary text — meta lines, finding-card labels. | |
| 59 | +| `--rule` | `#e6e0d2` | Hairline rules, finding-card borders. | |
| 60 | +| `--rule-strong` | `#d4cdb9` | Stronger dividers, table borders. | |
| 61 | + |
| 62 | +**Two-color annotation set (the strategic accent pair):** |
| 63 | + |
| 64 | +| Token | Hex | Role | |
| 65 | +|---|---|---| |
| 66 | +| `--accent` | `#7a1f1f` | Library-stamp / annotation red. Page kickers, primary CTA, critical chips. Evokes academic editor's red pen. | |
| 67 | +| `--accent-blue` | `#1d4a5e` | Prussian blue. Hyperlinks, citation cross-references, "see also" markers. The second color in academic editing. | |
| 68 | +| `--accent-soft` | `#f4eae8` | Tinted hover / fill for `--accent` surfaces. | |
| 69 | + |
| 70 | +**Evidence-tier palette (the heart of Proof):** |
| 71 | + |
| 72 | +| Token | Hex | Tier | |
| 73 | +|---|---|---| |
| 74 | +| `--tier-1` | `#2f7a4a` | T1 — Meta-analyses, RCTs (heaviest weight, deepest color) | |
| 75 | +| `--tier-2` | `#2864a8` | T2 — Quasi-experimental with controls | |
| 76 | +| `--tier-3` | `#a87726` | T3 — Systematic reviews of mixed evidence | |
| 77 | +| `--tier-4` | `#b35a1f` | T4 — Observational without comparison | |
| 78 | +| `--tier-5` | `#6b6b6b` | T5 — Expert opinion (lightest, grey to evoke weakness) | |
| 79 | + |
| 80 | +**Severity palette (finding-card left border + chip fill):** |
| 81 | + |
| 82 | +| Severity | fg | bg | Use | |
| 83 | +|---|---|---|---| |
| 84 | +| critical | `#8c2515` | `#f5dcd5` | Course will measurably fail learners. | |
| 85 | +| warning | `#7a4f0c` | `#fbf0d9` | Likely problem worth addressing. | |
| 86 | +| info | `#344566` | `#e7eaf1` | Worth knowing, not blocking. | |
| 87 | + |
| 88 | +**Dark mode strategy:** Auto via `prefers-color-scheme: dark` (the report stylesheet) and explicit `data-theme="dark"` toggle (landing page). Surfaces redesigned (not just inverted): inky-dark background `#16140f`, warm-cream text `#ebe7dd`, terracotta accent `#d97461` replaces oxblood (oxblood loses too much chroma when inverted). All tier and severity tokens redefined with 10–20% saturation drop and adjusted backgrounds. The light theme is canonical; dark mode is a courtesy. |
| 89 | + |
| 90 | +## Spacing |
| 91 | + |
| 92 | +- **Base unit:** 4px. |
| 93 | +- **Density:** Comfortable. Academic-publishing convention — generous whitespace earns attention. |
| 94 | + |
| 95 | +| Token | px | Use | |
| 96 | +|---|---|---| |
| 97 | +| `2xs` | 2 | Tight inline gaps (badge padding) | |
| 98 | +| `xs` | 4 | Finding card border-left, button padding-y | |
| 99 | +| `sm` | 8 | Inline gaps between badges/chips | |
| 100 | +| `md` | 16 | Paragraph spacing, table cell padding | |
| 101 | +| `lg` | 24 | Section spacing within a card | |
| 102 | +| `xl` | 32 | Card-to-card spacing | |
| 103 | +| `2xl` | 48 | Section dividers | |
| 104 | +| `3xl` | 64 | Major page section spacing | |
| 105 | +| `4xl` | 96 | Hero spacing | |
| 106 | + |
| 107 | +## Layout |
| 108 | + |
| 109 | +- **Approach:** Hybrid. Grid-disciplined for marketing landing; single-column prose for reports. |
| 110 | +- **Grid:** 12-col desktop, 4-col mobile, gutter 24px. |
| 111 | +- **Max content width:** `1120px` outer container (marketing) · `64ch` prose column (reports). |
| 112 | +- **Optional Tufte side-notes:** 200px right column for evidence callouts on long reports. Only used when there's lateral content worth surfacing — never as decoration. |
| 113 | + |
| 114 | +**Border radius (sharp by default — the publication signal):** |
| 115 | + |
| 116 | +| Token | px | Use | |
| 117 | +|---|---|---| |
| 118 | +| `none` | 0 | Finding cards, table cells, surfaces | |
| 119 | +| `sm` | 2 | Buttons, install snippet, badges, chips | |
| 120 | +| `md` | 4 | Form inputs (rare) | |
| 121 | +| `full` | 9999 | Avatars only (none in current scope) | |
| 122 | + |
| 123 | +## Motion |
| 124 | + |
| 125 | +- **Approach:** Minimal-functional. Academic publications don't animate. |
| 126 | + |
| 127 | +| Token | Curve | Use | |
| 128 | +|---|---|---| |
| 129 | +| `enter` | `cubic-bezier(0.2, 0, 0, 1)` | Hover, focus, theme toggle | |
| 130 | +| `exit` | `cubic-bezier(0.4, 0, 1, 1)` | Dismissal | |
| 131 | + |
| 132 | +| Token | ms | Use | |
| 133 | +|---|---|---| |
| 134 | +| `micro` | 50–100 | Hover, focus rings | |
| 135 | +| `short` | 200 | Theme toggle, dropdown reveal | |
| 136 | + |
| 137 | +No medium / long durations. No scroll-driven animations. No parallax. No entrance animations on page load. `prefers-reduced-motion: reduce` disables all transitions. |
| 138 | + |
| 139 | +## Anti-patterns (NEVER ship) |
| 140 | + |
| 141 | +- Gradient mesh hero (Stripe owns it; copying = derivative AI-slop). |
| 142 | +- Stock photo of person looking at laptop (Quality Matters does this; category cliché). |
| 143 | +- 3-column or 5-column badge-icon feature grid (Quality Matters has FIVE; category cliché). |
| 144 | +- Bright association blue + orange palette. |
| 145 | +- "Built for X" / "Designed for Y" marketing copy. |
| 146 | +- Inter, Roboto, Helvetica, Open Sans, Space Grotesk as primary fonts. |
| 147 | +- Rounded card corners > 4px. |
| 148 | +- Sans-serif body text (we go serif; that's the named risk). |
| 149 | +- Centered-everything layouts. |
| 150 | +- Decorative shadows or glows. |
| 151 | + |
| 152 | +## Decisions log |
| 153 | + |
| 154 | +| Date | Decision | Rationale | |
| 155 | +|---|---|---| |
| 156 | +| 2026-05-13 | Initial design system created | `/design-consultation` after v3.0.0.0 shipped HTML reports. North-star: Proof. | |
| 157 | +| 2026-05-13 | Body-serif (Source Serif 4) instead of sans | Deliberate departure from modern editorial sites' sans-body convention. Locks the publication mood every paragraph. Cost: ~2–3% screen readability on low-DPI; accepted. | |
| 158 | +| 2026-05-13 | 0 border-radius on finding cards | Sharp corners signal "publication," not "consumer SaaS." Visual differentiation from category. Cost: feels austere on first encounter; accepted. | |
| 159 | +| 2026-05-13 | No hero illustration / gradient / image anywhere | Type-only marketing hero. Anti-SaaS, anti-AI-slop. Cost: scroll-stoppage power; accepted. Open question for future if first-time-visitor metrics call for revisiting. | |
| 160 | +| 2026-05-13 | Background ivory `#faf8f3` (replaces parchment `#fbfaf6`) | Cleaner publication feel. Parchment-warm read as "old book"; ivory reads as "good paper." | |
| 161 | +| 2026-05-13 | Add prussian blue `#1d4a5e` as secondary accent | Two-color annotation set (red + blue) mirrors how academic editors marked manuscripts. | |
0 commit comments