@crystal-ui/core 2.0.0 → 2.2.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 (38) hide show
  1. package/assets/crystal-theme.css +126 -3
  2. package/assets/crystal.css +1192 -5
  3. package/assets/crystal.js +106 -11
  4. package/assets/motion.js +17 -2
  5. package/assets/tokens.js +1 -1
  6. package/docs/accessibility.md +9 -2
  7. package/docs/adoption.md +29 -48
  8. package/docs/catalogue.md +465 -33
  9. package/docs/colors.md +84 -0
  10. package/docs/components.md +55 -25
  11. package/docs/materials.md +12 -4
  12. package/docs/motion-components.md +16 -12
  13. package/docs/motion.md +12 -2
  14. package/docs/tokens.md +31 -3
  15. package/engines.js +13 -2
  16. package/exports/crystal-tokens.kt +19 -1
  17. package/exports/crystal-tokens.swift +19 -1
  18. package/exports/crystal-tokens.ts +19 -1
  19. package/package.json +2 -1
  20. package/tokens/catalogue/01-layout.json +45 -0
  21. package/tokens/catalogue/02-navigation.json +89 -2
  22. package/tokens/catalogue/03-actions.json +42 -1
  23. package/tokens/catalogue/04-inputs.json +366 -5
  24. package/tokens/catalogue/05-data-display.json +187 -1
  25. package/tokens/catalogue/06-feedback.json +78 -6
  26. package/tokens/catalogue/07-overlays.json +50 -3
  27. package/tokens/catalogue/08-typography.json +54 -0
  28. package/tokens/catalogue/09-utility.json +79 -0
  29. package/tokens/catalogue/10-charts.json +89 -1
  30. package/tokens/catalogue/11-media.json +33 -0
  31. package/tokens/catalogue/12-commerce.json +134 -1
  32. package/tokens/catalogue/13-screens.json +81 -0
  33. package/tokens/catalogue/14-blocks.json +101 -0
  34. package/tokens/catalogue.json +1652 -21
  35. package/tokens/crystal.json +253 -13
  36. package/tokens/crystal.tokens.json +98 -2
  37. package/tokens/motion-recipes.json +216 -0
  38. package/tokens/surfaces.json +167 -0
@@ -12,7 +12,7 @@
12
12
  /* Crystal 1.0: framework-independent primitives. Theme variables are supplied by
13
13
  crystal-theme.css or by a configuration exported from the playground. */
14
14
  :root{--cr-font:Manrope,system-ui,sans-serif;--cr-radius:28px;--cr-space:20px;--cr-reading:16px;--cr-leading:1.5;color-scheme:light}
15
- *{box-sizing:border-box}body{margin:0;color:var(--cr-text);background:var(--cr-canvas);font-family:var(--cr-font);font-size:16px;line-height:1.6}button,input,select,textarea{font:inherit;color:inherit}button,a,input,select,textarea{touch-action:manipulation}button{cursor:pointer}a{color:var(--cr-primary);text-underline-offset:4px}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible,[tabindex]:focus-visible{outline:var(--cr-focus-core-width,2px) solid var(--cr-focus-core,var(--cr-primary));outline-offset:var(--cr-focus-core-offset,3px);box-shadow:var(--cr-focus-ring,0 0 6px 2px color-mix(in srgb,var(--cr-primary) 46%,transparent),0 0 16px 6px color-mix(in srgb,var(--cr-primary) 30%,transparent),0 0 30px 12px color-mix(in srgb,var(--cr-primary) 17%,transparent),0 0 54px 22px color-mix(in srgb,var(--cr-primary) 8%,transparent))}button:disabled{cursor:not-allowed;opacity:.55}button{transition:background var(--cr-state),box-shadow var(--cr-state),transform var(--cr-press)}button:active:not(:disabled){transform:translateY(1px)}[hidden]{display:none!important}svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}h1,h2,h3,h4,p{margin-top:0}h1,h2,h3,h4{line-height:1.2;letter-spacing:-.04em}button:has(svg){display:inline-flex;align-items:center;justify-content:center;gap:9px}
15
+ *{box-sizing:border-box}body{margin:0;color:var(--cr-text);background:var(--cr-canvas);font-family:var(--cr-font);font-size:16px;line-height:1.6}button,input,select,textarea{font:inherit;color:inherit}button,a,input,select,textarea{touch-action:manipulation}button{cursor:pointer}a{color:var(--cr-primary);text-underline-offset:4px}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible,[tabindex]:focus-visible{outline:var(--cr-focus-core-width,2px) solid var(--cr-focus-core,var(--cr-primary));outline-offset:var(--cr-focus-core-offset,3px);box-shadow:var(--cr-focus-ring,0 0 6px 1px var(--cr-focus-feather-1,color-mix(in srgb,var(--cr-primary) 46%,transparent)),0 0 16px 3px var(--cr-focus-feather-2,color-mix(in srgb,var(--cr-primary) 30%,transparent)),0 0 30px 6px var(--cr-focus-feather-3,color-mix(in srgb,var(--cr-primary) 17%,transparent)),0 0 54px 11px var(--cr-focus-feather-4,color-mix(in srgb,var(--cr-primary) 8%,transparent)),0 8px 18px var(--cr-focus-feather-2,color-mix(in srgb,var(--cr-primary) 30%,transparent)),0 22px 40px var(--cr-focus-shadow,color-mix(in srgb,var(--cr-decorative) 27%,transparent)))}button:disabled{cursor:not-allowed;opacity:.55}button{transition:background var(--cr-state),box-shadow var(--cr-state),transform var(--cr-press)}button:active:not(:disabled){transform:translateY(1px)}[hidden]{display:none!important}svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}h1,h2,h3,h4,p{margin-top:0}h1,h2,h3,h4{line-height:1.2;letter-spacing:-.04em}button:has(svg){display:inline-flex;align-items:center;justify-content:center;gap:9px}
16
16
  /* Plastic carries a glow of its own — the primary lifted by the scheme's tint —
17
17
  which is a material property and stays. What was ambient was the glow drifting
18
18
  across the foundation; that is deferred with the rest of the tier, so the
@@ -23,12 +23,43 @@
23
23
  :is(.cr-frost,.cr-acrylic):before{content:'';position:absolute;inset:0;pointer-events:none;z-index:-1;border-radius:inherit;opacity:var(--cr-grain-opacity);background-image:url('grain.svg')}
24
24
  :is(.cr-resin,.cr-glass){background:var(--cr-resin-fill);border-radius:999px;box-shadow:var(--cr-shadow-float);backdrop-filter:blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation));-webkit-backdrop-filter:blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation))}
25
25
  .cr-well{background:var(--cr-surface);border-radius:calc(var(--cr-radius) - 7px);color:var(--cr-text);border:1px solid var(--cr-edge)}
26
- .cr-button{min-height:44px;padding:10px 19px;border-radius:999px;border:1px solid transparent;background:var(--cr-primary);color:var(--cr-on-primary);font-weight:750;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:8px;line-height:1.3}
27
- .cr-button:hover{box-shadow:var(--cr-shadow-content);filter:brightness(1.04)}.cr-button.secondary{background:var(--cr-primary-soft);color:var(--cr-on-primary-soft)}.cr-button.quiet{background:var(--cr-surface);color:var(--cr-text);border-color:var(--cr-outline)}.cr-button.danger{background:var(--cr-danger-surface);color:var(--cr-danger-ink);border-color:var(--cr-danger-ink)}
26
+ .cr-button{min-height:48px;padding:15px 24px;border-radius:999px;border:1px solid transparent;font-weight:750;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:9px;line-height:1.3}
27
+ .cr-button:hover{box-shadow:var(--cr-shadow-content);filter:brightness(1.04)}/* The button vocabulary is four names and none of them is a colour Crystal
28
+ does not have.
29
+
30
+ `.cr-button` is the action control: a Resin shell with the neutral Haze
31
+ reading fill. `.primary` is the one tinted in the palette's action colour,
32
+ `.quiet` drops the reading fill, `.danger` adds the independent
33
+ destructive boundary. Emphasis is opt-in: a rule that had to enumerate
34
+ every variant it was *not* meant to tint was one forgotten modifier away
35
+ from painting the whole surface.
36
+
37
+ `.secondary` was here and is gone. It named a second action colour, and
38
+ Crystal has no such role — the palettes publish one action pair, and the
39
+ companion and glow hues are expressive paint that is never assumed to be
40
+ text-safe. See `docs/colors.md`. A variant named after a colour the system
41
+ does not define is a promise it cannot keep.
42
+
43
+ The bare `.cr-button` also no longer carries `background:var(--cr-primary)`
44
+ and `color:var(--cr-on-primary)` here. Those had not rendered since the
45
+ Resin surface was adopted — the component layer outranks this one — and
46
+ with the tint moved to `.primary` they would now be wrong as well as
47
+ dead. */
28
48
  .cr-input{min-height:44px;border:1px solid var(--cr-outline);border-radius:12px;background:var(--cr-surface);padding:10px 12px;width:100%;color:var(--cr-text)}.cr-input::placeholder{color:var(--cr-muted)}
