@eluan/tokens 0.5.0 → 0.6.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.
package/dist/modes.css CHANGED
@@ -2,6 +2,28 @@
2
2
  * LAYER 2: Modes
3
3
  * Semantic color tokens that adapt to Light, Dim, and Dark modes
4
4
  * These reference primitive tokens from Layer 1
5
+ *
6
+ * Each mode places the same five surfaces and five text levels on the
7
+ * theme's grey ramp (--color-neutral-*, set in themes.css):
8
+ *
9
+ * backgrounds primary the surface: cards, fields, raised controls
10
+ * secondary the ground the page is made of
11
+ * tertiary hairline fills: wells, hover, the selected nav
12
+ * item (in dark: the raised control)
13
+ * quaternary a stronger fill
14
+ * quinary the strongest fill
15
+ * foregrounds primary ink
16
+ * secondary secondary text
17
+ * tertiary muted text; still meets 4.5:1 on the surface
18
+ * quaternary captions and icons; 3:1, not for body text
19
+ * quinary disabled
20
+ * borders primary the hairline around flat surfaces
21
+ * secondary the border of a field
22
+ *
23
+ * In light the surface is white and the ground is paper, a step darker. In
24
+ * dark the ground is the darkest step and surfaces rise from it. Dim is
25
+ * light, a step down: it mixes neighbouring steps of the same ramp, so it
26
+ * keeps the theme's own tint instead of bringing a colour of its own.
5
27
  * ============================================ */
6
28
 
7
29
  /* ----------------------------------------
@@ -12,15 +34,22 @@
12
34
  [data-mode="Light"],
13
35
  [data-mode="light"] {
14
36
  --backgrounds-primary: var(--color-neutral-0);
15
- --backgrounds-secondary: var(--color-neutral-100);
16
- --backgrounds-tertiary: var(--color-neutral-200);
17
- --backgrounds-quaternary: var(--color-neutral-300);
18
- --backgrounds-quinary: var(--color-neutral-400);
19
- --foregrounds-primary: var(--color-neutral-950);
20
- --foregrounds-secondary: var(--color-neutral-800);
21
- --foregrounds-tertiary: var(--color-neutral-600);
22
- --foregrounds-quaternary: var(--color-neutral-500);
37
+ --backgrounds-secondary: var(--color-neutral-50);
38
+ --backgrounds-tertiary: var(--color-neutral-100);
39
+ --backgrounds-quaternary: var(--color-neutral-200);
40
+ --backgrounds-quinary: var(--color-neutral-300);
41
+ --foregrounds-primary: var(--color-neutral-800);
42
+ --foregrounds-secondary: var(--color-neutral-700);
43
+ /* Muted text and captions sit between steps, a third of the way to the next
44
+ * one down. Muted text then clears 4.5:1, and captions 3:1, on the white
45
+ * surface and on the paper ground, with room to spare whatever hue a theme
46
+ * tints its greys. @eluan/theme-generator checks contrast against these
47
+ * same mixes (semanticMap.ts), so keep the two in step. */
48
+ --foregrounds-tertiary: color-mix(in oklch, var(--color-neutral-600) 65%, var(--color-neutral-700));
49
+ --foregrounds-quaternary: color-mix(in oklch, var(--color-neutral-500) 65%, var(--color-neutral-600));
23
50
  --foregrounds-quinary: var(--color-neutral-400);
51
+ --borders-primary: var(--color-neutral-100);
52
+ --borders-secondary: var(--color-neutral-200);
24
53
  /* Tooltip surface — mode-aware because the tooltip loses its border in dark
25
54
  * mode, where the background and --container-border are the same value.
26
55
  * Declared here rather than in themes.css: theme tokens are mode-agnostic
@@ -31,7 +60,24 @@
31
60
  * the same reason as --tooltip-bg. It must stay dark in every mode: the
32
61
  * --container-fg it used to borrow is near-white in dark mode, which washed
33
62
  * the page out behind a dark dialog. */
