@tenphi/cookbook 0.15.0 → 0.17.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 (46) hide show
  1. package/README.md +25 -0
  2. package/dist/config.d.ts +2 -2
  3. package/dist/index.d.ts +2 -2
  4. package/docs/ai-agents.md +61 -0
  5. package/docs/architecture.md +91 -0
  6. package/docs/authoring.mdx +86 -0
  7. package/docs/cli.md +88 -0
  8. package/docs/configuration.md +587 -0
  9. package/docs/content-sources.md +178 -0
  10. package/docs/customization-rules.md +154 -0
  11. package/docs/deployment.md +95 -0
  12. package/docs/examples.md +101 -0
  13. package/docs/getting-started.md +134 -0
  14. package/docs/index.md +74 -0
  15. package/docs/migration.md +36 -0
  16. package/docs/starlight-comparison.md +124 -0
  17. package/docs/theme-and-components.md +745 -0
  18. package/docs/upstream/glaze/LICENSE +21 -0
  19. package/docs/upstream/glaze/README.md +156 -0
  20. package/docs/upstream/glaze/docs/api.md +2021 -0
  21. package/docs/upstream/glaze/docs/methodology.md +686 -0
  22. package/docs/upstream/glaze/docs/migration.md +351 -0
  23. package/docs/upstream/glaze/docs/okhst.md +207 -0
  24. package/docs/upstream/manifest.json +18 -0
  25. package/docs/upstream/tasty/LICENSE +21 -0
  26. package/docs/upstream/tasty/README.md +685 -0
  27. package/docs/upstream/tasty/docs/README.md +39 -0
  28. package/docs/upstream/tasty/docs/adoption.md +323 -0
  29. package/docs/upstream/tasty/docs/ai-agents.md +229 -0
  30. package/docs/upstream/tasty/docs/comparison.md +448 -0
  31. package/docs/upstream/tasty/docs/configuration.md +823 -0
  32. package/docs/upstream/tasty/docs/debug.md +335 -0
  33. package/docs/upstream/tasty/docs/design-system.md +455 -0
  34. package/docs/upstream/tasty/docs/dsl.md +1021 -0
  35. package/docs/upstream/tasty/docs/getting-started.md +238 -0
  36. package/docs/upstream/tasty/docs/injector.md +634 -0
  37. package/docs/upstream/tasty/docs/methodology.md +648 -0
  38. package/docs/upstream/tasty/docs/migration-v3.md +285 -0
  39. package/docs/upstream/tasty/docs/pipeline.md +749 -0
  40. package/docs/upstream/tasty/docs/plugins.md +353 -0
  41. package/docs/upstream/tasty/docs/react-api.md +681 -0
  42. package/docs/upstream/tasty/docs/runtime-benchmarks.md +351 -0
  43. package/docs/upstream/tasty/docs/ssr.md +610 -0
  44. package/docs/upstream/tasty/docs/styles.md +677 -0
  45. package/docs/upstream/tasty/docs/tasty-static.md +582 -0
  46. package/package.json +12 -7