29
- .cr-status{display:inline-flex;align-items:center;gap:7px;border-radius:9px;padding:5px 9px;background:var(--status-surface);color:var(--status-ink);font-size:13px;font-weight:750;line-height:1.4}.cr-status[data-status=success]{--status-surface:var(--cr-success-surface);--status-ink:var(--cr-success-ink)}.cr-status[data-status=attention]{--status-surface:var(--cr-attention-surface);--status-ink:var(--cr-attention-ink)}.cr-status[data-status=danger]{--status-surface:var(--cr-danger-surface);--status-ink:var(--cr-danger-ink)}.cr-status[data-status=info]{--status-surface:var(--cr-info-surface);--status-ink:var(--cr-info-ink)}
49
+ .cr-status{display:inline-flex;align-items:center;gap:7px;border-radius:9px;padding:5px 9px;background:var(--status-surface);color:var(--status-ink);font-size:13px;font-weight:750;line-height:1.4;/* Adopted from the preview 21 September 2026 with D-11's third divergence.
50
+ It scopes --cr-outline to the status ink for the chip's subtree. Nothing
51
+ in the library reads it there today: --cr-outline is consumed by
52
+ .cr-input, .cr-dialog, the Frost/Resin border and the two scrollbar
53
+ rules, none of which can match inside a chip, and the
54
+ chip's own rim comes from --cr-rim. Kept because the preview carries it
55
+ and a consumer may nest something that reads it; it is not a claim that
56
+ anything renders differently. */--cr-outline:var(--status-ink)}.cr-status[data-status=success]{--status-surface:var(--cr-success-surface);--status-ink:var(--cr-success-ink)}.cr-status[data-status=attention]{--status-surface:var(--cr-attention-surface);--status-ink:var(--cr-attention-ink)}.cr-status[data-status=danger]{--status-surface:var(--cr-danger-surface);--status-ink:var(--cr-danger-ink)}.cr-status[data-status=info]{--status-surface:var(--cr-info-surface);--status-ink:var(--cr-info-ink)}
30
57
  .cr-bubble{background:var(--cr-surface);color:var(--cr-text);border:1px solid var(--cr-edge);border-radius:6px var(--cr-radius) var(--cr-radius) var(--cr-radius);box-shadow:var(--cr-shadow-content);padding:14px 18px;line-height:1.5;font-size:16px}.cr-bubble.own{border-radius:var(--cr-radius) 6px var(--cr-radius) var(--cr-radius);background:var(--cr-primary-soft);color:var(--cr-on-primary-soft)}[dir=rtl] .cr-bubble{border-radius:var(--cr-radius) 6px var(--cr-radius) var(--cr-radius)}[dir=rtl] .cr-bubble.own{border-radius:6px var(--cr-radius) var(--cr-radius) var(--cr-radius)}
31
- .cr-dock{display:flex;align-items:center;gap:4px;padding:8px;max-width:100%}.cr-dock-inner{display:flex;gap:3px;align-items:center;border-radius:999px;background:var(--cr-label-fill);padding:3px;width:100%}.cr-dock button{min-height:44px;border:0;background:none;padding:10px 17px;border-radius:999px;font-weight:700;white-space:nowrap;color:var(--cr-text)}.cr-dock button[aria-pressed=true]{background:var(--cr-primary);color:var(--cr-on-primary);text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:5px;box-shadow:0 2px 5px #0002}.cr-dock button:hover:not([aria-pressed=true]){background:var(--cr-surface)}
58
+ .cr-dock{display:flex;align-items:center;gap:4px;padding:8px;max-width:100%}.cr-dock-inner{display:flex;gap:3px;align-items:center;border-radius:999px;background:var(--cr-label-fill);padding:3px;width:100%}.cr-dock button{min-height:44px;border:0;background:none;padding:10px 17px;border-radius:999px;font-weight:700;white-space:nowrap;color:var(--cr-text)}/* The underline this rule used to draw under a selected dock label is gone.
59
+ Selection is carried by label weight alone, the adopted component layer
60
+ sets text-decoration:none over it, and a declaration that neither renders
61
+ nor matches the specification is worse than an absent one. */
62
+ .cr-dock button[aria-pressed=true]{background:var(--cr-primary);color:var(--cr-on-primary);box-shadow:0 2px 5px #0002}.cr-dock button:hover:not([aria-pressed=true]){background:var(--cr-surface)}
32
63
  .cr-dialog{border:1px solid var(--cr-outline);background:var(--cr-surface);color:var(--cr-text);padding:30px;border-radius:calc(var(--cr-radius) + 6px);width:min(560px,calc(100% - 32px));box-shadow:var(--cr-shadow-float);max-height:85dvh;overflow:auto;overflow-x:hidden}.cr-dialog::backdrop,.cr-mirage{background:var(--cr-mirage-fill);backdrop-filter:blur(var(--cr-mirage-blur)) saturate(var(--cr-mirage-saturation)) brightness(var(--cr-mirage-brightness));-webkit-backdrop-filter:blur(var(--cr-mirage-blur)) saturate(var(--cr-mirage-saturation)) brightness(var(--cr-mirage-brightness))}.cr-dialog header{display:flex;justify-content:space-between;align-items:start;gap:20px}.cr-dialog h2{font-size:26px}.cr-dialog footer{display:flex;gap:10px;justify-content:flex-end;margin-top:24px}.cr-dialog pre{max-height:300px;overflow:auto}
33
64
  [data-effects=opaque] :is(.cr-frost,.cr-acrylic),[data-effects=opaque] :is(.cr-resin,.cr-glass){backdrop-filter:none;-webkit-backdrop-filter:none;background:var(--cr-surface);border-color:var(--cr-outline)}[data-effects=opaque] :is(.cr-frost,.cr-acrylic):before{display:none}
34
65
  @supports not (backdrop-filter:blur(1px)){:is(.cr-frost,.cr-acrylic),:is(.cr-resin,.cr-glass){background:var(--cr-surface);border-color:var(--cr-outline)}}
@@ -275,3 +306,1159 @@
275
306
  .cr-dialog::backdrop,.cr-mirage{background:var(--cr-mirage-fallback-fill)}
276
307
  }
277
308
  }