34
- --overlay-bg: var(--foregrounds-primary);
63
+ --overlay-bg: var(--color-neutral-950);
64
+ /* Elevation. Shadows are cast in the theme's own darkest neutral, so a
65
+ * generated theme's tint carries into them; nothing here names a hue. */
66
+ --elevation-shade: var(--foregrounds-primary);
67
+ --elevation-ring: color-mix(in oklch, var(--elevation-shade) 8%, transparent);
68
+ --elevation-ring-strong: color-mix(in oklch, var(--elevation-shade) 13%, transparent);
69
+ --elevation-key: color-mix(in oklch, var(--elevation-shade) 7%, transparent);
70
+ --elevation-ambient: color-mix(in oklch, var(--elevation-shade) 5%, transparent);
71
+ --elevation-highlight: transparent;
72
+ /* Controls sit closer to the eye than panels, so their shadows are a touch
73
+ * stronger: a contact shadow, a soft drop, and the inset shade of a well. */
74
+ --elevation-control-key: color-mix(in oklch, var(--elevation-shade) 10%, transparent);
75
+ --elevation-control-ambient: color-mix(in oklch, var(--elevation-shade) 7%, transparent);
76
+ --elevation-thumb-key: color-mix(in oklch, var(--elevation-shade) 24%, transparent);
77
+ --elevation-thumb-ambient: color-mix(in oklch, var(--elevation-shade) 13%, transparent);
78
+ --elevation-well-shade: color-mix(in oklch, var(--elevation-shade) 10%, transparent);
79
+ --elevation-well-ring: transparent;
80
+ --elevation-field-shade: color-mix(in oklch, var(--elevation-shade) 6%, transparent);
35
81
  /* Keyboard focus outline — mode-aware for the same reason as --tooltip-bg.
36
82
  * The mid-ramp step that clears 3:1 (WCAG 1.4.11) on every page and panel
37
83
  * ground while staying distinct from the near-black pressed fill
@@ -40,8 +86,8 @@
40
86
  /* Outline and Ghost button text (and Toast cancel) — mode-aware for the
41
87
  * same reason as --tooltip-bg: dim needs a deeper step than
42
88
  * --mono-background gives it. */
43
- --action-secondary-fg: var(--mono-background);
44
- --action-tertiary-fg: var(--mono-background);
89
+ --action-secondary-fg: var(--foregrounds-primary);
90
+ --action-tertiary-fg: var(--foregrounds-primary);
45
91
  --maitai-main: var(--color-maitai-500);
46
92
  --maitai-background: var(--color-maitai-50);
47
93
  --maitai-tint: var(--color-maitai-100);
@@ -139,24 +185,40 @@
139
185
  }
140
186
 
141
187
  [data-mode="Dim"], [data-mode="dim"] {
142
- --backgrounds-primary: var(--color-teak-100);
143
- --backgrounds-secondary: var(--color-teak-200);
144
- --backgrounds-tertiary: var(--color-teak-300);
145
- --backgrounds-quaternary: var(--color-teak-400);
146
- --backgrounds-quinary: var(--color-teak-500);
147
- --foregrounds-primary: var(--color-teak-950);
148
- --foregrounds-secondary: var(--color-teak-900);
149
- --foregrounds-tertiary: var(--color-teak-800);
150
- --foregrounds-quaternary: var(--color-teak-700);
151
- --foregrounds-quinary: var(--color-teak-600);
188
+ /* Light, a step down, on the theme's own ramp. */
189
+ --backgrounds-primary: color-mix(in oklch, var(--color-neutral-50), var(--color-neutral-100));
190
+ --backgrounds-secondary: color-mix(in oklch, var(--color-neutral-100) 60%, var(--color-neutral-200));
191
+ --backgrounds-tertiary: color-mix(in oklch, var(--color-neutral-100) 25%, var(--color-neutral-200));
192
+ --backgrounds-quaternary: color-mix(in oklch, var(--color-neutral-200), var(--color-neutral-300));
193
+ --backgrounds-quinary: var(--color-neutral-400);
194
+ --foregrounds-primary: var(--color-neutral-900);
195
+ --foregrounds-secondary: var(--color-neutral-800);
196
+ --foregrounds-tertiary: var(--color-neutral-700);
197
+ --foregrounds-quaternary: var(--color-neutral-600);
198
+ --borders-primary: var(--backgrounds-tertiary);
199
+ --borders-secondary: var(--backgrounds-quaternary);
200
+ /* Elevation: as in light mode. */
201
+ --elevation-shade: var(--foregrounds-primary);
202
+ --elevation-ring: color-mix(in oklch, var(--elevation-shade) 8%, transparent);
203
+ --elevation-ring-strong: color-mix(in oklch, var(--elevation-shade) 13%, transparent);
204
+ --elevation-key: color-mix(in oklch, var(--elevation-shade) 7%, transparent);
205
+ --elevation-ambient: color-mix(in oklch, var(--elevation-shade) 5%, transparent);
206
+ --elevation-highlight: transparent;
207
+ /* Controls sit closer to the eye than panels, so their shadows are a touch
208
+ * stronger: a contact shadow, a soft drop, and the inset shade of a well. */
209
+ --elevation-control-key: color-mix(in oklch, var(--elevation-shade) 10%, transparent);
210
+ --elevation-control-ambient: color-mix(in oklch, var(--elevation-shade) 7%, transparent);
211
+ --elevation-thumb-key: color-mix(in oklch, var(--elevation-shade) 24%, transparent);
212
+ --elevation-thumb-ambient: color-mix(in oklch, var(--elevation-shade) 13%, transparent);
213
+ --elevation-well-shade: color-mix(in oklch, var(--elevation-shade) 10%, transparent);
214
+ --elevation-well-ring: transparent;
215
+ --elevation-field-shade: color-mix(in oklch, var(--elevation-shade) 6%, transparent);
216
+ --foregrounds-quinary: var(--color-neutral-500);
152
217
  --tooltip-bg: var(--backgrounds-primary);
153
- --overlay-bg: var(--foregrounds-primary);
218
+ --overlay-bg: var(--color-neutral-950);
154
219
  --focus-ring: var(--foregrounds-quaternary);
155
- /* teak-700 (--mono-background) is 4.36:1 on the dim panel ground, below AA
156
- * for Outline and Ghost button text; teak-800 clears 6:1 on the page and
157
- * panel. */
158
- --action-secondary-fg: var(--foregrounds-tertiary);
159
- --action-tertiary-fg: var(--foregrounds-tertiary);
220
+ --action-secondary-fg: var(--foregrounds-primary);
221
+ --action-tertiary-fg: var(--foregrounds-primary);
160
222
  --maitai-main: var(--color-maitai-600);
161
223
  --maitai-background: var(--color-maitai-100);
162
224
  --maitai-tint: var(--color-maitai-200);
@@ -237,10 +299,10 @@
237
299
  --electriclime-tint: var(--color-electriclime-200);
238
300
  --electriclime-foreground: var(--color-electriclime-700);
239
301
  --electriclime-shade: var(--color-electriclime-900);
240
- --mono-background: var(--color-teak-700);
241
- --mono-tint: var(--color-teak-100);
242
- --mono-foreground: var(--color-teak-50);
243
- --mono-shade: var(--color-teak-800);
302
+ --mono-background: var(--color-mono-900);
303
+ --mono-tint: var(--color-mono-200);
304
+ --mono-foreground: var(--color-mono-50);
305
+ --mono-shade: var(--color-mono-700);
244
306
  --torchred-main: var(--color-torchred-700);
245
307
  --torchred-background: var(--color-torchred-100);
246
308
  --torchred-tint: var(--color-torchred-200);
@@ -254,105 +316,128 @@
254
316
  }
