| 1 | /* ------------------------------------------------------------------ */ |
| 2 | /* Tokens and roles — the whale-road */ |
| 3 | /* ------------------------------------------------------------------ */ |
| 4 | /* |
| 5 | * Direction: codewhale-design/DIRECTION.md. The site's colour roles are the |
| 6 | * codewhale-design 5.x light and dark roles (the desktop app's), type is |
| 7 | * Geist, and shared spacing, radius, motion and elevation come from |
| 8 | * tokens.json, exported to ../tokens.css (`--gpui-*`) by |
| 9 | * scripts/export-design-tokens.py. Pages paint with these roles rather than |
| 10 | * importing desktop colors. |
| 11 | * |
| 12 | * Filled actions use the primary blue; links, focus and selection carry |
| 13 | * the accent. The footer sits on the page's own ground in both appearances. |
| 14 | * |
| 15 | * Depth is elevation. --panel is raised (nearer the surface, lighter); |
| 16 | * --bg is the floor; --surface is recessed (code, rails, fields). |
| 17 | * |
| 18 | * State is a mark and a word: --live (working, done, ready), --attention |
| 19 | * (needs you), --danger (failed), --muted (idle). Never colour alone. |
| 20 | * |
| 21 | * NAMING TRAP: tokens.json `background` is the floor (web --bg); in dark, |
| 22 | * tokens.json `sidebar` is the raised colour (web --panel) and `surface` the |
| 23 | * recessed one (web --surface); in light, `surface` is raised and `sidebar` |
| 24 | * the recessed one. |
| 25 | */ |
| 26 | |
| 27 | /* ---------- scheme-independent tokens ---------- */ |
| 28 | :root { |
| 29 | --kit-whale-blue: #0b48bb; |
| 30 | --kit-current-blue: #1e8fd8; |
| 31 | --kit-mark-navy: #142352; |
| 32 | --kit-abyss: #0f1e2d; |
| 33 | --kit-deep-navy: #142638; |
| 34 | --kit-night-border: #31495e; |
| 35 | --ocean-abyss: var(--kit-abyss); |
| 36 | --ocean-floor: var(--kit-deep-navy); |
| 37 | --ocean-line: var(--kit-night-border); |
| 38 | --ocean-line-strong: var(--gpui-dark-border-strong); |
| 39 | --brand-light: var(--kit-current-blue); |
| 40 | --brand-deep: var(--kit-whale-blue); |
| 41 | --brand-mid: #1877c9; |
| 42 | --brand-fill: linear-gradient(135deg, var(--brand-mid), var(--brand-deep)); |
| 43 | --brand-fill-hover: linear-gradient(135deg, var(--brand-deep), var(--kit-mark-navy)); |
| 44 | --on-brand: var(--gpui-dark-on-primary); |
| 45 | --ombre: var(--gpui-ombre); |
| 46 | |
| 47 | --font-body: var(--font-geist-sans), var(--gpui-font-fallbacks), ui-sans-serif, system-ui, |
| 48 | -apple-system, "Segoe UI", sans-serif; |
| 49 | --font-display: var(--font-body); |
| 50 | --font-mono: var(--font-geist-mono), ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, |
| 51 | Consolas, "Liberation Mono", monospace; |
| 52 | --font-cjk: var(--gpui-font-fallbacks), sans-serif; |
| 53 | |
| 54 | /* Type roles from tokens.json. The editorial section and display sizes |
| 55 | are the website's own layout: fluid steps above the token display. */ |
| 56 | --text-caption: var(--gpui-type-caption-size); |
| 57 | --text-mono: var(--gpui-type-code-size); |
| 58 | --text-label: var(--gpui-type-label-size); |
| 59 | --text-ui: var(--gpui-type-body-size); |
| 60 | --text-body: var(--gpui-type-prose-size); |
| 61 | --text-prose: var(--gpui-type-prose-size); |
| 62 | --leading-prose: var(--gpui-type-prose-line); |
| 63 | --text-heading: var(--gpui-type-heading-size); |
| 64 | --text-title: var(--gpui-type-title-size); |
| 65 | --text-section: clamp(var(--gpui-type-display-size), 1.2rem + 1.7vw, 2.5rem); |
| 66 | --text-display: clamp(2rem, 1.3rem + 2.6vw, 3rem); |
| 67 | --text-display-lg: clamp(2.5rem, 1.4rem + 4.4vw, 4.5rem); |
| 68 | --weight-heading: var(--gpui-type-heading-weight); |
| 69 | --text-xs: var(--text-caption); |
| 70 | --text-sm: var(--text-ui); |
| 71 | --text-base: var(--text-body); |
| 72 | |
| 73 | /* Space: the token steps (4, 8, 12, 16, 24, 32), then page rhythm. */ |
| 74 | --space-1: var(--gpui-spacing-compact); |
| 75 | --space-2: var(--gpui-spacing-control); |
| 76 | --space-3: var(--gpui-spacing-group); |
| 77 | --space-4: var(--gpui-spacing-section); |
| 78 | --space-5: var(--gpui-spacing-large); |
| 79 | --space-6: var(--gpui-spacing-page); |
| 80 | --space-7: 3rem; |
| 81 | --space-8: 4rem; |
| 82 | --section-gap: clamp(var(--space-7), 7vw, 5.5rem); |
| 83 | |
| 84 | /* One container, one reading measure. */ |
| 85 | --container: min(100% - var(--gpui-spacing-page), 76rem); |
| 86 | --measure-prose: 46rem; |
| 87 | --measure-text: 68ch; |
| 88 | --hero-pad: clamp(3rem, 7vw, 5.5rem); |
| 89 | --section-pad: clamp(2.75rem, 5vw, 4rem); |
| 90 | |
| 91 | /* Radius: control, panel, sheet; pill for dots. */ |
| 92 | --radius-control: var(--gpui-radius-control); |
| 93 | --radius-surface: var(--gpui-radius-panel); |
| 94 | --radius-sheet: var(--gpui-radius-sheet); |
| 95 | --radius-pill: 999px; |
| 96 | |
| 97 | /* Motion from tokens.json. Nothing bounces: every curve stays in [0, 1]. */ |
| 98 | --dur-state: var(--gpui-motion-duration-state); |
| 99 | --dur-arrive: var(--gpui-motion-duration-arrive); |
| 100 | --dur-exit: var(--gpui-motion-duration-exit); |
| 101 | --dur-spring: var(--gpui-motion-duration-panel); |
| 102 | --dur-spin: var(--gpui-motion-loop-beat); |
| 103 | --ease-out: var(--gpui-easing-out); |
| 104 | --ease-in: var(--gpui-easing-in); |
| 105 | --ease-spring: var(--gpui-easing-panel); |
| 106 | --ease-exit: var(--ease-in); |
| 107 | } |
| 108 | |
| 109 | /* Reduced motion is a still pose: every duration steps. Keyframed motion is |
| 110 | additionally declared only inside `prefers-reduced-motion: |
| 111 | no-preference`, so it never starts. */ |
| 112 | @media (prefers-reduced-motion: reduce) { |
| 113 | :root { |
| 114 | --dur-state: 0ms; |
| 115 | --dur-spring: 0ms; |
| 116 | --dur-arrive: 0ms; |
| 117 | --dur-exit: 0ms; |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | /* ---------- light ---------- */ |
| 122 | :root { |
| 123 | --bg: var(--gpui-light-bg); |
| 124 | --surface: var(--gpui-light-sidebar); |
| 125 | --panel: var(--gpui-light-panel); |
| 126 | --text: var(--gpui-light-text); |
| 127 | --muted: var(--gpui-light-text-muted); |
| 128 | --line: var(--gpui-light-border); |
| 129 | --line-strong: var(--gpui-light-border-strong); |
| 130 | --accent: var(--gpui-light-primary); |
| 131 | --accent-hover: color-mix(in srgb, var(--gpui-light-primary) calc(var(--gpui-primary-hover-opacity) * 100%), transparent); |
| 132 | --on-accent: var(--gpui-light-on-primary); |
| 133 | |
| 134 | --hover: var(--gpui-light-hover); |
| 135 | --selected: var(--gpui-light-list-active); |
| 136 | --selection: color-mix(in srgb, var(--gpui-light-accent) calc(var(--gpui-selection-opacity) * 100%), transparent); |
| 137 | --ring: var(--gpui-light-accent); |
| 138 | --live: var(--gpui-light-live); |
| 139 | --success: var(--gpui-light-live); |
| 140 | --attention: var(--gpui-light-attention); |
| 141 | --danger: var(--gpui-light-danger); |
| 142 | --mark-ink: var(--gpui-light-text); |
| 143 | --ombre-ink: linear-gradient(135deg, var(--brand-light), var(--brand-deep)); |
| 144 | --diff-add: var(--gpui-light-diff-add); |
| 145 | --diff-del: var(--gpui-light-diff-remove); |
| 146 | --ground: var(--gpui-water-light) top center / 100% 38rem no-repeat, var(--bg); |
| 147 | --home-sky: var(--gpui-surface-light-light) top center / 100% 38rem no-repeat, var(--ground); |
| 148 | --glow: 0 0 0 3px color-mix(in srgb, currentColor 16%, transparent); |
| 149 | --glow-focus: 0 0 0 4px color-mix(in srgb, var(--gpui-light-accent) 16%, transparent); |
| 150 | --shadow-popover: var(--gpui-elevation-popover-light); |
| 151 | --shadow-dialog: var(--gpui-elevation-dialog-light); |
| 152 | color-scheme: light; |
| 153 | } |
| 154 | |
| 155 | /* ---------- dark — only when pinned ---------- */ |
| 156 | :root[data-theme="dark"] { |
| 157 | --bg: var(--gpui-dark-bg); |
| 158 | --surface: var(--gpui-dark-panel); |
| 159 | --panel: var(--gpui-dark-sidebar); |
| 160 | --text: var(--gpui-dark-text); |
| 161 | --muted: var(--gpui-dark-text-muted); |
| 162 | --line: var(--gpui-dark-border); |
| 163 | --line-strong: var(--gpui-dark-border-strong); |
| 164 | --accent: var(--gpui-dark-accent); |
| 165 | --accent-hover: color-mix(in srgb, var(--gpui-dark-accent) calc(var(--gpui-primary-hover-opacity) * 100%), transparent); |
| 166 | --on-accent: var(--gpui-dark-bg); |
| 167 | |
| 168 | --hover: var(--gpui-dark-hover); |
| 169 | --selected: var(--gpui-dark-list-active); |
| 170 | --selection: color-mix(in srgb, var(--gpui-dark-accent) calc(var(--gpui-selection-opacity) * 100%), transparent); |
| 171 | --ring: var(--gpui-dark-accent); |
| 172 | --live: var(--gpui-dark-live); |
| 173 | --success: var(--gpui-dark-live); |
| 174 | --attention: var(--gpui-dark-attention); |
| 175 | --danger: var(--gpui-dark-danger); |
| 176 | --mark-ink: var(--gpui-dark-text); |
| 177 | --ombre-ink: linear-gradient(135deg, var(--gpui-dark-accent), var(--brand-light)); |
| 178 | --diff-add: var(--gpui-dark-diff-add); |
| 179 | --diff-del: var(--gpui-dark-diff-remove); |
| 180 | --ground: var(--gpui-water-dark) top center / 100% 38rem no-repeat, var(--bg); |
| 181 | --home-sky: var(--gpui-surface-light-dark) top center / 100% 38rem no-repeat, var(--ground); |
| 182 | --glow: 0 0 0 3px color-mix(in srgb, currentColor 20%, transparent), 0 0 12px 1px color-mix(in srgb, currentColor 45%, transparent); |
| 183 | --glow-focus: 0 0 0 4px color-mix(in srgb, var(--gpui-dark-accent) 30%, transparent); |
| 184 | --shadow-popover: var(--gpui-elevation-popover-dark); |
| 185 | --shadow-dialog: var(--gpui-elevation-dialog-dark); |
| 186 | color-scheme: dark; |
| 187 | } |
| 188 | |
| 189 | /* ---------- legacy names ---------- */ |
| 190 | /* Pages and partials that have not moved to the roles (the docs) read these. |
| 191 | Declared once on :root, they resolve against whichever scheme block wins |
| 192 | there. Removed in the post-renovation sweep. */ |
| 193 | :root { |
| 194 | --paper: var(--bg); |
| 195 | --paper-deep: var(--surface); |
| 196 | --paper-card: var(--panel); |
| 197 | --paper-edge: var(--line); |
| 198 | --paper-line: var(--line); |
| 199 | --paper-line-soft: var(--line); |
| 200 | --hairline: var(--line); |
| 201 | --ink: var(--text); |
| 202 | --ink-soft: var(--muted); |
| 203 | --ink-mute: var(--muted); |
| 204 | --indigo: var(--accent); |
| 205 | --indigo-deep: var(--accent-hover); |
| 206 | --indigo-pale: color-mix(in srgb, var(--accent) 12%, transparent); |
| 207 | --cobalt: var(--accent); |
| 208 | --cyan: var(--accent); |
| 209 | --ochre: var(--attention); |
| 210 | --signal-gold: var(--attention); |
| 211 | --jade: var(--live); |
| 212 | --seafoam: var(--live); |
| 213 | --ocean-coral: var(--danger); |
| 214 | --docs-accent: var(--accent); |
| 215 | --docs-button-bg: var(--panel); |
| 216 | --docs-button-border: var(--line); |
| 217 | --docs-button-text: var(--text); |
| 218 | --code-bg: var(--surface); |
| 219 | --code-fg: var(--text); |
| 220 | --stage-line: var(--line); |
| 221 | } |
| 222 |