@@ -0,0 +1,686 @@
1
+ # Methodology
2
+
3
+ A practical way to design a Glaze palette without fighting dark mode. Start from
4
+ tone relationships, add contrast only where a role needs a readable floor, and
5
+ let `extend()` carry the same decisions across status hues.
6
+
7
+ For the full API surface, see [api.md](api.md). For the Glaze color-model
8
+ overview, see [okhst.md](okhst.md); the derivation lives in the
9
+ [canonical OKHST specification](https://github.com/tenphi/okhst).
10
+
11
+ ## The mental model
12
+
13
+ Glaze palettes work best as one default neutral theme plus a few colored sibling
14
+ themes:
15
+
16
+ * `default` owns the neutral system most components consume: `#surface`,
17
+ `#surface-text`, `#border`, `#disabled-surface`, and so on.
18
+ * Status themes (`success`, `danger`, `warning`, `note`, ...) are created with
19
+ `extend()`. They swap the hue and keep only the inherited tokens that should
20
+ become status-aware.
21
+ * `inherit: false` keeps a token local to the parent theme. Use it for neutral
22
+ ladders, shadows, code colors, overlays, and anything that should not be
23
+ repeated for every status hue.
24
+
25
+ The main simplification is OKHST tone. Dark mode is a single inversion
26
+ (`100 - t`) plus a scheme tone window, so a relative **tone delta** stays
27
+ anchored to its base in every scheme. A token authored as `tone: '-4'` remains
28
+ the same kind of visual step in light and dark. The step is exactly
29
+ contrast-even for neutrals and approximate for chromatic colors; add a
30
+ `contrast` floor when the measured result matters.
31
+
32
+ Use `glaze.color()` instead of a theme when you need one standalone color or
33
+ one base/dependent pair and do not need a named palette. The same tone,
34
+ adaptation, and contrast rules apply; see
35
+ [Standalone color tokens](api.md#standalone-color-tokens).
36
+
37
+ ## Implementation workflow
38
+
39
+ Build in dependency order so every decision has a clear base:
40
+
41
+ 1. Configure the output schemes and application states once.
42
+ 2. Choose the default theme's hue and saturation seed.
43
+ 3. Define root surfaces with absolute tones.
44
+ 4. Add dependent surfaces, text, borders, and icons with tone deltas.
45
+ 5. Add contrast floors only to roles that need measured readability or
46
+ recognizability.
47
+ 6. Choose adaptation per color: `auto`, `fixed`, or `static`.
48
+ 7. Add explicit HC pairs where high contrast should increase separation.
49
+ 8. Mark default-only tokens `inherit: false`, then extend the shared
50
+ definitions into status themes.
51
+ 9. Compose and export the palette in the shape your application consumes.
52
+ 10. Verify complete screens in all emitted scheme variants.
53
+
54
+ The sections below follow this order and build one palette incrementally.
55
+
56
+ ## Authoring decisions
57
+
58
+ Use this order when defining a token:
59
+
60
+ 1. Pick the base it visually belongs to.
61
+ 2. Use an absolute numeric `tone` for independent placement. Use a signed
62
+ **tone delta** (`'+N'` / `'-N'`) for distance from a base: surface ladders,
63
+ soft chips, disabled states, hover ramps, and similar relationships.
64
+ 3. Add `contrast` only when readability or recognizability needs a measured
65
+ floor.
66
+ 4. Prefer APCA presets for content-like colors when perceptual readability is
67
+ the design goal:
68
+ `contrast: { apca: 'content' }` or
69
+ `contrast: { apca: ['content', 'body'] }`.
70
+ 5. Use WCAG numbers or presets when compatibility, policy, or migration
71
+ requires a WCAG ratio:
72
+ `contrast: 4.5`, `contrast: 'AAA'`, or `contrast: { wcag: [4.5, 7] }`.
73
+ 6. Let token names infer APCA roles. Names ending in `text`, `label`, `border`,
74
+ `surface`, `fill`, `bg`, and similar aliases already tell Glaze which side is
75
+ foreground or background. Set `role` only when a name is ambiguous.
76
+ 7. Add high-contrast pairs only where HC should intentionally tighten:
77
+ text/content contrast, border tone, shadow intensity, mix value, or similar.
78
+
79
+ ### Choosing adaptation mode
80
+
81
+ | Mode | Choose it when |
82
+ | ---------------- | --------------------------------------------------------------------------------------------------------------------------- |
83
+ | `auto` (default) | The color should exchange light/dark positions through dark tone inversion. Typical for surfaces, text, borders, and icons. |
84
+ | `fixed` | A brand fill, status banner, or inverse surface should stay on the authored side of the tone scale. |
85
+ | `static` | The exact authored tone and saturation must render in every scheme, without tone-window mapping or dark desaturation. |
86
+
87
+ Dark tone inversion is controlled by `mode`; it is unrelated to `autoFlip`.
88
+ `autoFlip` only allows an overshooting tone delta or an unsuccessful contrast
89
+ direction to reverse around its base.
90
+
91
+ ### Root or dependent?
92
+
93
+ * Use a root color when its tone has meaning on its own: the page surface, a
94
+ fixed brand anchor, or a scheme extreme.
95
+ * Use a dependent color when its purpose exists relative to another token:
96
+ text on a surface, a border around a fill, or a tint of an accent.
97
+ * Setting `base` with an absolute tone is valid when the color needs a contrast
98
+ relationship but not a tone delta. The absolute position is resolved
99
+ independently; `contrast` acts as a safety floor.
100
+
101
+ ## Seed and configure
102
+
103
+ Keep hue decisions named and configure output modes once:
104
+
105
+ ```ts
106
+ import { glaze } from '@tenphi/glaze';
107
+
108
+ const PURPLE_HUE = 280.3;
109
+ const SUCCESS_HUE = 156.9;
110
+ const DANGER_HUE = 23.1;
111
+ const WARNING_HUE = 84.3;
112
+ const NOTE_HUE = 302.3;
113
+
114
+ const SEED_SATURATION = 80;
115
+
116
+ glaze.configure({
117
+ states: { dark: '@dark', highContrast: '@hc' },
118
+ modes: { dark: true, highContrast: true },
119
+ });
120
+ ```
121
+
122
+ Per-color `saturation` is a factor of the theme seed, not an absolute
123
+ saturation. With `SEED_SATURATION = 80`, `saturation: 0.25` means one quarter of
124
+ that seed.
125
+
126
+ ### When dark needs its own chroma
127
+
128
+ Dark schemes get a flat `darkDesaturation` haircut (10% by default), which is
129
+ enough for most palettes. Reach for a second seed only when dark is wrong in a
130
+ way a uniform reduction cannot fix — a hue that reads muddy against dark
131
+ surfaces, or an accent that stays gaudy no matter how much you dial the global
132
+ knob:
133
+
134
+ ```ts
135
+ const primary = glaze({
136
+ hue: PURPLE_HUE,
137
+ saturation: SEED_SATURATION,
138
+ darkHue: PURPLE_HUE - 12, // cooler purple on dark surfaces
139
+ darkSaturation: 62, // calmer than a 10% haircut would give
140
+ });
141
+ ```
142
+
143
+ An explicit `darkSaturation` replaces `darkDesaturation` rather than stacking
144
+ with it, so the number you write is the number you get. Prefer tuning the seed
145
+ over per-color `darkHue` / `darkSaturation`: one seed keeps the palette
146
+ coherent, while scattered per-color dark overrides drift apart as the palette
147
+ grows. Save the per-color form for the one or two tokens that genuinely need it.
148
+
149
+ ## Naming
150
+
151
+ Prefer purpose first and variant last:
152
+
153
+ * Surfaces: `surface`, `surface-2`, `surface-3`.
154
+ * Foregrounds: `surface-text`, `surface-text-soft`, `surface-text-soft-2`.
155
+ * Structure: `border`, `divider`, `outline`, `placeholder`, `focus`.
156
+ * Fills: `accent-surface`, `accent-surface-2`,
157
+ `accent-surface-hover`.
158
+ * Foregrounds on neutral surfaces: `accent-text`, `accent-text-soft`,
159
+ `accent-icon`.
160
+ * Disabled states: `disabled-surface`, `disabled-surface-text`,
161
+ `accent-disabled-surface`, `accent-disabled-surface-text`.
162
+ * Effects: `shadow-sm`, `shadow-md`, `shadow-lg`, `overlay`, `hover`, `tint`.
163
+
164
+ These names are not only readable. They also help APCA role inference pick the
165
+ right polarity. For example, `button-text` is foreground, `input-bg` is a
166
+ surface, and `card-outline` is a border.
167
+
168
+ ## Build the default theme
169
+
170
+ Start with the surface family. It is mostly tone, with small saturation changes
171
+ to keep the ladder visually coherent:
172
+
173
+ ```ts
174
+ const defaultTheme = glaze(PURPLE_HUE, SEED_SATURATION);
175
+
176
+ defaultTheme.colors({
177
+ surface: { tone: 100, saturation: 0.11 },
178
+ 'surface-2': {
179
+ base: 'surface',
180
+ tone: '-2',
181
+ saturation: 0.15,
182
+ inherit: false,
183
+ },
184
+ 'surface-3': {
185
+ base: 'surface',
186
+ tone: '-4',
187
+ saturation: 0.19,
188
+ inherit: false,
189
+ },
190
+ });
191
+ ```
192
+
193
+ Because each tone delta re-anchors to the resolved surface in every scheme,
194
+ these small relative offsets are enough to define the ladder. There is no
195
+ separate dark-mode curve to tune.
196
+
197
+ ### Text and borders
198
+
199
+ Use a hard edge tone for maximum-prominence text, and APCA floors for softer
200
+ content:
201
+
202
+ ```ts
203
+ defaultTheme.colors({
204
+ 'surface-text': {
205
+ base: 'surface',
206
+ tone: 2,
207
+ saturation: 0.475,
208
+ },
209
+ 'surface-text-soft': {
210
+ base: 'surface',
211
+ tone: '-1',
212
+ saturation: 0.375,
213
+ contrast: { apca: ['content', 'body'] },
214
+ inherit: false,
215
+ },
216
+ 'surface-text-soft-2': {
217
+ base: 'surface',
218
+ tone: '-1',
219
+ saturation: 0.24,
220
+ contrast: { apca: ['large', 'content'] },
221
+ inherit: false,
222
+ },
223
+ border: {
224
+ base: 'surface',
225
+ tone: ['-10', '-20'],
226
+ saturation: 0.175,
227
+ inherit: false,
228
+ },
229
+ });
230
+ ```
231
+
232
+ `surface-text` uses an absolute `tone: 2` despite having a base: it is
233
+ intentionally edge-anchored, and the base records the relationship used by
234
+ role inference. The soft variants use a `-1` tone delta as the preferred
235
+ direction and APCA as the readable floor. `border` uses an HC tone-delta pair
236
+ because borders usually need a larger visible step in high contrast.
237
+
238
+ Repeat the same pattern for `surface-2` and `surface-3` only if components need
239
+ text directly on those surfaces.
240
+
241
+ ### Neutral utility tokens
242
+
243
+ Keep neutral-only primitives local to the default theme:
244
+
245
+ ```ts
246
+ defaultTheme.colors({
247
+ placeholder: {
248
+ base: 'surface',
249
+ tone: 67,
250
+ saturation: 0.175,
251
+ inherit: false,
252
+ },
253
+ focus: {
254
+ base: 'surface',
255
+ tone: 71,
256
+ saturation: 0.8625,
257
+ inherit: false,
258
+ },
259
+ disabled: {
260
+ tone: 80.8,
261
+ saturation: 0.4,
262
+ inherit: false,
263
+ },
264
+ });
265
+ ```
266
+
267
+ Absolute tones are fine for primitives whose job is visual placement rather than
268
+ a strict relationship to a specific surface.
269
+
270
+ ## Chips and disabled states
271
+
272
+ For subtle fills, tone is usually clearer than contrast:
273
+
274
+ ```ts
275
+ defaultTheme.colors({
276
+ 'disabled-surface': {
277
+ base: 'surface',
278
+ tone: '-3',
279
+ saturation: 0.2,
280
+ inherit: false,
281
+ },
282
+ 'disabled-surface-text': {
283
+ base: 'disabled-surface',
284
+ tone: '+18',
285
+ saturation: 0.3,
286
+ autoFlip: false,
287
+ inherit: false,
288
+ },
289
+ });
290
+ ```
291
+
292
+ This says exactly what the pair should do: the chip sits a small tone delta off
293
+ the page, and the label sits a muted delta from the chip. `autoFlip: false`
294
+ keeps the label on the authored side when the delta reaches the edge.
295
+
296
+ Use contrast instead when the chip must hit an explicit accessibility floor:
297
+
298
+ ```ts
299
+ defaultTheme.colors({
300
+ 'disabled-surface-text': {
301
+ base: 'disabled-surface',
302
+ tone: '+1',
303
+ saturation: 0.3,
304
+ contrast: { apca: 'non-text' },
305
+ inherit: false,
306
+ },
307
+ });
308
+ ```
309
+
310
+ When a token needs the scheme extreme, use `tone: 'min'` or `tone: 'max'`
311
+ directly. Avoid large magic numbers or fake contrast floors just to push a color
312
+ to the edge.
313
+
314
+ Pair the extreme with a `base` when the gap between the two has to survive the
315
+ scheme switch. Glaze then replays the light-scheme tone shift against the
316
+ resolved dark base instead of re-mapping the extreme through the dark window,
317
+ so a knockout on a surface keeps the same contrast in both schemes.
318
+
319
+ ## Fixed surfaces and accent fills
320
+
321
+ Use `mode: 'fixed'` when the authored color should stay recognizable across
322
+ schemes.
323
+
324
+ ```ts
325
+ defaultTheme.colors({
326
+ 'surface-inverse': {
327
+ tone: 12,
328
+ saturation: 0.475,
329
+ mode: 'fixed',
330
+ inherit: false,
331
+ },
332
+
333
+ 'accent-surface-text': {
334
+ tone: 100,
335
+ mode: 'fixed',
336
+ },
337
+ 'accent-surface': {
338
+ base: 'accent-surface-text',
339
+ tone: '-1',
340
+ contrast: { apca: ['content', 'body'] },
341
+ mode: 'fixed',
342
+ },
343
+ 'accent-surface-2': {
344
+ base: 'accent-surface-text',
345
+ tone: '-1',
346
+ contrast: { apca: [65, 80] },
347
+ mode: 'fixed',
348
+ },
349
+ 'accent-surface-hover': {
350
+ base: 'accent-surface-text',
351
+ tone: '-1',
352
+ contrast: { apca: ['body', 'preferred'] },
353
+ mode: 'fixed',
354
+ },
355
+ });
356
+ ```
357
+
358
+ The accent fill family is a fixed chain against a fixed text anchor. The names
359
+ infer `surface` and `text` roles, so APCA gets the right polarity without extra
360
+ fields.
361
+
362
+ ## Adaptive accent foregrounds
363
+
364
+ Brand foregrounds that sit on neutral surfaces should stay adaptive:
365
+
366
+ ```ts
367
+ defaultTheme.colors({
368
+ 'accent-text': {
369
+ base: 'surface',
370
+ tone: '-1',
371
+ saturation: 1,
372
+ contrast: { apca: ['content', 'body'] },
373
+ },
374
+ 'accent-text-soft': {
375
+ base: 'surface',
376
+ tone: '-1',
377
+ saturation: 1,
378
+ contrast: { apca: ['large', 'content'] },
379
+ },
380
+ 'accent-icon': {
381
+ base: 'surface',
382
+ tone: '-1',
383
+ saturation: 0.9375,
384
+ contrast: { apca: ['non-text', 'large'] },
385
+ },
386
+ });
387
+ ```
388
+
389
+ Anchor these to `surface`, not to `accent-surface`. Their real job is to remain
390
+ readable on neutral UI, so `mode: 'auto'` and a surface base are the right
391
+ defaults.
392
+
393
+ Brand-tinted disabled states can usually be pure tone:
394
+
395
+ ```ts
396
+ defaultTheme.colors({
397
+ 'accent-disabled-surface': {
398
+ base: 'surface',
399
+ tone: '+3',
400
+ saturation: 0.5,
401
+ },
402
+ 'accent-disabled-surface-text': {
403
+ base: 'accent-disabled-surface',
404
+ tone: '+18',
405
+ saturation: 0.4,
406
+ autoFlip: false,
407
+ },
408
+ });
409
+ ```
410
+
411
+ These are inherited, so status themes automatically get
412
+ `success-accent-disabled-surface`, `danger-accent-disabled-surface`, and the
413
+ matching text tokens.
414
+
415
+ ## Special-purpose colors
416
+
417
+ Use absolute `hue` overrides for tokens that should come from another hue family
418
+ but keep the same adaptation behavior:
419
+
420
+ ```ts
421
+ defaultTheme.colors({
422
+ 'code-comment': {
423
+ base: 'surface',
424
+ hue: 280,
425
+ saturation: 0.1,
426
+ tone: '-1',
427
+ contrast: { apca: ['large', 'content'] },
428
+ inherit: false,
429
+ },
430
+ 'code-keyword': {
431
+ base: 'surface',
432
+ hue: 348,
433
+ saturation: 1,
434
+ tone: '-1',
435
+ contrast: { apca: ['content', 'body'] },
436
+ inherit: false,
437
+ },
438
+ 'code-string': {
439
+ base: 'surface',
440
+ hue: SUCCESS_HUE,
441
+ saturation: 1,
442
+ tone: '-1',
443
+ contrast: { apca: ['large', 'content'] },
444
+ inherit: false,
445
+ },
446
+ });
447
+ ```
448
+
449
+ Use small tone ramps for decorative motion:
450
+
451
+ ```ts
452
+ defaultTheme.colors({
453
+ 'loading-face-1': {
454
+ base: 'surface',
455
+ tone: 98,
456
+ saturation: 0.3,
457
+ inherit: false,
458
+ },
459
+ 'loading-face-2': {
460
+ base: 'surface',
461
+ tone: 91,
462
+ saturation: 0.62,
463
+ inherit: false,
464
+ },
465
+ 'loading-face-3': {
466
+ base: 'surface',
467
+ tone: 79,
468
+ saturation: 0.66,
469
+ inherit: false,
470
+ },
471
+ });
472
+ ```
473
+
474
+ Since tone steps now invert consistently across schemes, the same ramp keeps its
475
+ spacing in light and dark without involving the contrast solver. Use an HC tone
476
+ pair only when the animation should become more pronounced in high contrast.
477
+
478
+ ## Effects
479
+
480
+ Define one neutral shadow system:
481
+
482
+ ```ts
483
+ defaultTheme.colors({
484
+ 'shadow-sm': {
485
+ type: 'shadow',
486
+ bg: 'surface',
487
+ fg: 'surface-text',
488
+ intensity: 5,
489
+ inherit: false,
490
+ },
491
+ 'shadow-md': {
492
+ type: 'shadow',
493
+ bg: 'surface',
494
+ fg: 'surface-text',
495
+ intensity: [10, 20],
496
+ inherit: false,
497
+ },
498
+ 'shadow-lg': {
499
+ type: 'shadow',
500
+ bg: 'surface',
501
+ fg: 'surface-text',
502
+ intensity: [15, 30],
503
+ inherit: false,
504
+ },
505
+ });
506
+ ```
507
+
508
+ Including `fg` lets shadow strength follow the resolved foreground/background
509
+ gap. Use an HC pair for shadows that should deepen in high contrast.
510
+
511
+ Use `opacity` for one fixed-alpha color:
512
+
513
+ ```ts
514
+ defaultTheme.colors({
515
+ overlay: { tone: 10, opacity: 0.5, inherit: false },
516
+ });
517
+ ```
518
+
519
+ Use mixes when one color should tint through another:
520
+
521
+ ```ts
522
+ defaultTheme.colors({
523
+ hover: {
524
+ type: 'mix',
525
+ base: 'surface',
526
+ target: 'accent-surface',
527
+ value: 8,
528
+ blend: 'transparent',
529
+ },
530
+ tint: {
531
+ type: 'mix',
532
+ base: 'surface',
533
+ target: 'accent-surface',
534
+ value: 20,
535
+ },
536
+ });
537
+ ```
538
+
539
+ Transparent mixes are good for hover overlays. Opaque mixes are good for solid
540
+ tints. Opaque mixes default to perceptual OKHSL interpolation; choose `srgb`
541
+ when matching channel compositing matters. Transparent mixes always composite
542
+ in linear sRGB. Mix colors can also use `contrast`; the solver adjusts the
543
+ value or opacity to hit the floor. See [Mix colors](api.md#mix-colors).
544
+
545
+ ## Extend into status themes
546
+
547
+ Once the default theme is shaped, create colored siblings by replacing hue and
548
+ overriding only the root surface that should become visibly tinted:
549
+
550
+ ```ts
551
+ const TINTED_SURFACE_OVERRIDE = {
552
+ surface: { tone: 96, saturation: 0.8 },
553
+ };
554
+
555
+ const primaryTheme = defaultTheme.extend({
556
+ colors: TINTED_SURFACE_OVERRIDE,
557
+ });
558
+ const successTheme = defaultTheme.extend({
559
+ hue: SUCCESS_HUE,
560
+ colors: TINTED_SURFACE_OVERRIDE,
561
+ });
562
+ const dangerTheme = defaultTheme.extend({
563
+ hue: DANGER_HUE,
564
+ colors: TINTED_SURFACE_OVERRIDE,
565
+ });
566
+ const warningTheme = defaultTheme.extend({
567
+ hue: WARNING_HUE,
568
+ colors: TINTED_SURFACE_OVERRIDE,
569
+ });
570
+ const noteTheme = defaultTheme.extend({
571
+ hue: NOTE_HUE,
572
+ colors: TINTED_SURFACE_OVERRIDE,
573
+ });
574
+ ```
575
+
576
+ The inherited accent and disabled tokens now resolve in each status hue. Tokens
577
+ marked `inherit: false` stay default-only, so sibling themes remain small.
578
+
579
+ ## Export the palette
580
+
581
+ Compose the themes once:
582
+
583
+ ```ts
584
+ const palette = glaze.palette({
585
+ default: defaultTheme,
586
+ primary: primaryTheme,
587
+ success: successTheme,
588
+ danger: dangerTheme,
589
+ warning: warningTheme,
590
+ note: noteTheme,
591
+ });
592
+ ```
593
+
594
+ The usual export shape is default unprefixed and status themes prefixed:
595
+
596
+ ```ts
597
+ const prefix = {
598
+ default: '',
599
+ primary: 'primary-',
600
+ success: 'success-',
601
+ danger: 'danger-',
602
+ warning: 'warning-',
603
+ note: 'note-',
604
+ };
605
+
606
+ palette.tasty({ prefix });
607
+ ```
608
+
609
+ An explicit prefix map is the clearest choice when the palette has a neutral
610
+ `default` theme. The separate palette `primary` option serves another pattern:
611
+ it duplicates one named theme without a prefix while retaining its prefixed
612
+ tokens. Do not combine the two accidentally; choose the token namespace your
613
+ components expect.
614
+
615
+ The palette design is independent of the exporter:
616
+
617
+ ```ts
618
+ palette.tokens({ prefix }); // JavaScript maps, native oklch by default
619
+ palette.css({ prefix }); // CSS custom-property declarations
620
+ palette.dtcg({ prefix }); // one design-token tree per scheme
621
+ palette.tailwind({ prefix }); // Tailwind CSS v4 theme
622
+ ```
623
+
624
+ Use `palette.tasty({ prefix })` for [Tasty](../../tasty/README.md) state bindings. See
625
+ [migration.md](migration.md#choosing-an-export) for output shapes, application
626
+ wiring, and the `primary` alias pattern.
627
+
628
+ ## High contrast
629
+
630
+ High contrast is not a separate palette. Any value that accepts an HC pair can
631
+ tighten the HC variant: `tone`, `contrast`, shadow `intensity`, and mix `value`.
632
+
633
+ Use HC pairs where users should actually get more separation:
634
+
635
+ * Text/content contrast: `{ apca: ['content', 'body'] }`.
636
+ * Accent fills: `{ apca: ['content', 'body'] }` or stronger.
637
+ * Borders: `tone: ['-10', '-20']`.
638
+ * Shadows: `intensity: [10, 20]`.
639
+ * Decorative ramps that must stay perceivable.
640
+
641
+ In HC variants, Glaze bypasses the normal tone window and uses the full
642
+ `[0, 100]` range. Edge tones can reach the edge; contrast floors have more room
643
+ to solve.
644
+
645
+ ### A slider through the tier
646
+
647
+ The two-tier model assumes contrast is a binary OS preference. When contrast is
648
+ instead a setting *your users* control, set
649
+ [`contrastLevel`](api.md#manual-contrast-level) to a number and your **normal**
650
+ palette slides along a `0–100` ramp: level `0` is the palette you authored, `100`
651
+ is the HC palette you authored, and everything between is resolved at that level.
652
+
653
+ The authoring work is the same — the HC pairs above are what the slider ramps
654
+ toward, so a palette tuned for high contrast needs no new fields. Two things
655
+ worth planning for:
656
+
657
+ * The slider and the tier compose. The HC tier keeps resolving at full contrast
658
+ regardless of the level, so wire the level into your build or runtime *and*
659
+ keep your `prefers-contrast: more` block: a user who has raised the slider and
660
+ asked their OS for more contrast still gets the escalation on top. The one
661
+ exception is level `100`, where the two coincide and the tier is dropped as a
662
+ duplicate.
663
+ * `contrastLevel: 0` is the natural rest position for a slider you ship but
664
+ default off — it reproduces the `'auto'` output bit for bit.
665
+
666
+ ## Checklist
667
+
668
+ Before shipping a palette, verify:
669
+
670
+ * Text, icon, and content tokens either have APCA/WCAG contrast or are
671
+ deliberately edge-anchored.
672
+ * Accent fills use `mode: 'fixed'`; accent foregrounds on neutral UI stay
673
+ `mode: 'auto'` and are based on `surface`.
674
+ * Ambiguous APCA tokens have an explicit `role`; obvious names rely on inference.
675
+ * Low-stakes visual relationships use tone deltas instead of fake contrast
676
+ floors.
677
+ * `inherit: false` is set on default-only tokens so status themes stay focused.
678
+ * HC pairs exist where high contrast should visibly tighten (they double as the
679
+ ramp for a manual `contrastLevel`).
680
+ * `glaze.configure({ states, modes })` matches the states registered in the app.
681
+ * Every emitted scheme (`light`, `dark`, `lightContrast`, `darkContrast`) has
682
+ been reviewed on complete screens, not only in a token grid.
683
+ * Rendered WCAG/APCA results have been checked for chromatic foreground/base
684
+ pairs that carry accessibility requirements.
685
+ * Resolution emits no unexplained unreachable-contrast or token-collision
686
+ warnings.