255
317
 
256
318
  [data-mode="Dark"], [data-mode="dark"] {
257
- --backgrounds-primary: var(--color-neutral-800);
258
- --backgrounds-secondary: var(--color-neutral-900);
259
- --backgrounds-tertiary: var(--color-neutral-950);
319
+ /* The ground is the darkest step; cards rise one step from it and raised
320
+ * controls two. */
321
+ --backgrounds-primary: var(--color-neutral-900);
322
+ --backgrounds-secondary: var(--color-neutral-950);
323
+ --backgrounds-tertiary: var(--color-neutral-800);
260
324
  --backgrounds-quaternary: var(--color-neutral-700);
261
325
  --backgrounds-quinary: var(--color-neutral-600);
262
- --foregrounds-primary: var(--color-neutral-0);
263
- --foregrounds-secondary: var(--color-neutral-100);
264
- --foregrounds-tertiary: var(--color-neutral-200);
265
- --foregrounds-quaternary: var(--color-neutral-300);
266
- --foregrounds-quinary: var(--color-neutral-400);
267
- /* Same value as --container-border, so the tooltip border disappears. */
326
+ --foregrounds-primary: var(--color-neutral-100);
327
+ --foregrounds-secondary: var(--color-neutral-300);
328
+ --foregrounds-tertiary: var(--color-neutral-400);
329
+ --foregrounds-quaternary: var(--color-neutral-500);
330
+ --foregrounds-quinary: var(--color-neutral-600);
331
+ /* Hairlines sit between the card and the raised control, so they hold on
332
+ * both; a field's border is a step stronger again. */
333
+ --borders-primary: color-mix(in oklch, var(--color-neutral-900), var(--color-neutral-800));
334
+ --borders-secondary: color-mix(in oklch, var(--color-neutral-800), var(--color-neutral-700));
335
+ /* A tooltip is a raised surface. */
268
336
  --tooltip-bg: var(--backgrounds-tertiary);
269
- /* The darkest step of the ramp, so the scrim dims the page rather than
270
- * lifting it. */
271
- --overlay-bg: var(--backgrounds-tertiary);
337
+ /* Near black, so the scrim dims the page rather than lifting it. */
338
+ --overlay-bg: color-mix(in oklch, var(--color-neutral-950) 40%, black);
339
+ /* Elevation. A shadow barely reads on a dark page, so depth comes from a
340
+ * hairline in the foreground colour and a faint light on the top edge, over
341
+ * a deeper shadow in the ramp's darkest step. */
342
+ --elevation-shade: color-mix(in oklch, var(--color-neutral-950) 30%, black);
343
+ --elevation-ring: color-mix(in oklch, var(--foregrounds-primary) 9%, transparent);
344
+ --elevation-ring-strong: color-mix(in oklch, var(--foregrounds-primary) 14%, transparent);
345
+ --elevation-key: color-mix(in oklch, var(--elevation-shade) 45%, transparent);
346
+ --elevation-ambient: color-mix(in oklch, var(--elevation-shade) 30%, transparent);
347
+ --elevation-highlight: color-mix(in oklch, var(--foregrounds-primary) 8%, transparent);
348
+ /* On a dark ground a shadow only reads if it is near black, and a well has
349
+ * to be clearly darker than the page it is cut into. */
350
+ --elevation-control-key: color-mix(in oklch, black 40%, transparent);
351
+ --elevation-control-ambient: color-mix(in oklch, black 25%, transparent);
352
+ --elevation-thumb-key: color-mix(in oklch, black 50%, transparent);
353
+ --elevation-thumb-ambient: color-mix(in oklch, black 30%, transparent);
354
+ --elevation-well-shade: color-mix(in oklch, black 45%, transparent);
355
+ --elevation-well-ring: var(--elevation-ring);
356
+ --elevation-field-shade: color-mix(in oklch, black 45%, transparent);
272
357
  /* One step lighter than in light mode: --foregrounds-quaternary is too
273
358
  * close to the white pressed fill here, quinary still clears 3:1. */
274
359
  --focus-ring: var(--foregrounds-quinary);
275
- --action-secondary-fg: var(--mono-background);
276
- --action-tertiary-fg: var(--mono-background);
360
+ --action-secondary-fg: var(--foregrounds-primary);
361
+ --action-tertiary-fg: var(--foregrounds-primary);
277
362
  --maitai-main: var(--color-maitai-500);
278
363
  --maitai-background: var(--color-maitai-950);
279
364
  --maitai-tint: var(--color-maitai-900);
280
- --maitai-foreground: var(--color-maitai-50);
365
+ --maitai-foreground: var(--color-maitai-200);
281
366
  --maitai-shade: var(--color-maitai-300);
282
367
  --rockspray-main: var(--color-rockspray-500);
283
368
  --rockspray-background: var(--color-rockspray-950);
284
369
  --rockspray-tint: var(--color-rockspray-900);
285
- --rockspray-foreground: var(--color-rockspray-50);
370
+ --rockspray-foreground: var(--color-rockspray-200);
286
371
  --rockspray-shade: var(--color-rockspray-100);
287
372
  --crimson-main: var(--color-crimson-500);
288
373
  --crimson-background: var(--color-crimson-950);
289
374
  --crimson-tint: var(--color-crimson-900);
290
- --crimson-foreground: var(--color-crimson-50);
375
+ --crimson-foreground: var(--color-crimson-200);
291
376
  --crimson-shade: var(--color-crimson-100);
292
377
  --cerise-main: var(--color-cerise-500);
293
378
  --cerise-background: var(--color-cerise-950);
294
379
  --cerise-tint: var(--color-cerise-900);
295
- --cerise-foreground: var(--color-cerise-50);
380
+ --cerise-foreground: var(--color-cerise-200);
296
381
  --cerise-shade: var(--color-cerise-100);
297
382
  --redviolet-main: var(--color-redviolet-500);
298
383
  --redviolet-background: var(--color-redviolet-950);
299
384
  --redviolet-tint: var(--color-redviolet-900);
300
- --redviolet-foreground: var(--color-redviolet-50);
385
+ --redviolet-foreground: var(--color-redviolet-200);
301
386
  --redviolet-shade: var(--color-redviolet-100);
302
387
  --violeteggplant-main: var(--color-violeteggplant-500);
303
388
  --violeteggplant-background: var(--color-violeteggplant-950);
304
389
  --violeteggplant-tint: var(--color-violeteggplant-900);
305
- --violeteggplant-foreground: var(--color-violeteggplant-50);
390
+ --violeteggplant-foreground: var(--color-violeteggplant-200);
306
391
  --violeteggplant-shade: var(--color-violeteggplant-100);
307
392
  --electricviolet-main: var(--color-electricviolet-400);
308
393
  --electricviolet-background: var(--color-electricviolet-950);
309
394
  --electricviolet-tint: var(--color-electricviolet-900);
310
- --electricviolet-foreground: var(--color-electricviolet-50);
395
+ --electricviolet-foreground: var(--color-electricviolet-200);
311
396
  --electricviolet-shade: var(--color-electricviolet-100);
312
397
  --purpleheart-main: var(--color-purpleheart-500);
313
398
  --purpleheart-background: var(--color-purpleheart-950);
314
399
  --purpleheart-tint: var(--color-purpleheart-900);
315
- --purpleheart-foreground: var(--color-purpleheart-50);
400
+ --purpleheart-foreground: var(--color-purpleheart-200);
316
401
  --purpleheart-shade: var(--color-purpleheart-100);
317
402
  --blueribbon-main: var(--color-blueribbon-500);
318
403
  --blueribbon-background: var(--color-blueribbon-950);
319
404
  --blueribbon-tint: var(--color-blueribbon-900);
320
- --blueribbon-foreground: var(--color-blueribbon-50);
405
+ --blueribbon-foreground: var(--color-blueribbon-200);
321
406
  --blueribbon-shade: var(--color-blueribbon-100);
322
407
  --lochmara-main: var(--color-lochmara-500);
323
408
  --lochmara-background: var(--color-lochmara-950);
324
409
  --lochmara-tint: var(--color-lochmara-900);
325
- --lochmara-foreground: var(--color-lochmara-50);
410
+ --lochmara-foreground: var(--color-lochmara-200);
326
411
  --lochmara-shade: var(--color-lochmara-100);
327
412
  --bostonblue-main: var(--color-bostonblue-500);
328
413
  --bostonblue-background: var(--color-bostonblue-950);
329
414
  --bostonblue-tint: var(--color-bostonblue-900);
330
- --bostonblue-foreground: var(--color-bostonblue-50);
415
+ --bostonblue-foreground: var(--color-bostonblue-200);
331
416
  --bostonblue-shade: var(--color-bostonblue-100);
332
417
  --bluechill-main: var(--color-bluechill-400);
333
418
  --bluechill-background: var(--color-bluechill-950);
334
419
  --bluechill-tint: var(--color-bluechill-900);
335
- --bluechill-foreground: var(--color-bluechill-50);
420
+ --bluechill-foreground: var(--color-bluechill-200);
336
421
  --bluechill-shade: var(--color-bluechill-100);
337
422
  --gossamer-main: var(--color-gossamer-400);
338
423
  --gossamer-background: var(--color-gossamer-950);
339
424
  --gossamer-tint: var(--color-gossamer-900);
340
- --gossamer-foreground: var(--color-gossamer-50);
425
+ --gossamer-foreground: var(--color-gossamer-200);
341
426
  --gossamer-shade: var(--color-gossamer-100);
342
427
  --seagreen-main: var(--color-seagreen-400);
343
428
  --seagreen-background: var(--color-seagreen-950);
344
429
  --seagreen-tint: var(--color-seagreen-900);
345
- --seagreen-foreground: var(--color-seagreen-50);
430
+ --seagreen-foreground: var(--color-seagreen-200);
346
431
  --seagreen-shade: var(--color-seagreen-100);
347
432
  --forestgreen-main: var(--color-seagreen-400);
348
433
  --forestgreen-background: var(--color-seagreen-950);
349
434
  --forestgreen-tint: var(--color-seagreen-900);
350
- --forestgreen-foreground: var(--color-seagreen-50);
435
+ --forestgreen-foreground: var(--color-seagreen-200);
351
436
  --forestgreen-shade: var(--color-seagreen-100);
352
437
  --electriclime-main: var(--color-electriclime-400);
353
438
  --electriclime-background: var(--color-electriclime-950);
354
439
  --electriclime-tint: var(--color-electriclime-900);
355
- --electriclime-foreground: var(--color-electriclime-50);
440
+ --electriclime-foreground: var(--color-electriclime-200);
356
441
  --electriclime-shade: var(--color-electriclime-100);
357
442
  --mono-background: var(--color-mono-50);
358
443
  --mono-tint: var(--color-mono-700);
@@ -361,11 +446,77 @@
361
446
  --torchred-main: var(--color-torchred-400);
362
447
  --torchred-background: var(--color-torchred-950);
363
448
  --torchred-tint: var(--color-torchred-900);
364
- --torchred-foreground: var(--color-torchred-50);
449
+ --torchred-foreground: var(--color-torchred-200);
365
450
  --torchred-shade: var(--color-torchred-200);
366
451
  --blazeorange-main: var(--color-blazeorange-500);
367
452
  --blazeorange-background: var(--color-blazeorange-950);
368
453
  --blazeorange-tint: var(--color-blazeorange-900);
369
- --blazeorange-foreground: var(--color-blazeorange-50);
454
+ --blazeorange-foreground: var(--color-blazeorange-200);
370
455
  --blazeorange-shade: var(--color-blazeorange-100);
371
456
  }
