@codecademy/gamut 68.6.1-alpha.c8d945.0 → 68.6.1-alpha.d46fc5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/agent-tools/.claude-plugin/marketplace.json +16 -0
  2. package/agent-tools/.claude-plugin/plugin.json +7 -0
  3. package/agent-tools/.cursor-plugin/plugin.json +7 -0
  4. package/agent-tools/DESIGN.Codecademy.md +643 -0
  5. package/agent-tools/DESIGN.LXStudio.md +444 -0
  6. package/agent-tools/DESIGN.Percipio.md +435 -0
  7. package/agent-tools/DESIGN.md +1 -0
  8. package/agent-tools/agents/.gitkeep +0 -0
  9. package/agent-tools/commands/gamut-review.md +246 -0
  10. package/agent-tools/guidelines/components/buttons.md +91 -0
  11. package/agent-tools/guidelines/components/overview.md +52 -0
  12. package/agent-tools/guidelines/foundations/color.md +172 -0
  13. package/agent-tools/guidelines/foundations/modes.md +47 -0
  14. package/agent-tools/guidelines/foundations/spacing.md +107 -0
  15. package/agent-tools/guidelines/foundations/typography.md +84 -0
  16. package/agent-tools/guidelines/overview.md +46 -0
  17. package/agent-tools/guidelines/setup.md +81 -0
  18. package/agent-tools/rules/accessibility.mdc +78 -0
  19. package/agent-tools/skills/gamut-accessibility/SKILL.md +214 -0
  20. package/agent-tools/skills/gamut-color-mode/SKILL.md +140 -0
  21. package/agent-tools/skills/gamut-forms/SKILL.md +84 -0
  22. package/agent-tools/skills/gamut-style-utilities/SKILL.md +107 -0
  23. package/agent-tools/skills/gamut-system-props/SKILL.md +203 -0
  24. package/agent-tools/skills/gamut-testing/SKILL.md +221 -0
  25. package/agent-tools/skills/gamut-theming/SKILL.md +48 -0
  26. package/agent-tools/skills/gamut-typography/SKILL.md +75 -0
  27. package/bin/commands/plugin/install.mjs +213 -0
  28. package/bin/commands/plugin/list.mjs +73 -0
  29. package/bin/commands/plugin/remove.mjs +108 -0
  30. package/bin/commands/plugin/update.mjs +59 -0
  31. package/bin/gamut.mjs +96 -0
  32. package/bin/lib/claude.mjs +52 -0
  33. package/bin/lib/cursor.mjs +40 -0
  34. package/bin/lib/design.mjs +71 -0
  35. package/bin/lib/io.mjs +14 -0
  36. package/bin/lib/resolve-plugin-dir.mjs +38 -0
  37. package/bin/lib/run-command.mjs +22 -0
  38. package/dist/{PatternBackdrop/PatternBackdrop.d.ts → InternalFloatingCard/InternalFloatingCard.d.ts} +24 -8
  39. package/dist/InternalFloatingCard/InternalFloatingCard.js +98 -0
  40. package/dist/Modals/elements.d.ts +1 -186
  41. package/dist/Modals/elements.js +3 -3
  42. package/dist/Toast/Toast.js +4 -4
  43. package/package.json +11 -8
  44. package/dist/PatternBackdrop/PatternBackdrop.js +0 -43
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "gamut-design-system",
3
+ "owner": {
4
+ "name": "Codecademy"
5
+ },
6
+ "metadata": {
7
+ "description": "Local marketplace for @codecademy/gamut agent tools."
8
+ },
9
+ "plugins": [
10
+ {
11
+ "name": "gamut-design-system",
12
+ "source": "./",
13
+ "description": "Gamut design system agent tools: skills and rules for AI-assisted development."
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "gamut-design-system",
3
+ "version": "0.0.1",
4
+ "description": "Gamut design system agent tools: skills and rules for AI-assisted development.",
5
+ "license": "MIT",
6
+ "keywords": ["codecademy", "gamut", "design-system", "agent-skills"]
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "gamut-design-system",
3
+ "displayName": "Gamut Design System",
4
+ "version": "0.0.1",
5
+ "description": "Gamut design system agent tools: skills, rules, and guidelines for AI-assisted development.",
6
+ "keywords": ["codecademy", "gamut", "design-system", "agent-skills"]
7
+ }
@@ -0,0 +1,643 @@
1
+ ---
2
+ version: alpha
3
+ name: Codecademy Design System
4
+ description: Design tokens for codecademy.com
5
+ colors:
6
+ # palette — raw swatches; set once on :root and then always reference by token name, never use hex values directly in code
7
+ hyper-500: "#3A10E5"
8
+ hyper-400: "#5533FF"
9
+ navy-900: "#0A0D1C"
10
+ navy-800: "#10162F"
11
+ navy-700: "#31374C"
12
+ navy-600: "#4C5063"
13
+ navy-500: "#686C7C"
14
+ navy-300: "#BCBEC5"
15
+ navy-200: "#E2E3E6"
16
+ navy-100: "#F5F6F7"
17
+ yellow-500: "#FFD300"
18
+ yellow-400: "#CCA900"
19
+ yellow-0: "#FFFAE5"
20
+ yellow-900: "#211B00"
21
+ green-700: "#008A27"
22
+ green-400: "#AEE938"
23
+ green-0: "#F5FFE3"
24
+ green-900: "#151C07"
25
+ red-600: "#BE1809"
26
+ red-500: "#E91C11"
27
+ red-400: "#DC5879"
28
+ red-300: "#E85D7F"
29
+ red-0: "#FBF1F0"
30
+ red-900: "#280503"
31
+ beige: "#FFF0E5"
32
+ white: "#ffffff"
33
+ black: "#000000"
34
+ # semantic aliases (light mode) — use these in code, not palette swatches or hex values
35
+ text: "{colors.navy-800}"
36
+ text-accent: "{colors.navy-900}"
37
+ text-secondary: "{colors.navy-600}"
38
+ text-disabled: "{colors.navy-500}"
39
+ background: "{colors.white}"
40
+ background-primary: "{colors.beige}"
41
+ background-contrast: "{colors.white}"
42
+ background-selected: "{colors.navy-100}"
43
+ background-hover: "{colors.navy-200}"
44
+ background-disabled: "{colors.navy-200}"
45
+ background-success: "{colors.green-0}"
46
+ background-warning: "{colors.yellow-0}"
47
+ background-error: "{colors.red-0}"
48
+ primary: "{colors.hyper-500}"
49
+ primary-hover: "{colors.hyper-400}"
50
+ primary-inverse: "{colors.yellow-500}"
51
+ secondary: "{colors.navy-800}"
52
+ secondary-hover: "{colors.navy-700}"
53
+ interface: "{colors.hyper-500}"
54
+ interface-hover: "{colors.hyper-400}"
55
+ danger: "{colors.red-500}"
56
+ danger-hover: "{colors.red-600}"
57
+ feedback-error: "{colors.red-600}"
58
+ feedback-success: "{colors.green-700}"
59
+ feedback-warning: "{colors.yellow-500}"
60
+ border-primary: "{colors.navy-800}"
61
+ border-secondary: "{colors.navy-600}"
62
+ border-tertiary: "{colors.navy-300}"
63
+ border-disabled: "{colors.navy-500}"
64
+ shadow-primary: "{colors.navy-800}"
65
+ shadow-secondary: "{colors.navy-600}"
66
+ typography:
67
+ base:
68
+ fontFamily: '"Apercu", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif'
69
+ fontSize: "1rem"
70
+ fontWeight: "400"
71
+ lineHeight: "1.5"
72
+ accent:
73
+ fontFamily: '"Suisse", "Apercu", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif'
74
+ fontSize: "0.875rem"
75
+ fontWeight: "400"
76
+ lineHeight: "1.5"
77
+ title:
78
+ fontFamily: '"Apercu", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif'
79
+ fontSize: "2.125rem"
80
+ fontWeight: "700"
81
+ lineHeight: "1.2"
82
+ hankenGrotesk:
83
+ fontFamily: '"Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif'
84
+ monospace:
85
+ fontFamily: 'Monaco, Menlo, "Ubuntu Mono", "Droid Sans Mono", Consolas, monospace'
86
+ rounded:
87
+ none: "0px"
88
+ sm: "2px"
89
+ md: "4px"
90
+ lg: "8px"
91
+ xl: "16px"
92
+ full: "999px"
93
+ spacing:
94
+ "0": "0"
95
+ "4": "0.25rem"
96
+ "8": "0.5rem"
97
+ "12": "0.75rem"
98
+ "16": "1rem"
99
+ "24": "1.5rem"
100
+ "32": "2rem"
101
+ "40": "2.5rem"
102
+ "48": "3rem"
103
+ "64": "4rem"
104
+ "96": "6rem"
105
+ components:
106
+ FillButton:
107
+ backgroundColor: "{colors.primary}"
108
+ textColor: "{colors.white}"
109
+ rounded: "{rounded.md}"
110
+ FillButton-hover:
111
+ backgroundColor: "{colors.primary-hover}"
112
+ textColor: "{colors.white}"
113
+ FillButton-danger:
114
+ backgroundColor: "{colors.danger}"
115
+ textColor: "{colors.white}"
116
+ rounded: "{rounded.md}"
117
+ FillButton-danger-hover:
118
+ backgroundColor: "{colors.danger-hover}"
119
+ textColor: "{colors.white}"
120
+ StrokeButton:
121
+ backgroundColor: "transparent"
122
+ textColor: "{colors.secondary}"
123
+ rounded: "{rounded.md}"
124
+ CTAButton:
125
+ backgroundColor: "{colors.primary}"
126
+ textColor: "{colors.white}"
127
+ rounded: "{rounded.md}"
128
+ CTAButton-inverse:
129
+ backgroundColor: "{colors.primary-inverse}"
130
+ textColor: "{colors.secondary}"
131
+ rounded: "{rounded.md}"
132
+ TextButton:
133
+ backgroundColor: "transparent"
134
+ textColor: "{colors.primary}"
135
+ TextButton-hover:
136
+ textColor: "{colors.primary-hover}"
137
+ Card:
138
+ backgroundColor: "{colors.background}"
139
+ rounded: "{rounded.none}"
140
+ Card-interactive:
141
+ rounded: "{rounded.md}"
142
+ Card-elevated:
143
+ backgroundColor: "{colors.background-primary}"
144
+ rounded: "{rounded.lg}"
145
+ Card-beige:
146
+ backgroundColor: "{colors.beige}"
147
+ rounded: "{rounded.lg}"
148
+ Input:
149
+ backgroundColor: "{colors.background}"
150
+ textColor: "{colors.text}"
151
+ rounded: "{rounded.md}"
152
+ Checkbox:
153
+ backgroundColor: "{colors.interface}"
154
+ rounded: "{rounded.sm}"
155
+ Checkbox-hover:
156
+ backgroundColor: "{colors.interface-hover}"
157
+ Headline:
158
+ textColor: "{colors.text-accent}"
159
+ typography: "{typography.title}"
160
+ Tag-success:
161
+ backgroundColor: "{colors.feedback-success}"
162
+ textColor: "{colors.white}"
163
+ rounded: "{rounded.sm}"
164
+ Tag-warning:
165
+ backgroundColor: "{colors.feedback-warning}"
166
+ textColor: "{colors.text}"
167
+ rounded: "{rounded.sm}"
168
+ Alert-error:
169
+ backgroundColor: "{colors.background-error}"
170
+ textColor: "{colors.feedback-error}"
171
+ Alert-success:
172
+ backgroundColor: "{colors.background-success}"
173
+ textColor: "{colors.text}"
174
+ Alert-warning:
175
+ backgroundColor: "{colors.background-warning}"
176
+ textColor: "{colors.text}"
177
+ ---
178
+
179
+ # Codecademy
180
+
181
+ This file defines the visual design tokens for codecademy.com, implemented using the Gamut design system (`@codecademy/gamut`, `@codecademy/gamut-styles`). Gamut ships 52 components with Figma ↔ code mappings via Figma Code Connect.
182
+
183
+ **Figma file**: https://www.figma.com/design/ReGfRNillGABAj5SlITalN/📐-Gamut
184
+ **Storybook**: https://gamut.codecademy.com
185
+
186
+ ---
187
+
188
+ ## Visual Theme & Atmosphere
189
+
190
+ Codecademy communicates **logic with personality** — structured and trustworthy enough for a learning platform, with creative moments that feel engaging and human. The design voice is: *"we are ruled by logic, but are creative and a bit unexpected as well."*
191
+
192
+ **Density**: Medium. Information-dense layouts use careful whitespace and strong typographic hierarchy to stay readable. Avoid cramped or overly airy layouts.
193
+
194
+ **Design philosophy**:
195
+ - Components are color mode–aware by default — never hardcode hex values for adaptive UI
196
+ - Every component works across all themes without modification
197
+ - Mobile-first responsive design built on a 12-column grid
198
+ - Accessibility is guaranteed by design: semantic color tokens meet contrast requirements per mode automatically
199
+
200
+ ---
201
+
202
+ ## Themes
203
+
204
+ Codecademy products use one of four Gamut themes, all sharing the same core visual identity. Token aliases resolve to the right values per theme automatically — components require no modification.
205
+
206
+ | Theme | Use case | Base font | Dark mode |
207
+ |---|---|---|---|
208
+ | **Core** | Codecademy (default) | Apercu | ✓ light + dark |
209
+ | **Admin** | Codecademy admin tools | Apercu | ✓ light + dark |
210
+ | **Platform** | Codecademy learning environment | Apercu | ✓ light + dark |
211
+ | **LX Studio** | LX Studio application | Hanken Grotesk | light only |
212
+
213
+ The active theme is set at the app root via `<GamutProvider>`. When designing, know which theme your screen targets — it affects primary colors, font families, and available color weights.
214
+
215
+ **Font licensing**: Apercu is licensed for codecademy.com only. LX Studio uses Hanken Grotesk.
216
+
217
+ For Percipio projects, use `DESIGN.Percipio.md` from the same package instead.
218
+
219
+ ### LX Studio theme overrides
220
+
221
+ LX Studio extends Core with these differences:
222
+
223
+ **Font**: All families → `"Hanken Grotesk"` (no Apercu, no Suisse).
224
+
225
+ **Border radii** (all values shift up one step):
226
+
227
+ | Token | Core | LX Studio |
228
+ |---|---|---|
229
+ | `sm` | 2px | 4px |
230
+ | `md` | 4px | 8px |
231
+ | `lg` | 8px | 12px |
232
+
233
+ **Semantic color overrides (light mode)**:
234
+
235
+ | Token | Core value | LX Studio value |
236
+ |---|---|---|
237
+ | `primary` | hyper-500 `#3A10E5` | `#5628FE` (lxStudioPurple) |
238
+ | `primary-hover` | hyper-400 `#5533FF` | `#7955FC` (lxStudioPurpleHover) |
239
+ | `interface` | hyper-500 | hyper-500 (unchanged) |
240
+ | `feedback-success` | green-700 `#008A27` | `#06844F` (lxStudioSuccess) |
241
+ | `background-primary` | beige `#FFF0E5` | `#FAFBFC` (lxStudioBgPrimary) |
242
+ | `shadow-primary` | navy-800 | navy-200 |
243
+ | `border-primary` | navy-800 | navy-400 |
244
+ | `border-disabled` | navy-500 | navy-300 |
245
+
246
+ ---
247
+
248
+ ## Semantic Color Aliases
249
+
250
+ Use these token names when specifying colors in designs. They resolve to the correct raw value for the active theme and color mode automatically. **Never hardcode hex values** for anything that needs to adapt across modes.
251
+
252
+ ### Text
253
+
254
+ | Token | Light | Dark | Use for |
255
+ |---|---|---|---|
256
+ | `text` | navy-800 `#10162F` at 100% | white `#ffffff` | Default body and UI text |
257
+ | `text-accent` | navy-900 `#0A0D1C` | beige `#FFF0E5` | Stronger emphasis text |
258
+ | `text-secondary` | navy-800 at 75% | white at 65% | Supporting / secondary copy |
259
+ | `text-disabled` | navy-800 at 63% | white at 50% | Disabled state labels |
260
+
261
+ ### Background
262
+
263
+ | Token | Light | Dark | Use for |
264
+ |---|---|---|---|
265
+ | `background` | white `#ffffff` | navy-800 `#10162F` | Default page/component background |
266
+ | `background-primary` | beige `#FFF0E5` | navy-900 `#0A0D1C` | Slightly elevated surfaces |
267
+ | `background-contrast` | white | black `#000000` | Maximum contrast surface |
268
+ | `background-selected` | navy-800 at 4% | white at 4% | Selected row / item |
269
+ | `background-hover` | navy-800 at 12% | white at 9% | Hover state overlay |
270
+ | `background-disabled` | navy-800 at 12% | white at 9% | Disabled surface |
271
+ | `background-success` | green-0 `#F5FFE3` | green-900 `#151C07` | Success state container |
272
+ | `background-warning` | yellow-0 `#FFFAE5` | yellow-900 `#211B00` | Warning state container |
273
+ | `background-error` | red-0 `#FBF1F0` | red-900 `#280503` | Error state container |
274
+
275
+ ### Interactive
276
+
277
+ | Token | Light | Dark | Use for |
278
+ |---|---|---|---|
279
+ | `primary` | hyper-500 `#3A10E5` | yellow-500 `#FFD300` | Primary CTA, links, focus rings |
280
+ | `primary-hover` | hyper-400 `#5533FF` | yellow-400 `#CCA900` | Hover state of primary interactive |
281
+ | `primary-inverse` | yellow-500 `#FFD300` | hyper-500 `#3A10E5` | Primary on a colored background |
282
+ | `secondary` | navy-800 `#10162F` | white `#ffffff` | Secondary CTA, ghost buttons |
283
+ | `secondary-hover` | navy-800 at 86% | white at 80% | Hover state of secondary interactive |
284
+ | `interface` | hyper-500 `#3A10E5` | yellow-500 `#FFD300` | UI affordances (checkboxes, toggles, sliders) |
285
+ | `interface-hover` | hyper-400 `#5533FF` | yellow-400 `#CCA900` | Hover on interface elements |
286
+ | `danger` | red-500 `#E91C11` | red-300 `#E85D7F` | Destructive actions, error states |
287
+ | `danger-hover` | red-600 `#BE1809` | red-400 `#DC5879` | Hover on danger interactive |
288
+
289
+ ### Border
290
+
291
+ | Token | Light | Dark | Use for |
292
+ |---|---|---|---|
293
+ | `border-primary` | navy-800 `#10162F` | white `#ffffff` | Strong borders, dividers |
294
+ | `border-secondary` | navy-800 at 75% | white at 65% | Medium-weight borders |
295
+ | `border-tertiary` | navy-800 at 28% | white at 20% | Subtle borders, separators |
296
+ | `border-disabled` | navy-800 at 63% | white at 50% | Disabled input borders |
297
+
298
+ ### Feedback
299
+
300
+ | Token | Light | Dark | Use for |
301
+ |---|---|---|---|
302
+ | `feedback-error` | red-600 `#BE1809` | red-300 `#E85D7F` | Error messages, validation |
303
+ | `feedback-success` | green-700 `#008A27` | green-400 `#AEE938` | Success messages, confirmations |
304
+ | `feedback-warning` | yellow `#FFD300` | yellow-0 `#FFFAE5` | Warning messages, caution states |
305
+
306
+ ### Shadow
307
+
308
+ | Token | Light | Dark |
309
+ |---|---|---|
310
+ | `shadow-primary` | navy-800 | white |
311
+ | `shadow-secondary` | navy-800 at 75% | white at 65% |
312
+
313
+ ---
314
+
315
+ ## Raw Color Palette
316
+
317
+ All colors available as static tokens regardless of color mode. Use these only when a color should be **fixed** and not adapt to dark mode.
318
+
319
+ ### Core Palette
320
+
321
+ | Name | Weights available | Notes |
322
+ |---|---|---|
323
+ | `navy` | 100–900 | 100–700 are rgba transparencies of `#10162F`; 800 = `#10162F`; 900 = `#0A0D1C` |
324
+ | `white` | 100–700 | rgba transparencies of `#ffffff` (no solid white weight — use `white` for `#fff`) |
325
+ | `blue` | 0, 100, 300, 400, 500, 800 | 500 = `#1557FF` |
326
+ | `hyper` | 400, 500 | 500 = `#3A10E5` (purple-blue), 400 = `#5533FF` |
327
+ | `green` | 0, 100, 400, 700, 900 | 700 = `#008A27` |
328
+ | `yellow` | 0, 400, 500, 900 | 500 = `#FFD300` |
329
+ | `red` | 0, 300, 400, 500, 600, 900 | 500 = `#E91C11` |
330
+ | `gray` | 100, 200, 300, 600, 800, 900 | |
331
+ | `pink` | 0, 400 | 400 = `#F966FF` |
332
+ | `orange` | 100, 500 | 500 = `#FF8C00` |
333
+ | `beige` | 100 (alias: `beige`) | `#FFF0E5` |
334
+ | `black` | — | `#000000` |
335
+ | `white` (solid) | — | `#ffffff` |
336
+
337
+ **Named aliases** (shorthand for common weights):
338
+ `beige`, `blue`, `green`, `hyper`, `lightBlue`, `lightGreen`, `navy`, `orange`, `paleBlue`, `paleGreen`, `palePink`, `paleRed`, `paleYellow`, `pink`, `red`, `yellow`, `black`, `white`
339
+
340
+ ### Platform-only additions
341
+ `lightBeige` (`#FFFBF8`), `gold` (`#8A7300`), `teal` (`#006D82`), `purple` (`#B3CCFF`)
342
+
343
+ ### LX Studio additions
344
+ `lxStudioPurple` (`#5628FE`), `lxStudioPurpleHover` (`#7955FC`), `lxStudioSuccess` (`#06844F`)
345
+
346
+ ---
347
+
348
+ ## Typography
349
+
350
+ ### Typefaces
351
+
352
+ | Token | Core / Admin / Platform | LX Studio | Use for |
353
+ |---|---|---|---|
354
+ | `base` | Apercu Pro (CSS: `Apercu`) | Hanken Grotesk | All default UI text, headlines, body copy |
355
+ | `accent` | Suisse Intl Mono (CSS: `Suisse`); falls back to `Apercu` | Hanken Grotesk | Code, captions, labels, lists, technical context |
356
+ | `monospace` | Monaco, Menlo, Ubuntu Mono, Droid Sans Mono, Consolas | Monaco, Menlo, Ubuntu Mono, Droid Sans Mono, Consolas | Code editor contexts |
357
+ | `system` | System UI fonts | System UI fonts | Performance-critical surfaces |
358
+
359
+ **Apercu is licensed for codecademy.com only.** LX Studio uses Hanken Grotesk for both `base` and `accent`.
360
+
361
+ ### Rules
362
+
363
+ - **Apercu Bold** for headlines, sub-headlines, CTAs, and buttons.
364
+ - **Apercu Regular** for body text, UI labels, and menu items.
365
+ - **Apercu Italic** to emphasize text within a Regular paragraph — not Bold.
366
+ - **Suisse** sparingly: code snippets, enumerated items, quotations, captions. Reads 10–15% large for its point size — size down relative to Apercu (14px Suisse ≈ 16px Apercu visually).
367
+ - Text is **left-aligned** by default. Center-align only for short marketing headlines. Never right-align.
368
+ - Do not adjust letter-spacing.
369
+
370
+ ### Font size scale
371
+
372
+ | Token key | Size | Common use |
373
+ |---|---|---|
374
+ | `64` | 64px | Hero / display |
375
+ | `44` | 44px | Page titles |
376
+ | `34` | 34px | Section titles |
377
+ | `26` | 26px | Sub-section titles |
378
+ | `22` | 22px | Card titles, large UI labels |
379
+ | `20` | 20px | Secondary titles |
380
+ | `18` | 18px | Large body, intro text |
381
+ | `16` | 16px | Default body text |
382
+ | `14` | 14px | Small body, captions, labels |
383
+
384
+ ### Font weight scale
385
+
386
+ | Token | Value | Use |
387
+ |---|---|---|
388
+ | `base` | 400 | Body text, UI labels |
389
+ | `title` | 700 | Headlines, CTAs, buttons |
390
+
391
+ ### Line height scale
392
+
393
+ | Token | Value | Use |
394
+ |---|---|---|
395
+ | `base` | 1.5 | Body text (150% — aim for 150–175% of font size) |
396
+ | `spacedTitle` | 1.3 | Sub-headlines and medium titles |
397
+ | `title` | 1.2 | Large headlines (aim for 100–110% of font size) |
398
+
399
+ ### Line length
400
+
401
+ Target 45–85 characters per line; 66 characters is ideal for web body text. Max 50 characters for multi-column layouts.
402
+
403
+ ---
404
+
405
+ ## Spacing Scale
406
+
407
+ All spacing is multiples of 4px, placed on an 8px grid.
408
+
409
+ | Token | Value |
410
+ |---|---|
411
+ | `0` | 0 |
412
+ | `4` | 4px |
413
+ | `8` | 8px |
414
+ | `12` | 12px |
415
+ | `16` | 16px |
416
+ | `24` | 24px |
417
+ | `32` | 32px |
418
+ | `40` | 40px |
419
+ | `48` | 48px |
420
+ | `64` | 64px |
421
+ | `96` | 96px |
422
+
423
+ ---
424
+
425
+ ## Depth & Elevation
426
+
427
+ Gamut uses border-based and shadow-based depth cues rather than a rigid z-elevation tier system.
428
+
429
+ ### Shadow tokens
430
+
431
+ Shadow props accept standard CSS `box-shadow` syntax. Always use `shadow-primary` / `shadow-secondary` color tokens so shadows remain visible in both light and dark modes.
432
+
433
+ ```
434
+ box-shadow: 0 4px 0 <shadow-primary> → Card "outline" shadow
435
+ box-shadow: 0 0 4px rgba(0,0,0,.15) → Subtle ambient shadow
436
+ ```
437
+
438
+ ### Card shadow variants
439
+
440
+ | Variant | Effect | Use for |
441
+ |---|---|---|
442
+ | `none` (default) | No shadow | Static / non-interactive cards |
443
+ | `outline` | Solid shadow on bottom + left/right using border color | Standard clickable cards |
444
+ | `patternLeft` | Decorative checker pattern on bottom + left | Stylized content cards |
445
+ | `patternRight` | Decorative checker pattern on bottom + right | Stylized content cards |
446
+
447
+ Interactive cards (`isInteractive` prop) gain a shadow on hover and `borderRadius: md`. Cards with a pattern drop the pattern on hover.
448
+
449
+ ### Z-index
450
+
451
+ | Token | Value | Use |
452
+ |---|---|---|
453
+ | `headerZ` | 15 | Global page header |
454
+
455
+ ---
456
+
457
+ ## Border Radius Scale
458
+
459
+ | Token | Value | Use |
460
+ |---|---|---|
461
+ | `none` | 0px | Square / non-interactive elements |
462
+ | `sm` | 2px | Subtle rounding, tags |
463
+ | `md` | 4px | Default buttons, inputs, interactive cards |
464
+ | `lg` | 8px | Cards, panels |
465
+ | `xl` | 16px | Large cards, modals |
466
+ | `full` | 999px | Pills, avatars, circular elements |
467
+
468
+ ---
469
+
470
+ ## Responsive Behavior
471
+
472
+ Mobile-first. Apply styles from the named breakpoint and up.
473
+
474
+ ### Breakpoints & screen sizes
475
+
476
+ | Token | Min-width | Screen dimensions | Max content | Fold height |
477
+ |---|---|---|---|---|
478
+ | _(base)_ | 0 | 320×480 | 288px | 440px |
479
+ | `xs` | 480px | 480×900 | 448px | 440px |
480
+ | `sm` | 768px | 768×1024 | 704px | 680px |
481
+ | `md` | 1024px | 1024×768 | 896px | 680px |
482
+ | `lg` | 1200px | 1200×900 | 1072px | 680px |
483
+ | `xl` | 1440px | 1440×900 | 1248px | 680px |
484
+
485
+ Container query variants (`c_xs` through `c_xl`) mirror these values but trigger on component container size, not viewport.
486
+
487
+ ### Grid
488
+
489
+ 12-column grid at all breakpoints. The designer specifies how many columns a section spans per breakpoint.
490
+
491
+ | Usage | Recommended values |
492
+ |---|---|
493
+ | Horizontal margins | 64px (lg+), 48px (md), 32px (sm/xs), 16px (base) |
494
+ | Column gaps (gutters) | 32px (lg+), 24px (md), 16px (sm/xs), 8px (base) |
495
+ | Row gaps | 32px (lg+), 24px (md), 16px (sm/xs), 8px (base) |
496
+
497
+ ### Touch targets
498
+
499
+ Minimum interactive touch target: **44×44px** on mobile breakpoints.
500
+
501
+ ### Collapsing strategies
502
+
503
+ - Begin design work at 1440px (XL), then adapt to smaller sizes.
504
+ - Wider multi-column layouts collapse to fewer columns — do not simply stretch or squish.
505
+ - Elements not in an explicit lockup (e.g., catalog cards) should align on one axis (usually left) rather than fill column widths.
506
+ - Avoid dense or small components in the base (mobile) breakpoint.
507
+
508
+ ---
509
+
510
+ ## Component Library
511
+
512
+ Components are organized into three tiers:
513
+
514
+ ### Atoms — foundational, single-purpose
515
+
516
+ Badge, Button (FillButton, StrokeButton, CTAButton, TextButton, IconButton), ButtonBase, Card, Checkbox, CodeBlock, ColorMode, Drawer, FlexBox, FormGroup, GridBox, HiddenText, Icon, Input, Label, Loader, Radio, Select, Spinner, Tag, TextArea, Toggle, Tooltip
517
+
518
+ ### Molecules — composed of atoms, handle a discrete task
519
+
520
+ Alert, Anchor, Breadcrumbs, Coachmark, Disclosure, GridForm, Markdown, Menu, Modal, Pagination, Popover, ProgressBar, Table, Tabs, Toast, Toaster, Video
521
+
522
+ ### Organisms — page-level compositions
523
+
524
+ ContentContainer, GridContainer, Layout, LayoutGrid
525
+
526
+ ### Key component patterns
527
+
528
+ #### Buttons
529
+
530
+ | Variant | Component | Use for |
531
+ |---|---|---|
532
+ | Primary action | `FillButton` | Solid fill, high-emphasis CTA |
533
+ | Secondary action | `StrokeButton` | Outlined, secondary CTA |
534
+ | Marketing CTA | `CTAButton` | High-visibility promotional actions |
535
+ | Tertiary / inline | `TextButton` | Low-emphasis, inline text actions |
536
+ | Icon-only | `IconButton` | Compact actions with icon only |
537
+
538
+ All button variants support sizes: `small`, `normal` (default), `large`. They accept an `icon` prop (leading or trailing) and a `disabled` prop. Passing `href` renders the button as an `<a>` tag.
539
+
540
+ **States**: default → hover (`primary-hover` / `secondary-hover`) → active → disabled (`text-disabled` + `background-disabled`).
541
+
542
+ #### Cards
543
+
544
+ Cards support:
545
+ - **Background variants**: `default` (ColorMode-responsive), `white`, `yellow`, `beige` (light contexts), `navy`, `hyper` (dark contexts)
546
+ - **Shadow variants**: `none` (default), `outline`, `patternLeft`, `patternRight`
547
+ - **Interaction**: wrap in `<Anchor>` and add `isInteractive` for hover shadow + `borderRadius: md`
548
+ - **Border radius**: defaults to `none` (non-interactive); override with the `borderRadius` prop as needed
549
+
550
+ #### Color-aware components
551
+
552
+ - **`<ColorMode mode="light|dark|system">`** — wraps a subtree in an explicit color mode.
553
+ - **`<Background bg="<color>">`** — applies a background color and automatically switches the color mode inside to maintain accessible contrast. Prefer this over setting a raw `bg` prop on any content-bearing surface.
554
+
555
+ ---
556
+
557
+ ## Global Elements
558
+
559
+ | Token | Value | Use |
560
+ |---|---|---|
561
+ | `headerHeight` | 4rem (64px) base, 5rem (80px) at `md`+ | Global page header height |
562
+ | `headerZ` | 15 | Z-index for global page headers |
563
+
564
+ ---
565
+
566
+ ## Do's and Don'ts
567
+
568
+ ### Colors
569
+
570
+ - **Do** use semantic color aliases (`primary`, `text`, `background`, etc.) for any UI that must adapt to color mode or theme.
571
+ - **Do** use `<Background bg="...">` when setting a section background — it adjusts the inner color mode for contrast automatically.
572
+ - **Don't** hardcode hex values for anything adaptive.
573
+ - **Don't** use navy or white semi-transparent swatches where they may overlap unpredictably.
574
+
575
+ ### Typography
576
+
577
+ - **Do** use `title` weight (700) for headlines, CTAs, and buttons.
578
+ - **Do** keep body text at 150–175% line height for readability.
579
+ - **Do** use Suisse sparingly — as an accent for code, captions, and lists only.
580
+ - **Don't** use Apercu Bold to emphasize text *within* a paragraph — use Italic instead.
581
+ - **Don't** adjust letter-spacing.
582
+ - **Don't** right-align text in normal circumstances.
583
+ - **Don't** center-align body paragraphs with long line lengths.
584
+
585
+ ### Layout & Spacing
586
+
587
+ - **Do** use multiples of 8px for block-element spacing (4px only for inline / typographic relationships).
588
+ - **Do** begin design work at 1440px (XL), then adapt down to each breakpoint.
589
+ - **Do** align elements to the 12-column grid.
590
+ - **Don't** stretch elements to fill wider space — maintain proper line lengths and component widths.
591
+
592
+ ### Components
593
+
594
+ - **Do** use `FillButton` for primary actions and `StrokeButton` for secondary actions.
595
+ - **Do** add `isInteractive` to any `Card` that is wrapped in an `<Anchor>`.
596
+ - **Don't** use `CTAButton` for standard UI actions — reserve it for marketing/high-visibility promotions.
597
+ - **Don't** use `<Background>` without an actual color value — it's not a neutral wrapper.
598
+
599
+ ---
600
+
601
+ ## Agent Prompt Guide
602
+
603
+ Quick color/token reference for generating or specifying UI:
604
+
605
+ | Scenario | Tokens |
606
+ |---|---|
607
+ | Primary button (light) | `bg: primary (#3A10E5)`, `color: white`, `hover: primary-hover (#5533FF)` |
608
+ | Primary button (dark) | `bg: primary (#FFD300)`, `color: navy-800`, `hover: primary-hover (#CCA900)` |
609
+ | Body text | `color: text`, `font: base (Apercu Pro)`, `size: 16px`, `weight: 400`, `lineHeight: base (1.5)` |
610
+ | Headline | `color: text-accent`, `font: base`, `size: 34–64px`, `weight: title (700)`, `lineHeight: title (1.2)` |
611
+ | Caption / label | `color: text-secondary`, `font: accent (Suisse Int'l Mono)`, `size: 14px` |
612
+ | Card default | `bg: background`, `borderRadius: none` — add `isInteractive` for hover shadow + `borderRadius: md` |
613
+ | Error state | `color: feedback-error`, `bg: background-error`, `border: danger` |
614
+ | Success state | `color: feedback-success`, `bg: background-success` |
615
+ | Disabled state | `color: text-disabled`, `bg: background-disabled`, `border: border-disabled` |
616
+
617
+ ### Component token cheatsheet
618
+
619
+ ```
620
+ FillButton → bg: primary, color: white, hover: primary-hover
621
+ StrokeButton → bg: transparent, border: secondary, hover: secondary-hover
622
+ CTAButton → high-visibility; use primary-inverse on colored surfaces
623
+ Card (light) → variant: "default" | "white" | "yellow" | "beige"
624
+ Card (dark) → variant: "navy" | "hyper"
625
+ Alert (error) → uses feedback-error + background-error
626
+ Alert (success) → uses feedback-success + background-success
627
+ Alert (warning) → uses feedback-warning + background-warning
628
+ ColorMode → <ColorMode mode="light|dark|system">
629
+ Background → <Background bg="hyper"> — auto-flips color mode for contrast
630
+ ```
631
+
632
+ ---
633
+
634
+ ## Figma ↔ Code Mapping
635
+
636
+ 52 components have Code Connect entries in `packages/code-connect/`. These appear as live code snippets in Figma's inspect panel when you select a component.
637
+
638
+ Figma layer names use emojis as visual shorthand (e.g. `✏️ label`, `👁 leading icon`, `↳ trailing icon`). These map to named props in the React components.
639
+
640
+ To publish updated code snippets after changing a component:
641
+ ```
642
+ npx figma connect publish --token <your-figma-token>
643
+ ```