309
+
310
+ /* ---------------------------------------------------------------------------
311
+ The Resin interaction surface, and the four Crystal components that were
312
+ only ever in the preview's stylesheet.
313
+
314
+ `.cr-control`, `.cr-field-shell`, `.cr-indicator`, `.cr-resin-haze` and
315
+ `.cr-tag` are named throughout `docs/components.md` — the indicator's 20px
316
+ circle with its 3px-inset 80% Haze fill, `.cr-resin-haze` as the composition
317
+ small display elements use — and until 21 September 2026 the library shipped
318
+ none of them. `components.md` said "use `assets/controls.css` after the base
319
+ and layout styles", and `assets/controls.css` is not in this package and never
320
+ was. A consumer following the specification reached for five components that
321
+ did not exist, which is why Crystal React had to rebuild the control surface
322
+ in SCSS rather than consume it.
323
+
324
+ That is D-11's third divergence, and Meridian decided on 21 September that the
325
+ library adopts rather than the preview drops. Lifted from
326
+ `crystal-preview/website/assets/controls.css` with its selector lists filtered
327
+ to the Crystal parts: the preview's own furniture — `.suite-switch`,
328
+ `.segmented`, the range inputs — shares those rules and stays with the site.
329
+
330
+ In `@layer crystal.component`, which is where the preview had it and where the
331
+ layer order at the top of this file already reserves a slot. That matters for
332
+ more than tidiness: the rules above sit in `crystal.reset`, an earlier layer,
333
+ so these win regardless of specificity — which is what let a reset-layer hover
334
+ (D-21) and a reset-layer target size (D-20) publish values that never
335
+ rendered. A component recipe belongs in this layer or nowhere. The cascade is
336
+ the one the preview has been rendering all along, which is what makes this an
337
+ adoption rather than a redesign.
338
+ --------------------------------------------------------------------------- */
339
+ @layer crystal.component {
340
+ :is(button,a.cr-button,.cr-control,.cr-field-shell,.cr-resin-haze,.cr-status) {
341
+ position: relative;
342
+ isolation: isolate;
343
+ background: var(--cr-resin-fill);
344
+ color: var(--cr-text);
345
+ border: 1px solid var(--cr-rim);
346
+ box-shadow: var(--cr-shadow-float);
347
+ backdrop-filter: blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation));
348
+ -webkit-backdrop-filter: blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation));
349
+ filter: none;
350
+ }
351
+ :is(button,a.cr-button,.cr-control,.cr-field-shell,.cr-resin-haze,.cr-status)::before {
352
+ content: '';
353
+ position: absolute;
354
+ inset: var(--cr-haze-inset);
355
+ z-index: -1;
356
+ pointer-events: none;
357
+ border-radius: inherit;
358
+ background: var(--cr-haze-fill);
359
+ filter: blur(var(--cr-haze-feather));
360
+ box-shadow: none;
361
+ }
362
+ :is(button,a.cr-button,.cr-control,.cr-field-shell,.cr-resin-haze,.cr-status)::after {
363
+ content: '';
364
+ position: absolute;
365
+ inset: 0;
366
+ z-index: -2;
367
+ pointer-events: none;
368
+ border-radius: inherit;
369
+ background: linear-gradient(115deg,transparent 20%,#ffffff30 43%,#ffffff0a 55%,transparent 72%),radial-gradient(ellipse at 12% 0%,var(--cr-control-light),transparent 75%),linear-gradient(135deg,var(--cr-control-color),transparent 60%,var(--cr-control-light));
370
+ background-size: 220% 100%,100% 100%,100% 100%;
371
+ background-position: 100% 0;
372
+ box-shadow: inset 0 2px 1px var(--cr-rim),inset 0 -1px 1px var(--cr-rim);
373
+ }
374
+ .cr-field-shell {
375
+ display: inline-flex;
376
+ align-items: center;
377
+ min-width: 0;
378
+ border-radius: 20px;
379
+ padding: 8px;
380
+ vertical-align: middle;
381
+ }
382
+ .cr-field-shell:has(.cr-input) {
383
+ width: 100%;
384
+ }
385
+ .cr-field-shell :is(input,select,textarea) {
386
+ position: relative;
387
+ background: transparent;
388
+ border: 0;
389
+ box-shadow: none;
390
+ border-radius: 12px;
391
+ min-width: 0;
392
+ color: var(--cr-text);
393
+ min-height: 44px;
394
+ max-width: 100%;
395
+ }
396
+ .cr-field-shell:focus-within {
397
+ outline: 2px solid var(--cr-focus-core);
398
+ outline-offset: 3px;
399
+ }
400
+ .cr-field-shell :focus-visible {
401
+ outline: 0;
402
+ }
403
+ [data-effects=opaque] :is(button,a.cr-button,.cr-control,.cr-field-shell,.cr-resin-haze,.cr-status) {
404
+ background: var(--cr-surface);
405
+ backdrop-filter: none;
406
+ -webkit-backdrop-filter: none;
407
+ }
408
+ [data-effects=opaque] :is(button,a.cr-button,.cr-control,.cr-field-shell,.cr-resin-haze,.cr-status)::after {
409
+ display: none;
410
+ }
411
+ .cr-resin-haze {
412
+ border-radius: 18px;
413
+ padding: 16px;
414
+ line-height: 1.5;
415
+ }
416
+ .cr-tag {
417
+ display: inline-flex;
418
+ align-items: center;
419
+ gap: 6px;
420
+ padding: 10px 14px;
421
+ border-radius: 99px;
422
+ font-size: 13px;
423
+ font-weight: 700;
424
+ }
425
+ nav a.cr-control {
426
+ display: inline-flex;
427
+ align-items: center;
428
+ justify-content: center;
429
+ padding: 10px 14px;
430
+ border-radius: 99px;
431
+ min-height: 44px;
432
+ text-decoration: none;
433
+ }
434
+ nav a.cr-control[aria-current] {
435
+ text-decoration: none;
436
+ }
437
+ .cr-field-shell {
438
+ box-shadow: inset 0 2px 1px var(--cr-rim),0 3px 5px var(--cr-control-edge),0 12px 24px var(--cr-shadow-contact);
439
+ }
440
+ :is(.cr-tag,.cr-resin-haze) {
441
+ padding: 17px 24px;
442
+ }
443
+ .cr-tag {
444
+ min-height: 48px;
445
+ }
446
+ span.cr-field-shell {
447
+ border-color: var(--cr-rim);
448
+ }
449
+ span.cr-field-shell::after {
450
+ background-image: radial-gradient(ellipse at 12% 0%,var(--cr-control-light),transparent 75%),linear-gradient(135deg,var(--cr-control-color),transparent 60%,var(--cr-control-light));
451
+ background-size: 100% 100%,100% 100%;
452
+ background-position: 0 0,0 0;
453
+ background-repeat: no-repeat;
454
+ }
455
+ span.cr-field-shell:has([aria-invalid=true])::after {
456
+ background-image: radial-gradient(ellipse at 12% 0%,var(--cr-control-light),transparent 75%),linear-gradient(135deg,var(--cr-control-color),transparent 60%,var(--cr-control-light));
457
+ }
458
+ [data-effects=opaque] span.cr-field-shell::after {
459
+ display: none;
460
+ }
461
+ span.cr-field-shell:focus-within {
462
+ outline: 2px solid var(--cr-focus-core);
463
+ outline-offset: 3px;
464
+ box-shadow: inset 0 2px 1px var(--cr-rim),var(--cr-focus-ring);
465
+ }
466
+ span.cr-field-shell :is(input,select,textarea):focus-visible {
467
+ outline: 0;
468
+ box-shadow: none;
469
+ }
470
+ :is(.cr-resin,.cr-glass,.cr-resin-haze) :is(.cr-haze,.cr-surface,.cr-well,.cr-content-fill) {
471
+ box-shadow: inset 0 1px 2px var(--cr-shadow-contact),inset 0 -1px 0 var(--cr-rim);
472
+ }
473
+ :is(.cr-resin,.cr-glass,.cr-resin-haze) :is(button,a.cr-button,.cr-button,.cr-control) {
474
+ backdrop-filter: none;
475
+ -webkit-backdrop-filter: none;
476
+ /* backdrop-filter silently creates a stacking context, and these controls
477
+ paint their fill on a ::before at z-index -1 which was relying on it. Drop
478
+ the filter alone and that pseudo-element escapes to the nearest ancestor
479
+ context and paints behind the button's own background instead of above it —
480
+ which erased the selected dock label completely. Isolation restores the
481
+ containment without restoring the second blur. */
482
+ isolation: isolate;
483
+ }
484
+ .cr-indicator {
485
+ position: absolute;
486
+ isolation: isolate;
487
+ display: grid;
488
+ place-items: center;
489
+ inset-block-start: -4px;
490
+ inset-inline-end: -3px;
491
+ width: 20px;
492
+ height: 20px;
493
+ min-width: 20px;
494
+ border-radius: 50%;
495
+ border: 1px solid var(--cr-rim);
496
+ background: transparent;
497
+ backdrop-filter: none;
498
+ -webkit-backdrop-filter: none;
499
+ box-shadow: 0 2px 4px var(--cr-control-edge),0 4px 8px var(--cr-shadow-contact);
500
+ color: var(--cr-text);
501
+ font: 800 12px/1 var(--cr-font);
502
+ z-index: 2;
503
+ pointer-events: none;
504
+ text-decoration: none;
505
+ text-shadow: none;
506
+ }
507
+ .cr-indicator::before {
508
+ content: '';
509
+ position: absolute;
510
+ inset: 1px;
511
+ z-index: -1;
512
+ border-radius: 50%;
513
+ background: var(--cr-haze-fill);
514
+ filter: blur(var(--cr-haze-feather));
515
+ }
516
+ .cr-indicator:is([data-kind=selection],[data-kind=current],[data-kind=busy]) {
517
+ display: none;
518
+ }
519
+ [aria-current]:not([aria-current=false])>.cr-indicator[data-kind=current] {
520
+ display: grid;
521
+ }
522
+ [aria-busy=true]>.cr-indicator[data-kind=busy] {
523
+ display: grid;
524
+ }
525
+ .cr-indicator[data-kind=current]::after {
526
+ content: '●';
527
+ font-size: 9px;
528
+ }
529
+ .cr-indicator[data-kind=busy]::after {
530
+ content: '…';
531
+ font-size: 14px;
532
+ }
533
+ :is([aria-pressed=true],[aria-selected=true],[aria-checked=true])>.cr-indicator[data-kind=selection] {
534
+ display: none
535
+ }
536
+ .cr-indicator[data-kind=selection]::before,.cr-indicator[data-kind=selection]::after {
537
+ content: none;
538
+ display: none;
539
+ }
540
+ span.cr-field-shell {
541
+ padding-inline-end: 40px;
542
+ }
543
+ span.cr-field-shell>.cr-indicator {
544
+ inset-block-start: 50%;
545
+ inset-inline-end: 10px;
546
+ transform: translateY(-50%);
547
+ width: 24px;
548
+ height: 24px;
549
+ }
550
+ span.cr-field-shell>.cr-indicator::after {
551
+ content: '○';
552
+ font-size: 15px;
553
+ }
554
+ span.cr-field-shell:focus-within>.cr-indicator::after {
555
+ content: '●';
556
+ font-size: 9px;
557
+ }
558
+ span.cr-field-shell:has(:is([required],[aria-required=true]))>.cr-indicator::after {
559
+ content: '*';
560
+ font-size: 19px;
561
+ }
562
+ span.cr-field-shell:has([aria-invalid=true])>.cr-indicator::after {
563
+ content: '!';
564
+ font-size: 15px;
565
+ }
566
+ :is(button[aria-pressed],button[aria-selected],button[aria-checked],a.cr-control[aria-current]) {
567
+ text-decoration: none;
568
+ }
569
+ [data-effects=opaque] .cr-indicator {
570
+ background: var(--cr-surface);
571
+ backdrop-filter: none;
572
+ }
573
+ [data-effects=opaque] .cr-indicator::before {
574
+ filter: none;
575
+ }
576
+ }
577
+
578
+ @layer crystal.component {
579
+ @media (prefers-reduced-transparency:reduce) {
580
+ :is(button,a.cr-button,.cr-control,.cr-field-shell,.cr-resin-haze,.cr-status) {
581
+ background: var(--cr-surface);
582
+ backdrop-filter: none;
583
+ -webkit-backdrop-filter: none
584
+ }
585
+ :is(button,a.cr-button,.cr-control,.cr-field-shell,.cr-resin-haze,.cr-status)::after {
586
+ display: none
587
+ }
588
+ span.cr-field-shell::after {
589
+ display: none;
590
+ }
591
+ .cr-indicator {
592
+ background: var(--cr-surface);
593
+ backdrop-filter: none
594
+ }
595
+ .cr-indicator::before {
596
+ filter: none
597
+ }
598
+ }
599
+ }
600
+
601
+ @layer crystal.component {
602
+ @media (forced-colors:active) {
603
+ :is(button,a.cr-button,.cr-control,.cr-field-shell,input) {
604
+ background: Canvas!important;
605
+ color: CanvasText!important;
606
+ border: 1px solid ButtonText;
607
+ box-shadow: none;
608
+ backdrop-filter: none
609
+ }
610
+ :is(button,a.cr-button,.cr-control,.cr-field-shell,.cr-resin-haze,.cr-status)::before,:is(button,a.cr-button,.cr-control,.cr-field-shell,.cr-resin-haze,.cr-status)::after {
611
+ display: none
612
+ }
613
+ span.cr-field-shell {
614
+ border: 1px solid ButtonText
615
+ }
616
+ span.cr-field-shell::after {
617
+ display: none
618
+ }
619
+ .cr-indicator {
620
+ background: Canvas;
621
+ color: CanvasText;
622
+ border: 1px solid ButtonText;
623
+ box-shadow: none;
624
+ backdrop-filter: none
625
+ }
626
+ .cr-indicator::before {
627
+ display: none
628
+ }
629
+ span.cr-field-shell:focus-within {
630
+ outline: 2px solid Highlight;
631
+ box-shadow: none
632
+ }
633
+ }
634
+ }
635
+
636
+ @layer crystal.component {
637
+ @media (max-width:600px) {
638
+ .cr-tag {
639
+ padding: 10px 15px;
640
+ min-height: 40px;
641
+ white-space: nowrap
642
+ }
643
+ }
644
+ }
645
+
646
+
647
+ /* ---------------------------------------------------------------------------
648
+ Second adoption pass — 21 September 2026, D-11's third divergence.
649
+
650
+ The first pass lifted the Resin interaction surface and five components the
651
+ preview defined and the library did not, and was verified by rendering the
652
+ site both ways and finding the pixels identical. That proved the lift was
653
+ faithful. It proved nothing about what `controls.css` still overrode once
654
+ the lift had landed, because both sides of that comparison kept the sheet.
655
+
656
+ Measuring the residual — library 2.1.0, the stripped sheet as the only
657
+ variable — found a great deal. Three attempts to classify it by selector
658
+ shape gave three different answers (29, 51, and still leaking), so the
659
+ question was inverted: a rule belongs to the preview only if it names a
660
+ class or id outside Crystal's `cr-` namespace, and everything else is the
661
+ library's. That fails closed, the way discovery-by-list does.
662
+
663
+ The partition is **75 rules and 238 declarations** here, 50 rules left with
664
+ the preview, 2 dropped. This block is generated from `controls.css` by that
665
+ partition rather than transcribed, so the two sides cannot drift.
666
+
667
+ What the library turned out to be missing, beyond geometry: it styled no
668
+ native form control at all — no checkbox, radio, range, file button, select
669
+ option or menu item lived here, only in the preview.
670
+
671
+ Three exceptions, each decided rather than derived:
672
+
673
+ · `:not(.swatch)` is stripped from the sheen selector. `.swatch` is the
674
+ preview's; the sheen is Crystal's. The preview keeps its swatches flush
675
+ with a rule of its own.
676
+ · `.cr-dock-inner` stays with the preview. `components.md` says it shares
677
+ the Stone recipe; `materials.md` says a label on a Resin dock takes its
678
+ own chip. The preview follows one and the library the other, and the
679
+ preview's rule is measurably too broad — it also blanks
680
+ `.cr-dock-inner.cr-stone`, the preview's own "Stone on Resin" specimen.
681
+ That is Meridian's line to draw, and it is filed rather than guessed.
682
+ · `.cr-button.danger`'s neutralisation is dropped from both. It styles
683
+ nothing on the preview, and status colours are never redefined. The danger
684
+ boundary below comes from `components.md`, not from the preview.
685
+ --------------------------------------------------------------------------- */
686
+ @layer crystal.component {
687
+
688
+ /* Destructive actions take the Resin/Haze surface every button has, plus the
689
+ independent danger boundary components.md requires. The reset layer used to
690
+ ask for a danger *fill*; the component layer has silently outranked it since
691
+ the surface was adopted, which left a danger button indistinguishable from
692
+ any other button in the library. The boundary is the documented carrier. */
693
+ .cr-button.danger {
694
+ border-color: var(--cr-danger-ink)
695
+ }
696
+
697
+ /* The primary action's *reading fill* is the primary colour.
698
+ *
699
+ * Meridian, 22 September 2026, twice. First: "the Haze content fill should adopt
700
+ * the primary color, not the rim. The text color will need to be adjusted
701
+ * depending on the primary color." Then, against the first attempt: "the Primary
702
+ * button now has no Haze content fill … return Primary's Haze content fill, and
703
+ * make the color of that content fill the primary color."
704
+ *
705
+ * What was wrong before either of those: the reset layer asked for
706
+ * `background:var(--cr-primary)` on `.cr-button`, and the Resin control rule in
707
+ * this layer has outranked it since the surface was adopted — so the primary
708
+ * colour survived only as the 8px ring of element background left exposed around
709
+ * an inset, white Haze fill, with white `onPrimary` text sitting on that white
710
+ * fill. The colour was in the rim by accident and the label was barely legible.
711
+ *
712
+ * What was wrong with the first attempt: it used `--cr-haze-own-fill`, the
713
+ * palette's content-own surface at Haze's 80%. That is a *soft* tone, and over
714
+ * Crystal's own light atmosphere an 80% soft tone is within a few percent of the
715
+ * Resin shell around it. The fill was there and nobody could see it — which is
716
+ * what Meridian reported, and it is also not "the primary color".
717
+ *
718
+ * So the fill is `--cr-primary` itself, and the ink is `--cr-on-primary`: the
719
+ * palette's own tested pair, which `validate-tokens` already holds across all six
720
+ * palettes and both modes. Measured against the rendered composite it is 4.74 to
721
+ * 10.31, tightest on Ion in light mode.
722
+ *
723
+ * The fill is opaque where Haze's neutral fill is 80%, and that is the one
724
+ * deliberate deviation here rather than an oversight. An 80% fill transmits a
725
+ * fifth of whatever is behind it; white over a light page is still white, so the
726
+ * neutral pad loses nothing, but a mid-tone primary at 80% over the Resin shell
727
+ * composites to a washed-out lilac that sits at the exact luminance where neither
728
+ * a white nor a near-black label clears 4.5 — measured, it is 3.37 to 4.55 with
729
+ * `onPrimary` and 2.95 to 5.06 with `text`, failing in every light palette. A
730
+ * reading ground whose whole job is to make the label independent of the backdrop
731
+ * cannot be the one thing that depends on it.
732
+ *
733
+ * The rim stays the Resin rim. The colour is in the fill; the perimeter is glass,
734
+ * the same glass every other control has.
735
+ *
736
+ * The tint is opt-in, on `.primary`, rather than applying to any button that is
737
+ * not something else. It used to read `:not(.secondary):not(.quiet):not(.danger)`,
738
+ * which was one forgotten modifier away from painting the whole surface, and it
739
+ * named `.secondary` — a variant Crystal withdrew when it was established that
740
+ * the palettes define one action pair and no second one.
741
+ */
742
+ .cr-button.primary {
743
+ color: var(--cr-on-primary)
744
+ }
745
+ .cr-button.primary::before {
746
+ background: var(--cr-primary)
747
+ }
748
+
749
+ /* A quiet button has no Haze reading fill.
750
+ *
751
+ * Meridian, 22 September 2026: "remove the Haze content fill from the Quiet
752
+ * buttons." With the pad gone, quiet is the only one of the four that is glass
753
+ * all the way through — a Resin shell, its rim, its float shadow and its sheen,
754
+ * and the label directly on the material. That is what makes it quiet, and it is
755
+ * the distinction that was missing when quiet took the base surface an hour
756
+ * earlier: primary is tinted, secondary is the neutral pad, quiet is neither.
757
+ *
758
+ * The consequence is worth stating where it lives rather than being discovered.
759
+ * The pad is what makes a label's contrast independent of whatever is behind the
760
+ * control; without it the label reads against the Resin fill and therefore
761
+ * against the backdrop. On Crystal's own foundation that is a wide margin —
762
+ * measured across all six palettes and both modes, `--cr-text` over the Resin
763
+ * fill over canvas, surface, surface-alt and foundation is 10.88 to 18.28 — but
764
+ * a quiet button placed over artwork has no protected ground, and that is the
765
+ * one composition to avoid.
766
+ */
767
+ .cr-button.quiet::before {
768
+ display: none
769
+ }
770
+
771
+ :is(button,a.cr-button,.cr-control)::after {
772
+ inset:2px;
773
+ filter:blur(2px);
774
+ box-shadow:none
775
+ }
776
+ :is(button,a.cr-button) {
777
+ min-height:48px
778
+ }
779
+ :is(button,a.cr-button):hover {
780
+ background:var(--cr-resin-fill);
781
+ filter:none
782
+ }
783
+ :is(button[aria-pressed=true],button[aria-selected=true],button[aria-checked=true]) {
784
+ color:var(--cr-on-primary)
785
+ }
786
+ :is(button[aria-pressed=true],button[aria-selected=true],button[aria-checked=true])::before {
787
+ background:var(--cr-primary);
788
+ filter:none
789
+ }
790
+ :is(button[aria-pressed=true],button[aria-selected=true],button[aria-checked=true]) {
791
+ text-decoration:none
792
+ }
793
+ select option {
794
+ background:var(--cr-surface);
795
+ color:var(--cr-text)
796
+ }
797
+ input:is([type=checkbox],[type=radio]) {
798
+ appearance:none;
799
+ width:26px;
800
+ height:26px;
801
+ flex:none;
802
+ vertical-align:middle;
803
+ border:1px solid var(--cr-rim);
804
+ border-radius:9px;
805
+ background:linear-gradient(135deg,var(--cr-control-light),var(--cr-control-color)),var(--cr-resin-fill);
806
+ backdrop-filter:blur(20px);
807
+ box-shadow:inset 0 2px 2px var(--cr-rim),0 2px 3px var(--cr-control-edge),0 5px 10px var(--cr-shadow-contact);
808
+ display:inline-grid;
809
+ place-items:center
810
+ }
811
+ input[type=radio] {
812
+ border-radius:50%
813
+ }
814
+ input:is([type=checkbox],[type=radio])::after {
815
+ content:'';
816
+ box-sizing:border-box;
817
+ width:14px;
818
+ height:14px;
819
+ border:2px solid var(--cr-primary);
820
+ border-radius:4px;
821
+ background:var(--cr-surface)
822
+ }
823
+ input[type=radio]::after {
824
+ border-radius:50%
825
+ }
826
+ input[type=checkbox]:checked::after {
827
+ content:'✓';
828
+ font-size:14px;
829
+ font-weight:800;
830
+ background:var(--cr-primary);
831
+ color:var(--cr-on-primary);
832
+ border:0;
833
+ line-height:18px;
834
+ width:18px;
835
+ height:18px;
836
+ text-align:center
837
+ }
838
+ input[type=radio]:checked::after {
839
+ background:var(--cr-primary);
840
+ box-shadow:inset 0 0 0 3px var(--cr-surface)
841
+ }
842
+ input[type=range] {
843
+ appearance:none;
844
+ background:transparent;
845
+ min-height:32px;
846
+ --cr-range-progress:50%
847
+ }
848
+ input[type=range]::-webkit-slider-runnable-track {
849
+ height:8px;
850
+ border:0;
851
+ border-radius:99px;
852
+ background:linear-gradient(to right,var(--cr-primary) 0 var(--cr-range-progress),var(--cr-primary-soft) var(--cr-range-progress) 100%);
853
+ box-shadow:0 -1px 0 var(--cr-rim),0 2px 4px var(--cr-control-edge)
854
+ }
855
+ input[type=range]::-webkit-slider-thumb {
856
+ appearance:none;
857
+ width:26px;
858
+ height:26px;
859
+ margin-top:-9px;
860
+ border-radius:50%;
861
+ border:2px solid var(--cr-rim);
862
+ background:radial-gradient(circle,var(--cr-primary) 0 3px,var(--cr-surface) 3.5px 7px,transparent 8px),linear-gradient(135deg,var(--cr-control-light),var(--cr-control-color)),var(--cr-resin-fill);
863
+ box-shadow:inset 0 2px 1px var(--cr-rim),0 2px 4px var(--cr-control-edge),0 5px 10px var(--cr-shadow-cast)
864
+ }
865
+ input[type=range]::-moz-range-track {
866
+ height:8px;
867
+ border:0;
868
+ border-radius:99px;
869
+ background:var(--cr-primary-soft);
870
+ box-shadow:0 -1px 0 var(--cr-rim),0 2px 4px var(--cr-control-edge)
871
+ }
872
+ input[type=range]::-moz-range-progress {
873
+ height:8px;
874
+ border-radius:99px;
875
+ background:var(--cr-primary)
876
+ }
877
+ input[type=range]::-moz-range-thumb {
878
+ width:26px;
879
+ height:26px;
880
+ border-radius:50%;
881
+ border:2px solid var(--cr-rim);
882
+ background:radial-gradient(circle,var(--cr-primary) 0 3px,var(--cr-surface) 3.5px 7px,transparent 8px),linear-gradient(135deg,var(--cr-control-light),var(--cr-control-color)),var(--cr-resin-fill);
883
+ box-shadow:inset 0 2px 1px var(--cr-rim),0 2px 4px var(--cr-control-edge),0 5px 10px var(--cr-shadow-cast)
884
+ }
885
+ :root[dir=rtl] body input[type=range]::-webkit-slider-runnable-track {
886
+ background:linear-gradient(to left,var(--cr-primary) 0 var(--cr-range-progress),var(--cr-primary-soft) var(--cr-range-progress) 100%)
887
+ }
888
+ .cr-status {
889
+ padding:10px 14px;
890
+ min-height:36px
891
+ }
892
+ input[type=file]::file-selector-button {
893
+ min-height:44px;
894
+ padding:10px 16px;
895
+ border:1px solid var(--cr-rim);
896
+ border-radius:99px;
897
+ color:var(--cr-text);
898
+ background:linear-gradient(var(--cr-haze-fill),var(--cr-haze-fill)) padding-box,var(--cr-resin-fill);
899
+ box-shadow:inset 1px 1px 2px var(--cr-rim),0 4px 8px var(--cr-shadow-contact);
900
+ margin-inline-end:8px;
901
+ cursor:pointer
902
+ }
903
+ .cr-button {
904
+ padding:15px 24px
905
+ }
906
+ .cr-dock {
907
+ position:relative;
908
+ isolation:isolate;
909
+ background:var(--cr-resin-fill);
910
+ border:1px solid var(--cr-rim);
911
+ border-radius:999px;
912
+ padding:9px;
913
+ gap:4px;
914
+ box-shadow:var(--cr-shadow-float);
915
+ backdrop-filter:blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation))
916
+ }
917
+ .cr-dock::before {
918
+ content:'';
919
+ position:absolute;
920
+ inset:var(--cr-haze-inset);
921
+ border-radius:inherit;
922
+ z-index:-1;
923
+ background:var(--cr-haze-fill);
924
+ filter:blur(var(--cr-haze-feather));
925
+ pointer-events:none
926
+ }
927
+ .cr-dock button {
928
+ border:0;
929
+ background:transparent;
930
+ box-shadow:none;
931
+ backdrop-filter:none;
932
+ -webkit-backdrop-filter:none;
933
+ border-radius:999px;
934
+ color:var(--cr-text)
935
+ }
936
+ .cr-dock button::before,
937
+ .cr-dock button::after {
938
+ display:none
939
+ }
940
+ .cr-dock button:is([aria-pressed=true],[aria-selected=true]) {
941
+ background:var(--cr-primary);
942
+ color:var(--cr-on-primary);
943
+ box-shadow:0 3px 7px var(--cr-shadow-contact)
944
+ }
945
+ .cr-dock button {
946
+ min-height:52px;
947
+ padding:13px 18px
948
+ }
949
+ [role=menu] button {
950
+ padding-inline-start:24px
951
+ }
952
+ [data-effects=opaque] .cr-dock {
953
+ background:var(--cr-surface);
954
+ backdrop-filter:none
955
+ }
956
+ span.cr-status {
957
+ border-color:var(--cr-rim);
958
+ border-radius:18px;
959
+ padding:12px 18px
960
+ }
961
+ span.cr-status>span {
962
+ display:inline-grid;
963
+ place-items:center;
964
+ min-width:24px;
965
+ height:24px;
966
+ border-radius:50%;
967
+ background:var(--status-surface);
968
+ color:var(--status-ink);
969
+ font-weight:800
970
+ }
971
+ .cr-dialog {
972
+ border-color:var(--cr-rim)
973
+ }
974
+ :is(button,a,input,select,textarea,summary,[tabindex]):focus-visible,
975
+ .cr-dock button:focus-visible {
976
+ outline:2px solid var(--cr-focus-core);
977
+ outline-offset:3px;
978
+ box-shadow:inset 0 2px 1px var(--cr-rim),var(--cr-focus-ring)
979
+ }
980
+ :is(button[aria-pressed=true],button[aria-selected=true],button[aria-checked=true],[role=tab][aria-selected=true]) {
981
+ font-weight:800
982
+ }
983
+ .cr-table-scroll {
984
+ position:relative;
985
+ isolation:isolate;
986
+ overflow:auto;
987
+ max-width:100%;
988
+ border:1px solid var(--cr-rim);
989
+ border-radius:var(--cr-radius);
990
+ background:var(--cr-resin-fill);
991
+ box-shadow:var(--cr-shadow-content);
992
+ backdrop-filter:blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation));
993
+ -webkit-backdrop-filter:blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation))
994
+ }
995
+ .cr-table-scroll::before {
996
+ content:'';
997
+ position:absolute;
998
+ inset:6px;
999
+ z-index:-1;
1000
+ pointer-events:none;
1001
+ border-radius:inherit;
1002
+ background:var(--cr-haze-fill);
1003
+ filter:blur(var(--cr-haze-feather))
1004
+ }
1005
+ .cr-table {
1006
+ width:100%;
1007
+ border-collapse:separate;
1008
+ border-spacing:0;
1009
+ background:transparent;
1010
+ box-shadow:none;
1011
+ border:0
1012
+ }
1013
+ .cr-table :is(th,td) {
1014
+ border:0;
1015
+ border-bottom:1px solid var(--cr-edge);
1016
+ padding:14px 18px;
1017
+ text-align:start;
1018
+ vertical-align:top;
1019
+ background:transparent
1020
+ }
1021
+ .cr-table thead th {
1022
+ position:sticky;
1023
+ top:0;
1024
+ z-index:1;
1025
+ background:var(--cr-primary-soft);
1026
+ color:var(--cr-on-primary-soft);
1027
+ font-weight:800;
1028
+ border-bottom:0
1029
+ }
1030
+ .cr-table thead th:first-child {
1031
+ border-start-start-radius:calc(var(--cr-radius) - 8px)
1032
+ }
1033
+ .cr-table thead th:last-child {
1034
+ border-start-end-radius:calc(var(--cr-radius) - 8px)
1035
+ }
1036
+ .cr-table tbody tr:last-child :is(th,td) {
1037
+ border-bottom:0
1038
+ }
1039
+ .cr-table-properties tbody tr:first-child :is(th,td) {
1040
+ padding-top:18px
1041
+ }
1042
+ .cr-table-properties th[scope=row] {
1043
+ width:11.5rem;
1044
+ font-weight:800;
1045
+ color:var(--cr-text)
1046
+ }
1047
+ .cr-table-properties td {
1048
+ color:var(--cr-muted)
1049
+ }
1050
+ .cr-table tbody tr:hover :is(th,td) {
1051
+ background:var(--cr-label-fill)
1052
+ }
1053
+ .cr-table caption {
1054
+ caption-side:top;
1055
+ text-align:start;
1056
+ padding:14px 18px 6px;
1057
+ font-size:13px;
1058
+ color:var(--cr-muted)
1059
+ }
1060
+ [data-effects=opaque] .cr-table-scroll {
1061
+ background:var(--cr-surface);
1062
+ backdrop-filter:none;
1063
+ -webkit-backdrop-filter:none
1064
+ }
1065
+ [data-effects=opaque] .cr-table-scroll::before {
1066
+ display:none
1067
+ }
1068
+
1069
+ @media (max-width:600px) {
1070
+ .cr-dock {
1071
+ padding:7px
1072
+ }
1073
+ .cr-dock button {
1074
+ padding:10px 9px;
1075
+ font-size:11px;
1076
+ min-height:44px
1077
+ }
1078
+ .cr-table-properties th[scope=row] {
1079
+ width:auto
1080
+ }
1081
+ .cr-table-properties tr {
1082
+ display:grid
1083
+ }
1084
+ .cr-table-properties :is(th,td) {
1085
+ border-bottom:0
1086
+ }
1087
+ .cr-table-properties td {
1088
+ padding-top:0;
1089
+ padding-bottom:14px;
1090
+ border-bottom:1px solid var(--cr-edge)
1091
+ }
1092
+ .cr-table :is(th,td) {
1093
+ padding:11px 13px
1094
+ }
1095
+ }
1096
+
1097
+ @media (forced-colors:active) {
1098
+ input:is([type=checkbox],[type=radio]) {
1099
+ appearance:auto
1100
+ }
1101
+ input:is([type=checkbox],[type=radio])::after {
1102
+ display:none
1103
+ }
1104
+ .cr-dock {
1105
+ background:Canvas;
1106
+ border:1px solid ButtonText;
1107
+ box-shadow:none;
1108
+ backdrop-filter:none
1109
+ }
1110
+ .cr-dock::before {
1111
+ display:none
1112
+ }
1113
+ .cr-dock button:is([aria-pressed=true],[aria-selected=true]) {
1114
+ background:Canvas;
1115
+ color:CanvasText;
1116
+ outline:2px solid Highlight;
1117
+ outline-offset:-3px
1118
+ }
1119
+ input[type=range] {
1120
+ appearance:auto
1121
+ }
1122
+ input[type=range]::-webkit-slider-runnable-track {
1123
+ background:CanvasText
1124
+ }
1125
+ input[type=range]::-webkit-slider-thumb {
1126
+ background:ButtonText;
1127
+ border-color:Canvas
1128
+ }
1129
+ span.cr-status>span {
1130
+ background:Canvas;
1131
+ color:CanvasText
1132
+ }
1133
+ :is(button,a,input,select,textarea,summary,[tabindex]):focus-visible,
1134
+ .cr-dock button:focus-visible {
1135
+ outline:2px solid Highlight;
1136
+ box-shadow:none
1137
+ }
1138
+ .cr-table-scroll {
1139
+ background:Canvas;
1140
+ border:1px solid CanvasText;
1141
+ box-shadow:none;
1142
+ backdrop-filter:none
1143
+ }
1144
+ .cr-table-scroll::before {
1145
+ display:none
1146
+ }
1147
+ .cr-table :is(th,td) {
1148
+ border-bottom:1px solid CanvasText
1149
+ }
1150
+ .cr-table thead th {
1151
+ background:Canvas;
1152
+ color:CanvasText;
1153
+ border-bottom:1px solid CanvasText
1154
+ }
1155
+ }
1156
+
1157
+ @media (prefers-reduced-transparency:reduce) {
1158
+ .cr-dock {
1159
+ background:var(--cr-surface);
1160
+ backdrop-filter:none
1161
+ }
1162
+ .cr-table-scroll {
1163
+ background:var(--cr-surface);
1164
+ backdrop-filter:none;
1165
+ -webkit-backdrop-filter:none
1166
+ }
1167
+ .cr-table-scroll::before {
1168
+ display:none
1169
+ }
1170
+ }
1171
+ }
1172
+
1173
+
1174
+ /* ---------------------------------------------------------------------------
1175
+ Component recipes for the catalogue — 28 September 2026.
1176
+
1177
+ `core/tokens/surfaces.json` names the closed set of material compositions a
1178
+ component may be made of, and every catalogue entry now says which it is.
1179
+ Most of the vocabulary was already here. Four compositions were not, and
1180
+ each was found the same way: Crystal React reached a component the catalogue
1181
+ specified, looked for the recipe, and rebuilt it locally with a comment
1182
+ saying Crystal had none. The R-19 sweep named them — a navigation link, a
1183
+ nav rail item, a drag handle, and the "bare" control that eighteen distinct
1184
+ controls and 127 instances had been approximating with `background:
1185
+ transparent`, which takes off one layer of the Resin coat and leaves four.
1186
+
1187
+ Each recipe is authored here, in `@layer crystal.component`, and nowhere
1188
+ else. Not in `crystal.reset`: D-20 and D-21 were both rules authored there
1189
+ that this layer erased, and a recipe that may not render is worse than none.
1190
+
1191
+ Everything reads tokens where a token exists and falls back to the literal
1192
+ the token publishes, so a stylesheet loaded without the generated theme
1193
+ still renders the same recipe.
1194
+ --------------------------------------------------------------------------- */
1195
+ @layer crystal.component {
1196
+
1197
+ /* A bare control.
1198
+ *
1199
+ * Selector note, which applies to the three recipes below: the coat is keyed on
1200
+ * `:is(button, a.cr-button, …)`, specificity (0,1,1), in this same layer. A lone
1201
+ * class is (0,1,0) and loses to it whatever the source order — measured, a
1202
+ * `<button class="cr-bare">` kept the fill, the rim and the blur. Each recipe
1203
+ * therefore carries the element compound and reaches (0,2,0). A rule that must
1204
+ * beat the coat and does not say so in its selector is D-20 by another route.
1205
+ *
1206
+ * Crystal paints the Resin coat by element — `:is(button, …)` above — so a
1207
+ * `<button>` wears the fill, the rim, the float shadow, the backdrop blur and
1208
+ * both feathered pseudo-layers whether or not anything asked. A control that
1209
+ * sits inside a surface which already has a coat must not wear a second one: a
1210
+ * disclosure chevron, a chip's remove button, a sort header, a stepper's arrows,
1211
+ * the dismiss button on a toast. Declaring `background: transparent` on one of
1212
+ * those takes off one layer of five. This takes off all five and keeps what a
1213
+ * control still owes — the 44px target, the pill hit area, the focus ring.
1214
+ *
1215
+ * It is not `.cr-button.quiet`. Quiet keeps the whole shell and drops only the
1216
+ * reading pad, which is what makes a quiet *button* quiet; a chevron is not a
1217
+ * Resin control that has been quietened.
1218
+ */
1219
+ :is(button, a, [role=button], .cr-bare).cr-bare {
1220
+ display: inline-flex;
1221
+ align-items: center;
1222
+ justify-content: center;
1223
+ gap: 8px;
1224
+ min-inline-size: 44px;
1225
+ min-block-size: 44px;
1226
+ padding: 0 10px;
1227
+ border: 1px solid transparent;
1228
+ border-radius: 999px;
1229
+ background: transparent;
1230
+ color: inherit;
1231
+ backdrop-filter: none;
1232
+ -webkit-backdrop-filter: none;
1233
+ filter: none;
1234
+ font-weight: inherit;
1235
+ }
1236
+ .cr-bare::before,
1237
+ .cr-bare::after {
1238
+ content: none;
1239
+ display: none;
1240
+ }
1241
+ /* Resting state only: focus is a box-shadow recipe, and a blanket `none`
1242
+ would silently reduce it to a bare outline. */
1243
+ .cr-bare:not(:focus-visible) {
1244
+ box-shadow: none;
1245
+ }
1246
+ .cr-bare:hover:not(:disabled):not([aria-disabled=true]) {
1247
+ background: var(--cr-surface-alt);
1248
+ filter: none;
1249
+ }
1250
+ /* An on state without a reading pad has nothing to tint, so it takes the
1251
+ weight half of the selection rule and keeps the surface ink — the element
1252
+ rule above would otherwise leave on-primary ink on a transparent ground. */
1253
+ .cr-bare:is([aria-pressed=true],[aria-selected=true],[aria-checked=true]) {
1254
+ color: var(--cr-text);
1255
+ font-weight: 800;
1256
+ }
1257
+
1258
+ /* A drag handle: a bare control with a grip and a lift while it is held.
1259
+ * Pointer capture, the keyboard alternative and drop validation are the
1260
+ * product's; the handle says only that it can be grabbed and when it has been. */
1261
+ :is(button, [role=button], .cr-drag-handle).cr-drag-handle {
1262
+ cursor: grab;
1263
+ touch-action: none;
1264
+ color: var(--cr-muted);
1265
+ padding: 12px 16px;
1266
+ background-image: radial-gradient(circle at center, currentColor 1.25px, transparent 1.75px);
1267
+ background-size: 6px 6px;
1268
+ background-repeat: repeat;
1269
+ background-position: center;
1270
+ background-clip: content-box;
1271
+ background-color: transparent;
1272
+ }
1273
+ .cr-drag-handle:hover:not([aria-disabled=true]) {
1274
+ color: var(--cr-text);
1275
+ }
1276
+ .cr-drag-handle:is([aria-grabbed=true],[data-dragging],[data-dragging=true]) {
1277
+ cursor: grabbing;
1278
+ color: var(--cr-text);
1279
+ background-color: var(--cr-surface);
1280
+ box-shadow: var(--cr-shadow-float);
1281
+ }
1282
+
1283
+ /* A navigation entry.
1284
+ *
1285
+ * `docs/components.md` names the documentation site's side menu as the
1286
+ * reference implementation of selection, and until now that recipe lived only
1287
+ * in the site's own stylesheet — the same shape as D-9, a specification only
1288
+ * one renderer could read. Lifted from `crystal-preview` `.menu-item` as it
1289
+ * renders: an entry is furniture on the panel beneath it, so it has no material
1290
+ * of its own and no Resin coat. Thirteen floating capsules in a sidebar would
1291
+ * be exactly the legibility noise the hierarchy exists to prevent. The pill
1292
+ * geometry stays, because "go here" is an action.
1293
+ *
1294
+ * Selection is label weight, 650 at rest and 800 when current. Nothing is drawn
1295
+ * beside the label. `.stacked` puts the icon above the label for a rail.
1296
+ */
1297
+ :is(button, a, [role=link], .cr-nav-item).cr-nav-item {
1298
+ position: relative;
1299
+ display: inline-flex;
1300
+ align-items: center;
1301
+ justify-content: flex-start;
1302
+ gap: 10px;
1303
+ min-height: 44px;
1304
+ padding: 10px 14px;
1305
+ border: 1px solid transparent;
1306
+ border-radius: 999px;
1307
+ background: transparent;
1308
+ color: var(--cr-muted);
1309
+ font-size: 14px;
1310
+ font-weight: 650;
1311
+ line-height: 1.35;
1312
+ text-align: start;
1313
+ text-decoration: none;
1314
+ backdrop-filter: none;
1315
+ -webkit-backdrop-filter: none;
1316
+ filter: none;
1317
+ }
1318
+ .cr-nav-item::before,
1319
+ .cr-nav-item::after {
1320
+ content: none;
1321
+ display: none;
1322
+ }
1323
+ .cr-nav-item:not(:focus-visible) {
1324
+ box-shadow: none;
1325
+ }
1326
+ .cr-nav-item:hover:not([aria-disabled=true]) {
1327
+ background: var(--cr-surface-alt);
1328
+ color: var(--cr-text);
1329
+ filter: none;
1330
+ }
1331
+ .cr-nav-item:is([aria-current]:not([aria-current=false]),[aria-selected=true],[aria-pressed=true]) {
1332
+ background: var(--cr-surface-alt);
1333
+ color: var(--cr-text);
1334
+ font-weight: 800;
1335
+ }
1336
+ .cr-nav-item.stacked {
1337
+ flex-direction: column;
1338
+ justify-content: center;
1339
+ gap: 4px;
1340
+ min-width: 64px;
1341
+ padding: 8px 10px;
1342
+ font-size: 12px;
1343
+ line-height: 1.25;
1344
+ }
1345
+ .cr-nav-item svg {
1346
+ width: 24px;
1347
+ height: 24px;
1348
+ }
1349
+
1350
+ /* A Resin panel: the Resin plane with the content radius instead of the pill,
1351
+ for a floating control plane that is a rectangle — a floating window, a wide
1352
+ media control bar. Fill, rim, blur and shadow are the plane's; only the
1353
+ geometry changes, and it matches the Frost panel's so nested radii line up. */
1354
+ :is(.cr-resin,.cr-glass).panel {
1355
+ border-radius: calc(var(--cr-radius) + 6px);
1356
+ }
1357
+
1358
+ /* A switch is a checkbox with a track. Native `<input type=checkbox
1359
+ role=switch>`, styled by element like the checkbox and radio above: the
1360
+ track is the Resin box stretched to the published track size, the thumb is
1361
+ the opaque surface with the contact shadow, and the on state is the
1362
+ primary-soft pair. The thumb travels the difference between the two
1363
+ dimensions, so changing either token moves it correctly. */
1364
+ input[type=checkbox][role=switch] {
1365
+ width: var(--cr-switch-track-width, 44px);
1366
+ height: var(--cr-switch-track-height, 28px);
1367
+ border-radius: 999px;
1368
+ display: inline-block;
1369
+ position: relative;
1370
+ }
1371
+ input[type=checkbox][role=switch]::after {
1372
+ content: '';
1373
+ position: absolute;
1374
+ inset-block-start: 2px;
1375
+ inset-inline-start: 2px;
1376
+ width: calc(var(--cr-switch-track-height, 28px) - 6px);
1377
+ height: calc(var(--cr-switch-track-height, 28px) - 6px);
1378
+ border: 0;
1379
+ border-radius: 50%;
1380
+ background: var(--cr-surface);
1381
+ box-shadow: 0 2px 4px var(--cr-control-edge), 0 4px 8px var(--cr-shadow-contact);
1382
+ transition: translate var(--cr-state) var(--cr-ease-settle);
1383
+ }
1384
+ input[type=checkbox][role=switch]:checked {
1385
+ background: var(--cr-primary-soft);
1386
+ }
1387
+ input[type=checkbox][role=switch]:checked::after {
1388
+ content: '';
1389
+ width: calc(var(--cr-switch-track-height, 28px) - 6px);
1390
+ height: calc(var(--cr-switch-track-height, 28px) - 6px);
1391
+ background: var(--cr-primary);
1392
+ box-shadow: 0 2px 4px var(--cr-control-edge), 0 4px 8px var(--cr-shadow-contact);
1393
+ translate: calc(var(--cr-switch-track-width, 44px) - var(--cr-switch-track-height, 28px)) 0;
1394
+ }
1395
+ :root[dir=rtl] input[type=checkbox][role=switch]:checked::after {
1396
+ translate: calc(var(--cr-switch-track-height, 28px) - var(--cr-switch-track-width, 44px)) 0;
1397
+ }
1398
+
1399
+ /* The checkbox and radio read their geometry from the tokens that publish it,
1400
+ with the literal the token publishes as the fallback. Same rendering; one
1401
+ source. */
1402
+ input:is([type=checkbox],[type=radio]) {
1403
+ width: var(--cr-choice-box-size, 26px);
1404
+ height: var(--cr-choice-box-size, 26px);
1405
+ border-radius: var(--cr-choice-box-radius, 9px);
1406
+ }
1407
+ input[type=radio] {
1408
+ border-radius: 50%;
1409
+ }
1410
+
1411
+ /* Disabled. The reset layer dims a native `button:disabled` and nothing else,
1412
+ so an action link, a control span and a navigation entry had no disabled
1413
+ state at all. The opacity is the published token; a disabled element must
1414
+ still not be the only explanation of unavailability, and the product still
1415
+ has to refuse the action — this only shows that it will. */
1416
+ button:disabled,
1417
+ :is(a.cr-button,.cr-control,.cr-nav-item,.cr-bare,.cr-drag-handle)[aria-disabled=true] {
1418
+ opacity: var(--cr-action-disabled-opacity, .55);
1419
+ cursor: not-allowed;
1420
+ filter: none;
1421
+ }
1422
+
1423
+ /* Controls inside a Resin plane lose their own backdrop filter — the rule above
1424
+ lists the action controls, and these are controls too. */
1425
+ :is(.cr-resin,.cr-glass,.cr-resin-haze) :is(.cr-bare,.cr-nav-item,.cr-drag-handle) {
1426
+ backdrop-filter: none;
1427
+ -webkit-backdrop-filter: none;
1428
+ isolation: isolate;
1429
+ }
1430
+
1431
+ @media (prefers-reduced-transparency:reduce) {
1432
+ .cr-drag-handle:is([aria-grabbed=true],[data-dragging],[data-dragging=true]) {
1433
+ background-color: var(--cr-surface);
1434
+ }
1435
+ }
1436
+
1437
+ @media (forced-colors:active) {
1438
+ /* The current entry is a ring, never a fill: Chromium paints an opaque Canvas
1439
+ backplate behind text runs, above the element's own background, so a filled
1440
+ row loses its label entirely. */
1441
+ .cr-nav-item:is([aria-current]:not([aria-current=false]),[aria-selected=true],[aria-pressed=true]) {
1442
+ background: Canvas;
1443
+ color: CanvasText;
1444
+ outline: 2px solid Highlight;
1445
+ outline-offset: -3px;
1446
+ }
1447
+ .cr-nav-item,
1448
+ .cr-bare {
1449
+ border-color: transparent;
1450
+ box-shadow: none;
1451
+ }
1452
+ .cr-drag-handle:is([aria-grabbed=true],[data-dragging],[data-dragging=true]) {
1453
+ background-color: Canvas;
1454
+ outline: 2px solid Highlight;
1455
+ outline-offset: -3px;
1456
+ box-shadow: none;
1457
+ }
1458
+ input[type=checkbox][role=switch] {
1459
+ appearance: auto;
1460
+ width: auto;
1461
+ height: auto;
1462
+ }
1463
+ }
1464
+ }