457
+
458
+ /* ============================================
459
+ * Elevation levels
460
+ * One light, from above. Each level is a hairline ring (the edge), a tight
461
+ * shadow under the surface (contact) and wider, softer ones as it lifts.
462
+ * Blur grows faster than offset and every layer pulls in with a negative
463
+ * spread, so the shadows stay soft at the edges instead of drawing a line.
464
+ *
465
+ * 1 a panel or card on the page
466
+ * 2 a card inside a panel
467
+ * 3 a card inside a card; menus and popovers
468
+ * 4 dialogs, sheets and anything over a scrim
469
+ *
470
+ * control a raised control: buttons, select triggers, the selected
471
+ * segment. A ring, a contact shadow and a soft drop.
472
+ * control-solid the same on a filled control, with a light on its top edge
473
+ * thumb the knob of a switch or slider: small, so a tighter drop
474
+ * well a sunken track: segmented control, slider, switch
475
+ * field a sunken field you type into: lighter than a well, because
476
+ * the field keeps its border
477
+ *
478
+ * Declared on [data-mode] so each level resolves against that scope's own
479
+ * mode and theme, including a theme scoped to part of the page.
480
+ * ============================================ */
481
+ [data-mode] {
482
+ --elevation-1:
483
+ 0 0 0 1px var(--elevation-ring),
484
+ inset 0 1px 0 var(--elevation-highlight),
485
+ 0 1px 2px -1px var(--elevation-key),
486
+ 0 2px 6px -2px var(--elevation-ambient);
487
+ --elevation-2:
488
+ 0 0 0 1px var(--elevation-ring),
489
+ inset 0 1px 0 var(--elevation-highlight),
490
+ 0 1px 2px -1px var(--elevation-key),
491
+ 0 4px 8px -3px var(--elevation-key),
492
+ 0 12px 24px -8px var(--elevation-ambient);
493
+ --elevation-3:
494
+ 0 0 0 1px var(--elevation-ring),
495
+ inset 0 1px 0 var(--elevation-highlight),
496
+ 0 2px 4px -2px var(--elevation-key),
497
+ 0 8px 16px -6px var(--elevation-key),
498
+ 0 24px 40px -12px var(--elevation-key);
499
+ --elevation-4:
500
+ 0 0 0 1px var(--elevation-ring),
501
+ inset 0 1px 0 var(--elevation-highlight),
502
+ 0 4px 8px -4px var(--elevation-key),
503
+ 0 16px 32px -10px var(--elevation-key),
504
+ 0 40px 72px -20px color-mix(in oklch, var(--elevation-shade) 14%, transparent);
505
+ --elevation-control:
506
+ 0 0 0 1px var(--elevation-ring),
507
+ inset 0 1px 0 var(--elevation-highlight),
508
+ 0 1px 2px var(--elevation-control-key),
509
+ 0 4px 10px var(--elevation-control-ambient);
510
+ --elevation-control-solid:
511
+ inset 0 1px 0 color-mix(in oklch, white 22%, transparent),
512
+ 0 1px 2px var(--elevation-control-key),
513
+ 0 4px 10px var(--elevation-control-ambient);
514
+ --elevation-thumb:
515
+ 0 0 0 1px var(--elevation-ring),
516
+ 0 1px 2px var(--elevation-thumb-key),
517
+ 0 3px 6px var(--elevation-thumb-ambient);
518
+ --elevation-well:
519
+ inset 0 0 0 1px var(--elevation-well-ring),
520
+ inset 0 1px 2px var(--elevation-well-shade);
521
+ --elevation-field: inset 0 1px 2px var(--elevation-field-shade);
522
+ }
@@ -294,8 +294,11 @@
294
294
  --radius-radius-1: 0.0625rem;
295
295
  --radius-radius-2: 0.125rem;
296
296
  --radius-radius-4: 0.25rem;
297
+ --radius-radius-6: 0.375rem;
297
298
  --radius-radius-8: 0.5rem;
299
+ --radius-radius-10: 0.625rem;
298
300
  --radius-radius-12: 0.75rem;
301
+ --radius-radius-14: 0.875rem;
299
302
  --radius-radius-16: 1rem;
300
303
  --radius-radius-20: 1.25rem;
301
304
  --radius-radius-24: 1.5rem;
package/dist/spacing.css CHANGED
@@ -1,81 +1,54 @@
1
1
  /* ============================================
2
- * Spacing Scales
3
- * Semantic spacing tokens that adapt to Compact, Standard, and Wide
2
+ * Density
3
+ * <html data-spacing="compact | standard | wide"> sets how much room an
4
+ * interface takes: the spacing ladder (--spacing-*) and the size ladder
5
+ * (--size-*: control heights, row heights, icon boxes).
4
6
  *
5
- * --spacing-* and --size-* reference primitive rungs from Layer 1, and each
6
- * density shifts the whole ladder by one rung. Standard sits on half-step
7
- * rungs (spacing 2/4/6/10/14/18/20/32/64, sizes 14/18/22/28/36/44/56/80/120)
8
- * so it lands visibly between compact and wide rather than hugging compact.
7
+ * Density does not change text. Font size, line height and tracking belong to
8
+ * the typeset axis (typeset.css), so 13px body text is 13px in every density
9
+ * and a dense table stays readable. Only the room around the text moves.
9
10
  *
10
- * --font-size-* works the same way, but the rungs it picks are typeset steps
11
- * (typeset.css), not static primitives: each density selects a step and the
12
- * step's value is itself viewport-fluid. So `--font-size-base` is one step
13
- * lower in compact and one step higher in wide, and whichever step is chosen
14
- * still interpolates between its small/medium/large anchors as the viewport
15
- * changes. Wide saturates at the top of the ladder (4xl and 5xl both land on
16
- * step-6), mirroring compact, where xs and sm have always shared a rung.
11
+ * What each density gives the common parts, in px (compact / standard / wide):
17
12
  *
18
- * Per-step line-height and letter-spacing live alongside the sizes as
19
- * --line-height-step-* / --letter-spacing-step-*; components that opt into a
20
- * step (see the Typography component) should take all three together. Each
21
- * --font-size-* alias has --line-height-* and --letter-spacing-* companions
22
- * on the same step, so a density-aware size can do the same.
13
+ * control height --size-lg 28 / 36 / 44
14
+ * small control, row --size-md 22 / 28 / 36
15
+ * button inline padding --spacing-lg 10 / 14 / 20
16
+ * card padding --spacing-xl 14 / 18 / 24
17
+ * gap between cards --spacing-2xl 16 / 20 / 32
18
+ * page padding --spacing-3xl 24 / 32 / 40
19
+ *
20
+ * --density-step (-1, 0, 1) lets other axes react to density without knowing
21
+ * its name: curves.css uses it to step the surface radius down in compact and
22
+ * up in wide.
23
23
  * ============================================ */
24
24
 
25
25
  [data-spacing="compact"] {
26
+ --density-step: -1;
27
+
26
28
  --spacing-xxs: var(--spacing-space-0);
27
29
  --spacing-xs: var(--spacing-space-2);
28
30
  --spacing-sm: var(--spacing-space-4);
29
31
  --spacing-md: var(--spacing-space-8);
30
- --spacing-lg: var(--spacing-space-12);
31
- --spacing-xl: var(--spacing-space-16);
32
- --spacing-2xl: var(--spacing-space-20);
32
+ --spacing-lg: var(--spacing-space-10);
33
+ --spacing-xl: var(--spacing-space-14);
34
+ --spacing-2xl: var(--spacing-space-16);
33
35
  --spacing-3xl: var(--spacing-space-24);
34
36
  --spacing-4xl: var(--spacing-space-32);
35
37
 
36
38
  --size-xxs: var(--sizing-size-12);
37
39
  --size-xs: var(--sizing-size-16);
38
- --size-sm: var(--sizing-size-20);
39
- --size-md: var(--sizing-size-24);
40
- --size-lg: var(--sizing-size-32);
41
- --size-xl: var(--sizing-size-40);
42
- --size-2xl: var(--sizing-size-48);
40
+ --size-sm: var(--sizing-size-18);
41
+ --size-md: var(--sizing-size-22);
42
+ --size-lg: var(--sizing-size-28);
43
+ --size-xl: var(--sizing-size-36);
44
+ --size-2xl: var(--sizing-size-44);
43
45
  --size-3xl: var(--sizing-size-64);
44
46
  --size-4xl: var(--sizing-size-96);
45
-
46
- /* One typeset step down from standard */
47
- --font-size-xs: var(--font-size-step-neg3);
48
- --font-size-sm: var(--font-size-step-neg2);
49
- --font-size-base: var(--font-size-step-neg1);
50
- --font-size-lg: var(--font-size-step-0);
51
- --font-size-xl: var(--font-size-step-1);
52
- --font-size-2xl: var(--font-size-step-2);
53
- --font-size-3xl: var(--font-size-step-3);
54
- --font-size-4xl: var(--font-size-step-4);
55
- --font-size-5xl: var(--font-size-step-5);
56
-
57
- /* Line height and tracking follow the same steps as the sizes */
58
- --line-height-xs: var(--line-height-step-neg3);
59
- --line-height-sm: var(--line-height-step-neg2);
60
- --line-height-base: var(--line-height-step-neg1);
61
- --line-height-lg: var(--line-height-step-0);
62
- --line-height-xl: var(--line-height-step-1);
63
- --line-height-2xl: var(--line-height-step-2);
64
- --line-height-3xl: var(--line-height-step-3);
65
- --line-height-4xl: var(--line-height-step-4);
66
- --line-height-5xl: var(--line-height-step-5);
67
- --letter-spacing-xs: var(--letter-spacing-step-neg3);
68
- --letter-spacing-sm: var(--letter-spacing-step-neg2);
69
- --letter-spacing-base: var(--letter-spacing-step-neg1);
70
- --letter-spacing-lg: var(--letter-spacing-step-0);
71
- --letter-spacing-xl: var(--letter-spacing-step-1);
72
- --letter-spacing-2xl: var(--letter-spacing-step-2);
73
- --letter-spacing-3xl: var(--letter-spacing-step-3);
74
- --letter-spacing-4xl: var(--letter-spacing-step-4);
75
- --letter-spacing-5xl: var(--letter-spacing-step-5);
76
47
  }
77
48
 
78
49
  [data-spacing="standard"] {
50
+ --density-step: 0;
51
+
79
52
  --spacing-xxs: var(--spacing-space-2);
80
53
  --spacing-xs: var(--spacing-space-4);
81
54
  --spacing-sm: var(--spacing-space-6);
@@ -95,40 +68,11 @@
95
68
  --size-2xl: var(--sizing-size-56);
96
69
  --size-3xl: var(--sizing-size-80);
97
70
  --size-4xl: var(--sizing-size-120);
98
-
99
- /* The reference mapping — base sits on step-0 */
100
- --font-size-xs: var(--font-size-step-neg2);
101
- --font-size-sm: var(--font-size-step-neg1);
102
- --font-size-base: var(--font-size-step-0);
103
- --font-size-lg: var(--font-size-step-1);
104
- --font-size-xl: var(--font-size-step-2);
105
- --font-size-2xl: var(--font-size-step-3);
106
- --font-size-3xl: var(--font-size-step-4);
107
- --font-size-4xl: var(--font-size-step-5);
108
- --font-size-5xl: var(--font-size-step-6);
109
-
110
- /* Line height and tracking follow the same steps as the sizes */
111
- --line-height-xs: var(--line-height-step-neg2);
112
- --line-height-sm: var(--line-height-step-neg1);
113
- --line-height-base: var(--line-height-step-0);
114
- --line-height-lg: var(--line-height-step-1);
115
- --line-height-xl: var(--line-height-step-2);
116
- --line-height-2xl: var(--line-height-step-3);
117
- --line-height-3xl: var(--line-height-step-4);
118
- --line-height-4xl: var(--line-height-step-5);
119
- --line-height-5xl: var(--line-height-step-6);
120
- --letter-spacing-xs: var(--letter-spacing-step-neg2);
121
- --letter-spacing-sm: var(--letter-spacing-step-neg1);
122
- --letter-spacing-base: var(--letter-spacing-step-0);
123
- --letter-spacing-lg: var(--letter-spacing-step-1);
124
- --letter-spacing-xl: var(--letter-spacing-step-2);
125
- --letter-spacing-2xl: var(--letter-spacing-step-3);
126
- --letter-spacing-3xl: var(--letter-spacing-step-4);
127
- --letter-spacing-4xl: var(--letter-spacing-step-5);
128
- --letter-spacing-5xl: var(--letter-spacing-step-6);
129
71
  }
130
72
 
131
73
  [data-spacing="wide"] {
74
+ --density-step: 1;
75
+
132
76
  --spacing-xxs: var(--spacing-space-4);
133
77
  --spacing-xs: var(--spacing-space-8);
134
78
  --spacing-sm: var(--spacing-space-12);
@@ -136,47 +80,16 @@
136
80
  --spacing-lg: var(--spacing-space-20);
137
81
  --spacing-xl: var(--spacing-space-24);
138
82
  --spacing-2xl: var(--spacing-space-32);
139
- --spacing-3xl: var(--spacing-space-80);
140
- --spacing-4xl: var(--spacing-space-160);
83
+ --spacing-3xl: var(--spacing-space-40);
84
+ --spacing-4xl: var(--spacing-space-80);
141
85
 
142
- --size-xxs: var(--sizing-size-20);
143
- --size-xs: var(--sizing-size-24);
144
- --size-sm: var(--sizing-size-32);
145
- --size-md: var(--sizing-size-40);
146
- --size-lg: var(--sizing-size-48);
86
+ --size-xxs: var(--sizing-size-16);
87
+ --size-xs: var(--sizing-size-20);
88
+ --size-sm: var(--sizing-size-28);
89
+ --size-md: var(--sizing-size-36);
90
+ --size-lg: var(--sizing-size-44);
147
91
  --size-xl: var(--sizing-size-56);
148
- --size-2xl: var(--sizing-size-80);
149
- --size-3xl: var(--sizing-size-120);
150
- --size-4xl: var(--sizing-size-240);
151
-
152
- /* One typeset step up from standard; 4xl/5xl saturate at the ladder top */
153
- --font-size-xs: var(--font-size-step-neg1);
154
- --font-size-sm: var(--font-size-step-0);
155
- --font-size-base: var(--font-size-step-1);
156
- --font-size-lg: var(--font-size-step-2);
157
- --font-size-xl: var(--font-size-step-3);
158
- --font-size-2xl: var(--font-size-step-4);
159
- --font-size-3xl: var(--font-size-step-5);
160
- --font-size-4xl: var(--font-size-step-6);
161
- --font-size-5xl: var(--font-size-step-6);
162
-
163
- /* Line height and tracking follow the same steps as the sizes */
164
- --line-height-xs: var(--line-height-step-neg1);
165
- --line-height-sm: var(--line-height-step-0);
166
- --line-height-base: var(--line-height-step-1);
167
- --line-height-lg: var(--line-height-step-2);
168
- --line-height-xl: var(--line-height-step-3);
169
- --line-height-2xl: var(--line-height-step-4);
170
- --line-height-3xl: var(--line-height-step-5);
171
- --line-height-4xl: var(--line-height-step-6);
172
- --line-height-5xl: var(--line-height-step-6);
173
- --letter-spacing-xs: var(--letter-spacing-step-neg1);
174
- --letter-spacing-sm: var(--letter-spacing-step-0);
175
- --letter-spacing-base: var(--letter-spacing-step-1);
176
- --letter-spacing-lg: var(--letter-spacing-step-2);
177
- --letter-spacing-xl: var(--letter-spacing-step-3);
178
- --letter-spacing-2xl: var(--letter-spacing-step-4);
179
- --letter-spacing-3xl: var(--letter-spacing-step-5);
180
- --letter-spacing-4xl: var(--letter-spacing-step-6);
181
- --letter-spacing-5xl: var(--letter-spacing-step-6);
92
+ --size-2xl: var(--sizing-size-64);
93
+ --size-3xl: var(--sizing-size-96);
94
+ --size-4xl: var(--sizing-size-160);
182
95
  }