@crystal-ui/core 2.3.0 → 2.4.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 (55) hide show
  1. package/README.md +82 -23
  2. package/assets/core/preferences.d.ts +4 -4
  3. package/assets/core/preferences.js +4 -4
  4. package/assets/core/presets.d.ts +4 -3
  5. package/assets/core/presets.js +24 -18
  6. package/assets/core/spring.js +9 -10
  7. package/assets/core/state.js +7 -7
  8. package/assets/crystal.css +784 -284
  9. package/assets/crystal.d.ts +3 -3
  10. package/assets/crystal.js +100 -123
  11. package/assets/icons/heading-2.svg +1 -0
  12. package/assets/icons/heading-3.svg +1 -0
  13. package/assets/icons/heading-4.svg +1 -0
  14. package/assets/icons/link.svg +1 -0
  15. package/assets/icons/list-ordered.svg +1 -0
  16. package/assets/icons/list.svg +1 -0
  17. package/assets/icons/manifest.json +81 -2
  18. package/assets/icons/quote.svg +1 -0
  19. package/assets/icons/redo.svg +1 -0
  20. package/assets/icons/subscript.svg +1 -0
  21. package/assets/icons/undo.svg +1 -0
  22. package/assets/icons/unlink.svg +1 -0
  23. package/assets/motion.js +13 -12
  24. package/docs/accessibility.md +50 -54
  25. package/docs/adoption.md +33 -19
  26. package/docs/catalogue.md +113 -108
  27. package/docs/colors.md +67 -73
  28. package/docs/components.md +142 -66
  29. package/docs/icons.md +9 -3
  30. package/docs/materials.md +129 -117
  31. package/docs/motion-components.md +15 -15
  32. package/docs/motion.md +156 -158
  33. package/docs/principles.md +12 -12
  34. package/docs/tokens.md +129 -130
  35. package/engines.js +3 -3
  36. package/package.json +11 -3
  37. package/tokens/catalogue/01-layout.json +1 -1
  38. package/tokens/catalogue/02-navigation.json +4 -4
  39. package/tokens/catalogue/03-actions.json +2 -1
  40. package/tokens/catalogue/04-inputs.json +30 -22
  41. package/tokens/catalogue/05-data-display.json +9 -14
  42. package/tokens/catalogue/06-feedback.json +8 -6
  43. package/tokens/catalogue/07-overlays.json +4 -4
  44. package/tokens/catalogue/08-typography.json +12 -8
  45. package/tokens/catalogue/09-utility.json +1 -1
  46. package/tokens/catalogue/10-charts.json +7 -7
  47. package/tokens/catalogue/11-media.json +33 -20
  48. package/tokens/catalogue/12-commerce.json +4 -4
  49. package/tokens/catalogue/13-screens.json +2 -3
  50. package/tokens/catalogue/14-blocks.json +3 -3
  51. package/tokens/catalogue.json +176 -116
  52. package/tokens/crystal.tokens.json +6 -6
  53. package/tokens/motion-recipes.json +6 -6
  54. package/tokens/surface-recipes.json +3452 -0
  55. package/tokens/surfaces.json +48 -17
@@ -1,8 +1,8 @@
1
1
  /* Crystal cascade layers, declared once and in precedence order.
2
- reset — element-level defaults Crystal sets on a product root
3
- base — the consuming page's own layout and typography
4
- component — Crystal's controls and material surfaces, which win over base
5
- override — reserved for the consuming product
2
+ reset: element-level defaults Crystal sets on a product root
3
+ base: the consuming page's own layout and typography
4
+ component: Crystal's controls and material surfaces, which win over base
5
+ override: reserved for the consuming product
6
6
  Unlayered CSS beats every layer, so a product needs no specificity contest
7
7
  to override Crystal: an ordinary rule in its own stylesheet is enough. */
8
8
  @layer crystal.reset, crystal.base, crystal.component, crystal.override;
@@ -13,59 +13,52 @@
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
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
- /* Plastic carries a glow of its own — the primary lifted by the scheme's tint —
17
- which is a material property and stays. What was ambient was the glow drifting
18
- across the foundation; that is deferred with the rest of the tier, so the
16
+ /* Plastic has a glow of its own, the primary lifted by the scheme's tint. It is
17
+ a material property and stays. The drift of that glow across the foundation
18
+ is ambient motion, which is deferred with the rest of the tier, so the
19
19
  gradient holds at its resting position. */
20
20
  :is(.cr-plastic,.cr-foundation){background-color:var(--cr-canvas);background-image:radial-gradient(ellipse 58% 44% at 26% 34%,var(--cr-atmosphere-glow),transparent 72%),radial-gradient(ellipse at 5% 12%,var(--cr-atmosphere-one),transparent 64%),radial-gradient(ellipse at 96% 88%,var(--cr-atmosphere-two),transparent 63%);isolation:isolate}
21
21
  :is(.cr-haze,.cr-surface){background:var(--cr-surface);border:1px solid var(--cr-edge);border-radius:var(--cr-radius);box-shadow:var(--cr-shadow-content);color:var(--cr-text)}
22
- :is(.cr-frost,.cr-acrylic),:is(.cr-resin,.cr-glass){position:relative;isolation:isolate;border:1px solid var(--cr-rim);background:var(--cr-frost-fill);box-shadow:var(--cr-shadow-panel);border-radius:calc(var(--cr-radius) + 6px);backdrop-filter:blur(var(--cr-frost-blur)) saturate(var(--cr-frost-saturation));-webkit-backdrop-filter:blur(var(--cr-frost-blur)) saturate(var(--cr-frost-saturation))}
22
+ :is(.cr-frost,.cr-acrylic),:is(.cr-resin,.cr-glass){position:relative;isolation:isolate;border:1px solid var(--cr-rim);background:var(--cr-frost-fill);box-shadow:var(--cr-shadow-panel);border-radius:calc(var(--cr-radius) + 6px);-webkit-backdrop-filter:blur(var(--cr-frost-blur)) saturate(var(--cr-frost-saturation));backdrop-filter:blur(var(--cr-frost-blur)) saturate(var(--cr-frost-saturation))}
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
- :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))}
24
+ :is(.cr-resin,.cr-glass){background:var(--cr-resin-fill);border-radius:999px;box-shadow:var(--cr-shadow-float);-webkit-backdrop-filter:blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation));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
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
- /* The button vocabulary is four names and none of them is a colour Crystal
28
- does not have.
27
+ /* The button vocabulary is four names, and each names a colour role Crystal
28
+ defines.
29
29
 
30
30
  `.cr-button` is the action control: a Resin shell with the neutral Haze
31
31
  reading fill. `.primary` is the one tinted in the palette's action colour,
32
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. */
33
+ destructive boundary. Emphasis is opt-in, because a rule that enumerates
34
+ the variants it must not tint paints every variant it forgets.
35
+
36
+ There is no `.secondary`. It named a second action colour, and Crystal has
37
+ no such role: the palettes publish one action pair, and the companion and
38
+ glow hues are expressive paint that is never assumed to be text-safe. See
39
+ `docs/colors.md`.
40
+
41
+ The bare `.cr-button` does not set `background:var(--cr-primary)` or
42
+ `color:var(--cr-on-primary)` here. The component layer outranks this one,
43
+ so they would not render, and the tint belongs to `.primary`. */
48
44
  .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)}
49
45
  .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
46
  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)}
47
+ in the library reads it there: --cr-outline is consumed by .cr-input,
48
+ .cr-dialog, the Frost/Resin border and the two scrollbar rules, none of
49
+ which can match inside a chip, and the chip's own rim comes from
50
+ --cr-rim. It is kept because the preview carries it and a consumer may
51
+ nest something that reads it. It changes nothing the library renders. */--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)}
57
52
  .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)}
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. */
53
+ .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)}/* A selected dock label has no underline. Selection is carried by label
54
+ weight alone, and the component layer sets text-decoration:none. */
62
55
  .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)}
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}
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}
56
+ .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);-webkit-backdrop-filter:blur(var(--cr-mirage-blur)) saturate(var(--cr-mirage-saturation)) brightness(var(--cr-mirage-brightness));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}
57
+ [data-effects=opaque] :is(.cr-frost,.cr-acrylic),[data-effects=opaque] :is(.cr-resin,.cr-glass){-webkit-backdrop-filter:none;backdrop-filter:none;background:var(--cr-surface);border-color:var(--cr-outline)}[data-effects=opaque] :is(.cr-frost,.cr-acrylic):before{display:none}
65
58
  @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)}}
66
- @media(prefers-reduced-transparency:reduce){:is(.cr-frost,.cr-acrylic),:is(.cr-resin,.cr-glass){background:var(--cr-surface);backdrop-filter:none;-webkit-backdrop-filter:none}:is(.cr-frost,.cr-acrylic):before{display:none}}
59
+ @media(prefers-reduced-transparency:reduce){:is(.cr-frost,.cr-acrylic),:is(.cr-resin,.cr-glass){background:var(--cr-surface);-webkit-backdrop-filter:none;backdrop-filter:none}:is(.cr-frost,.cr-acrylic):before{display:none}}
67
60
  @media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation:none!important;transition:none!important}button:active:not(:disabled){transform:none}}
68
- @media(forced-colors:active){:is(.cr-plastic,.cr-foundation),:is(.cr-haze,.cr-surface),.cr-bubble,:is(.cr-frost,.cr-acrylic),:is(.cr-resin,.cr-glass),.cr-well,.cr-dock-inner{background:Canvas!important;color:CanvasText!important;box-shadow:none!important;backdrop-filter:none!important;border:1px solid CanvasText}:is(.cr-frost,.cr-acrylic):before{display:none}.cr-button,.cr-status{forced-color-adjust:auto;border:1px solid ButtonText}.cr-dock button[aria-pressed=true]{outline:2px solid Highlight}button:focus-visible,a:focus-visible,[tabindex]:focus-visible{outline-color:Highlight}}
61
+ @media(forced-colors:active){:is(.cr-plastic,.cr-foundation),:is(.cr-haze,.cr-surface),.cr-bubble,:is(.cr-frost,.cr-acrylic),:is(.cr-resin,.cr-glass),.cr-well,.cr-dock-inner{background:Canvas!important;color:CanvasText!important;box-shadow:none!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;border:1px solid CanvasText}:is(.cr-frost,.cr-acrylic):before{display:none}.cr-button,.cr-status{forced-color-adjust:auto;border:1px solid ButtonText}.cr-dock button[aria-pressed=true]{outline:2px solid Highlight}button:focus-visible,a:focus-visible,[tabindex]:focus-visible{outline-color:Highlight}}
69
62
 
70
63
  /* Smooth optical body and illuminated rim distinguish Glass from grainy Acrylic. */
71
64
  :is(.cr-resin,.cr-glass)::before{content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;z-index:-1;background:linear-gradient(145deg,rgba(255,255,255,.23),transparent 32%,transparent 69%,rgba(255,255,255,.10))}
@@ -111,9 +104,8 @@ dialog.cr-dialog{position:fixed}
111
104
 
112
105
  /* Scrolling.
113
106
  *
114
- * A scrollbar in Crystal belongs to the material it scrolls, not to the
115
- * operating system. There are two, and which one a surface gets follows the
116
- * hierarchy rather than taste:
107
+ * A scrollbar in Crystal belongs to the material it scrolls. There are two, and
108
+ * the material hierarchy decides which one a surface gets:
117
109
  *
118
110
  * .cr-scroll-frost panels and long reading surfaces. Frost is the
119
111
  * intermediate layer, so a scrollbar on a panel reads as
@@ -122,31 +114,32 @@ dialog.cr-dialog{position:fixed}
122
114
  * scrollers. Resin is the control plane, and a scrollbar
123
115
  * there is a control sitting above content.
124
116
  *
125
- * `.cr-scroll` is the shared behaviour both build on, and is worth applying to
126
- * any scroll container on its own:
117
+ * `.cr-scroll` is the shared behaviour both build on, and can be applied to any
118
+ * scroll container on its own:
127
119
  *
128
120
  * - `overscroll-behavior: contain` stops scroll chaining. On a phone, swiping
129
121
  * a table that has reached its end otherwise scrolls the page underneath,
130
122
  * which reads as the table refusing to move.
131
123
  * - `scrollbar-gutter: stable` keeps content from shifting in the inline
132
- * direction when a vertical scrollbar appears, which is what makes a growing
133
- * list jitter. It is not applied to horizontal-only scrollers, where it
134
- * reserves space against a scrollbar that never arrives — add `.cr-scroll-x`
135
- * to say a scroller is horizontal-only, since CSS cannot work that out.
136
- * - `touch-action: pan-x pan-y` keeps a browser's own gesture handling rather
137
- * than replacing it, so momentum and rubber-banding still feel native.
124
+ * direction when a vertical scrollbar appears, which otherwise makes a
125
+ * growing list jitter. It is not applied to horizontal-only scrollers,
126
+ * where it reserves space for a scrollbar that never arrives. Add
127
+ * `.cr-scroll-x` to say a scroller is horizontal-only, since CSS cannot
128
+ * work that out.
129
+ * - `touch-action: pan-x pan-y` keeps the browser's own gesture handling, so
130
+ * momentum and rubber-banding stay native.
138
131
  *
139
- * What this cannot do is give a scrollbar the actual material. `backdrop-filter`
132
+ * These classes cannot give a scrollbar the material itself. `backdrop-filter`
140
133
  * has no effect on a scrollbar, and the standard properties expose only two
141
- * colours and a coarse width, so what these deliver is the right Frost or Resin
142
- * colour rather than real diffusion. CONTRACT §2 already says a CSS
143
- * approximation is not a native optical specification; a surface that needs the
144
- * true material uses the scroll-area component, which draws its own thumb as a
145
- * real element and can carry the material in full. */
134
+ * colours and a coarse width, so the classes deliver the Frost or Resin colour
135
+ * without the diffusion. CONTRACT §2 says a CSS approximation is not a native
136
+ * optical specification. A surface that needs the true material uses the
137
+ * scroll-area component, which draws its own thumb as a real element and can
138
+ * carry the material in full. */
146
139
  /* A dialog's own code block scrolls too, and a scrollable descendant owes the
147
- contract on its own account: `scrollbar-color` and `scrollbar-width` inherit,
148
- so it already looks right, but `overscroll-behavior` does not — which is the
149
- half that a swipe actually notices. */
140
+ contract itself. `scrollbar-color` and `scrollbar-width` inherit, so it
141
+ already looks right. `overscroll-behavior` does not inherit, so it is set
142
+ here. */
150
143
  .cr-scroll,.cr-scroll-frost,.cr-scroll-resin,.cr-table-scroll,.cr-dialog,.cr-dialog pre{
151
144
  overscroll-behavior:contain;
152
145
  touch-action:pan-x pan-y;
@@ -155,18 +148,22 @@ dialog.cr-dialog{position:fixed}
155
148
  /* The gutter belongs to vertical scrolling only. `scrollbar-gutter` reserves
156
149
  space on the inline edge, where a vertical scrollbar appears; it does nothing
157
150
  for a horizontal one. `.cr-table-scroll` scrolls horizontally and is therefore
158
- excluded — reserving a gutter there costs every table 12px and prevents no
151
+ excluded: reserving a gutter there costs every table 12px and prevents no
159
152
  shift. A dialog takes `both-edges` because its content is centred, and a
160
153
  gutter on one side alone would sit it off-centre. */
161
154
  .cr-scroll,.cr-scroll-frost,.cr-scroll-resin{scrollbar-gutter:stable}
162
155
  .cr-dialog{scrollbar-gutter:stable both-edges}
156
+ /* A dialog's code block scrolls down past 300px. Without a stable gutter its
157
+ text moves 10px on a desktop when the scrollbar arrives (D-4). A phone's
158
+ overlay scrollbar hides the shift. */
159
+ .cr-dialog pre{scrollbar-gutter:stable}
163
160
  /* A horizontal-only scroller says so, because the stylesheet cannot tell. Setting
164
161
  `overflow-x: auto` alone makes `overflow-y` compute to `auto` as well, so the
165
162
  browser reserves the inline gutter for a vertical scrollbar that can never
166
- appear — 12px lost on every such surface, protecting against no shift. This is
163
+ appear: 12px lost on every such surface, protecting against no shift. This is
167
164
  the declaration `.cr-table-scroll` gets by being excluded from the rule above,
168
- made available to anything that reaches for one of the three classes directly.
169
- It comes after them, so it wins on order alone without raising specificity. */
165
+ made available to anything that uses one of the three classes directly. It
166
+ comes after them, so it wins on order alone without raising specificity. */
170
167
  .cr-scroll-x{overflow-x:auto;overflow-y:hidden;scrollbar-gutter:auto}
171
168
 
172
169
  /* A dialog is a reading surface, so it takes the Frost scrollbar; the table
@@ -187,27 +184,27 @@ dialog.cr-dialog{position:fixed}
187
184
 
188
185
  /* The scroll area's edge fade.
189
186
  *
190
- * A fade says there is more in that direction, which a scrollbar alone does not
191
- * on a touch device where the scrollbar is an overlay that is not there yet. It
192
- * is a mask rather than a painted overlay, because what a painted overlay would
193
- * have to paint is the surrounding material, and a colour approximating a
194
- * translucent material over an unknown backdrop is wrong at every edge except
195
- * the one it was sampled at. Masking lets the real material show through.
187
+ * A fade says there is more in that direction. A scrollbar alone does not say
188
+ * so on a touch device, where the scrollbar is an overlay that has not appeared
189
+ * yet. The fade is a mask, because a painted overlay would have to paint the
190
+ * surrounding material, and a colour approximating a translucent material over
191
+ * an unknown backdrop is wrong at every edge except the one it was sampled at.
192
+ * Masking lets the real material show through.
196
193
  *
197
194
  * `data-cr-scroll` says which edges have content beyond them and is set by
198
- * whatever runtime owns the container — Crystal React sets it from a scroll
199
- * listener. Absent the attribute nothing fades, so a container that never gets a
200
- * runtime is unmasked rather than permanently faded at both ends.
195
+ * whatever runtime owns the container. Crystal React sets it from a scroll
196
+ * listener. Without the attribute nothing fades, so a container that never
197
+ * gets a runtime stays unmasked.
201
198
  *
202
- * `scroll-padding` is the part that keeps this accessible: browsers scroll a
203
- * newly focused element into view respecting scroll padding, so a focus ring can
204
- * never come to rest underneath the fade. Crystal does not blur focus, and a
205
- * fade over one would be the same defect by another route.
199
+ * `scroll-padding` keeps the fade accessible: browsers scroll a newly focused
200
+ * element into view respecting scroll padding, so a focus ring can never come
201
+ * to rest underneath the fade. Crystal does not blur focus, and a fade over a
202
+ * focus ring would blur it.
206
203
  *
207
- * A mask fades the whole element, its own fill and border included. So the fade
208
- * belongs on the element that scrolls, and a material surface that also scrolls
209
- * puts its material on a wrapper — otherwise the panel dissolves along with the
210
- * content it is holding. */
204
+ * A mask fades the whole element, its own fill and border included. The fade
205
+ * therefore belongs on the element that scrolls, and a material surface that
206
+ * also scrolls puts its material on a wrapper. Otherwise the panel fades along
207
+ * with the content it holds. */
211
208
  :is(.cr-scroll,.cr-scroll-frost,.cr-scroll-resin)[data-cr-scroll]{
212
209
  --cr-scroll-fade-start:0px;--cr-scroll-fade-end:0px;
213
210
  scroll-padding:var(--cr-scroll-fade);
@@ -233,27 +230,26 @@ dialog.cr-dialog{position:fixed}
233
230
  #000 calc(100% - var(--cr-scroll-fade-end)),transparent 100%);
234
231
  }
235
232
  @media(forced-colors:active){
236
- /* Forced colours exist to make everything legible. A fade is the opposite of
237
- that, and the scrollbar is already system-coloured, so the edge says enough. */
233
+ /* Forced colours exist to make everything legible, and a fade reduces
234
+ legibility. The scrollbar is already system-coloured and marks the edge. */
238
235
  :is(.cr-scroll,.cr-scroll-frost,.cr-scroll-resin)[data-cr-scroll]{mask-image:none}
239
236
  }
240
237
 
241
- /* The older path, for engines that predate the standard properties — Safari
242
- * before 18.2, Chromium before 121. It is deliberately exclusive with the block
243
- * above rather than additional to it.
238
+ /* The older path, for engines that predate the standard properties: Safari
239
+ * before 18.2, Chromium before 121. It is exclusive with the block above. The
240
+ * guard makes each engine take exactly one mechanism.
244
241
  *
245
242
  * Chromium 121 and later ignore every `::-webkit-scrollbar` pseudo-element on a
246
243
  * container whose `scrollbar-width` or `scrollbar-color` is anything but `auto`,
247
244
  * and they are set above on exactly these selectors. Left unguarded, these rules
248
- * are dead in the browser most people use and live in the one they don't, which
249
- * is two renderings of one specification — the drift CONTRACT §1 forbids. The
250
- * guard makes each engine take exactly one mechanism.
245
+ * are dead in the browser most people use and live in the older ones, so one
246
+ * specification renders two ways. That is the drift CONTRACT §1 forbids.
251
247
  *
252
- * What the older path can express and the standard properties cannot is
253
- * geometry: `--cr-scrollbar-width`, `--cr-scrollbar-inset` and
254
- * `--cr-scrollbar-thumb-min` reach only this branch, because `scrollbar-width`
255
- * takes `auto | thin | none` and nothing finer. Those three tokens are the older
256
- * path's statement of the same intent, not a second specification. */
248
+ * The older path can express geometry, which the standard properties cannot:
249
+ * `--cr-scrollbar-width`, `--cr-scrollbar-inset` and `--cr-scrollbar-thumb-min`
250
+ * reach only this branch, because `scrollbar-width` takes `auto | thin | none`
251
+ * and nothing finer. Those three tokens state the same intent as the standard
252
+ * branch for the older path. */
257
253
  @supports not (scrollbar-color:auto){
258
254
  :is(.cr-scroll,.cr-scroll-frost,.cr-scroll-resin,.cr-table-scroll,.cr-dialog)::-webkit-scrollbar{
259
255
  width:var(--cr-scrollbar-width);height:var(--cr-scrollbar-width);
@@ -296,12 +292,12 @@ dialog.cr-dialog{position:fixed}
296
292
  [data-effects=opaque] :is(.cr-stone,.cr-dock-inner)::before{background:var(--cr-surface);filter:none}
297
293
  @media(prefers-reduced-transparency:reduce){
298
294
  :is(.cr-stone,.cr-dock-inner)::before{background:var(--cr-surface);filter:none}
299
- .cr-dialog::backdrop,.cr-mirage{background:var(--cr-mirage-fallback-fill);backdrop-filter:none;-webkit-backdrop-filter:none}
295
+ .cr-dialog::backdrop,.cr-mirage{background:var(--cr-mirage-fallback-fill);-webkit-backdrop-filter:none;backdrop-filter:none}
300
296
  }
301
297
  @media(forced-colors:active){
302
298
  .cr-stone{background:Canvas!important;color:CanvasText!important;border:1px solid CanvasText}
303
299
  :is(.cr-stone,.cr-dock-inner)::before{display:none}
304
- .cr-dialog::backdrop,.cr-mirage{background:var(--cr-mirage-fallback-fill);backdrop-filter:none;-webkit-backdrop-filter:none}
300
+ .cr-dialog::backdrop,.cr-mirage{background:var(--cr-mirage-fallback-fill);-webkit-backdrop-filter:none;backdrop-filter:none}
305
301
  }
306
302
 
307
303
  /* Mirage draws its chroma from the actual backdrop, never an invented overlay gradient. */
@@ -315,29 +311,22 @@ dialog.cr-dialog{position:fixed}
315
311
  only ever in the preview's stylesheet.
316
312
 
317
313
  `.cr-control`, `.cr-field-shell`, `.cr-indicator`, `.cr-resin-haze` and
318
- `.cr-tag` are named throughout `docs/components.md` — the indicator's 20px
319
- circle with its 3px-inset 80% Haze fill, `.cr-resin-haze` as the composition
320
- small display elements use — and until 21 September 2026 the library shipped
321
- none of them. `components.md` said "use `assets/controls.css` after the base
322
- and layout styles", and `assets/controls.css` is not in this package and never
323
- was. A consumer following the specification reached for five components that
324
- did not exist, which is why Crystal React had to rebuild the control surface
325
- in SCSS rather than consume it.
326
-
327
- That is D-11's third divergence, and Meridian decided on 21 September that the
328
- library adopts rather than the preview drops. Lifted from
329
- `crystal-preview/website/assets/controls.css` with its selector lists filtered
330
- to the Crystal parts: the preview's own furniture — `.suite-switch`,
331
- `.segmented`, the range inputs — shares those rules and stays with the site.
332
-
333
- In `@layer crystal.component`, which is where the preview had it and where the
334
- layer order at the top of this file already reserves a slot. That matters for
335
- more than tidiness: the rules above sit in `crystal.reset`, an earlier layer,
336
- so these win regardless of specificity — which is what let a reset-layer hover
337
- (D-21) and a reset-layer target size (D-20) publish values that never
338
- rendered. A component recipe belongs in this layer or nowhere. The cascade is
339
- the one the preview has been rendering all along, which is what makes this an
340
- adoption rather than a redesign.
314
+ `.cr-tag` are named throughout `docs/components.md`: the indicator is a 20px
315
+ circle with a 3px-inset 80% Haze fill, and `.cr-resin-haze` is the
316
+ composition small display elements use. The library adopted them on
317
+ 21 September 2026 as D-11's third divergence, on Meridian's decision that the
318
+ library adopts rather than the preview drops. They are lifted from
319
+ `crystal-preview/website/assets/controls.css` with the selector lists
320
+ filtered to the Crystal parts. The preview's own furniture (`.suite-switch`,
321
+ `.segmented`, the range inputs) shares those rules and stays with the site.
322
+
323
+ The block sits in `@layer crystal.component`, where the preview had it and
324
+ where the layer order at the top of this file reserves a slot. The rules
325
+ above sit in `crystal.reset`, an earlier layer, so these win regardless of
326
+ specificity; a reset-layer hover (D-21) and a reset-layer target size (D-20)
327
+ both published values this layer erased. A component recipe belongs in this
328
+ layer or nowhere. The cascade is the one the preview renders, so this is an
329
+ adoption and not a redesign.
341
330
  --------------------------------------------------------------------------- */
342
331
  @layer crystal.component {
343
332
  :is(button,a.cr-button,.cr-control,.cr-field-shell,.cr-resin-haze,.cr-status) {
@@ -347,8 +336,8 @@ dialog.cr-dialog{position:fixed}
347
336
  color: var(--cr-text);
348
337
  border: 1px solid var(--cr-rim);
349
338
  box-shadow: var(--cr-shadow-float);
350
- backdrop-filter: blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation));
351
339
  -webkit-backdrop-filter: blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation));
340
+ backdrop-filter: blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation));
352
341
  filter: none;
353
342
  }
354
343
  :is(button,a.cr-button,.cr-control,.cr-field-shell,.cr-resin-haze,.cr-status)::before {
@@ -405,8 +394,8 @@ dialog.cr-dialog{position:fixed}
405
394
  }
406
395
  [data-effects=opaque] :is(button,a.cr-button,.cr-control,.cr-field-shell,.cr-resin-haze,.cr-status) {
407
396
  background: var(--cr-surface);
408
- backdrop-filter: none;
409
397
  -webkit-backdrop-filter: none;
398
+ backdrop-filter: none;
410
399
  }
411
400
  [data-effects=opaque] :is(button,a.cr-button,.cr-control,.cr-field-shell,.cr-resin-haze,.cr-status)::after {
412
401
  display: none;
@@ -474,14 +463,13 @@ span.cr-field-shell :is(input,select,textarea):focus-visible {
474
463
  box-shadow: inset 0 1px 2px var(--cr-shadow-contact),inset 0 -1px 0 var(--cr-rim);
475
464
  }
476
465
  :is(.cr-resin,.cr-glass,.cr-resin-haze) :is(button,a.cr-button,.cr-button,.cr-control) {
477
- backdrop-filter: none;
478
466
  -webkit-backdrop-filter: none;
479
- /* backdrop-filter silently creates a stacking context, and these controls
480
- paint their fill on a ::before at z-index -1 which was relying on it. Drop
481
- the filter alone and that pseudo-element escapes to the nearest ancestor
482
- context and paints behind the button's own background instead of above it —
483
- which erased the selected dock label completely. Isolation restores the
484
- containment without restoring the second blur. */
467
+ backdrop-filter: none;
468
+ /* backdrop-filter creates a stacking context, and these controls paint
469
+ their fill on a ::before at z-index -1 that relies on it. Without the
470
+ filter that pseudo-element escapes to the nearest ancestor context and
471
+ paints behind the button's own background instead of above it. Isolation
472
+ restores the containment without restoring the second blur. */
485
473
  isolation: isolate;
486
474
  }
487
475
  .cr-indicator {
@@ -497,8 +485,8 @@ span.cr-field-shell :is(input,select,textarea):focus-visible {
497
485
  border-radius: 50%;
498
486
  border: 1px solid var(--cr-rim);
499
487
  background: transparent;
500
- backdrop-filter: none;
501
488
  -webkit-backdrop-filter: none;
489
+ backdrop-filter: none;
502
490
  box-shadow: 0 2px 4px var(--cr-control-edge),0 4px 8px var(--cr-shadow-contact);
503
491
  color: var(--cr-text);
504
492
  font: 800 12px/1 var(--cr-font);
@@ -571,6 +559,7 @@ span.cr-field-shell {
571
559
  }
572
560
  [data-effects=opaque] .cr-indicator {
573
561
  background: var(--cr-surface);
562
+ -webkit-backdrop-filter: none;
574
563
  backdrop-filter: none;
575
564
  }
576
565
  [data-effects=opaque] .cr-indicator::before {
@@ -582,8 +571,8 @@ span.cr-field-shell {
582
571
  @media (prefers-reduced-transparency:reduce) {
583
572
  :is(button,a.cr-button,.cr-control,.cr-field-shell,.cr-resin-haze,.cr-status) {
584
573
  background: var(--cr-surface);
585
- backdrop-filter: none;
586
- -webkit-backdrop-filter: none
574
+ -webkit-backdrop-filter: none;
575
+ backdrop-filter: none
587
576
  }
588
577
  :is(button,a.cr-button,.cr-control,.cr-field-shell,.cr-resin-haze,.cr-status)::after {
589
578
  display: none
@@ -593,6 +582,7 @@ span.cr-field-shell::after {
593
582
  }
594
583
  .cr-indicator {
595
584
  background: var(--cr-surface);
585
+ -webkit-backdrop-filter: none;
596
586
  backdrop-filter: none
597
587
  }
598
588
  .cr-indicator::before {
@@ -608,11 +598,22 @@ span.cr-field-shell::after {
608
598
  color: CanvasText!important;
609
599
  border: 1px solid ButtonText;
610
600
  box-shadow: none;
601
+ -webkit-backdrop-filter: none;
611
602
  backdrop-filter: none
612
603
  }
613
604
  :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 {
614
605
  display: none
615
606
  }
607
+ /* The browser's forced-colours adjustment replaces colours and drops shadows,
608
+ but leaves backdrop-filter alone. Measured in Chromium with forced colours
609
+ emulated, the status badge, the tag, the count and the three choices kept
610
+ their blur: the choices' own rule has this rule's specificity and comes
611
+ later, and the badge and the tag were not listed (D-36). Important, as the
612
+ material resets in the reset layer are, so no later rule can restore it. */
613
+ :is(button,a.cr-button,.cr-control,.cr-field-shell,input,.cr-resin-haze,.cr-status) {
614
+ -webkit-backdrop-filter: none !important;
615
+ backdrop-filter: none !important
616
+ }
616
617
  span.cr-field-shell {
617
618
  border: 1px solid ButtonText
618
619
  }
@@ -624,6 +625,7 @@ span.cr-field-shell::after {
624
625
  color: CanvasText;
625
626
  border: 1px solid ButtonText;
626
627
  box-shadow: none;
628
+ -webkit-backdrop-filter: none;
627
629
  backdrop-filter: none
628
630
  }
629
631
  .cr-indicator::before {
@@ -648,30 +650,24 @@ span.cr-field-shell:focus-within {
648
650
 
649
651
 
650
652
  /* ---------------------------------------------------------------------------
651
- Second adoption pass — 21 September 2026, D-11's third divergence.
653
+ Second adoption pass, 21 September 2026, D-11's third divergence.
652
654
 
653
655
  The first pass lifted the Resin interaction surface and five components the
654
- preview defined and the library did not, and was verified by rendering the
655
- site both ways and finding the pixels identical. That proved the lift was
656
- faithful. It proved nothing about what `controls.css` still overrode once
657
- the lift had landed, because both sides of that comparison kept the sheet.
656
+ preview defined and the library did not. This pass holds what `controls.css`
657
+ still overrode once that lift had landed, measured against library 2.1.0
658
+ with the stripped sheet as the only variable. A rule belongs to the preview
659
+ only if it names a class or id outside Crystal's `cr-` namespace; everything
660
+ else is the library's. That predicate fails closed.
658
661
 
659
- Measuring the residual — library 2.1.0, the stripped sheet as the only
660
- variable — found a great deal. Three attempts to classify it by selector
661
- shape gave three different answers (29, 51, and still leaking), so the
662
- question was inverted: a rule belongs to the preview only if it names a
663
- class or id outside Crystal's `cr-` namespace, and everything else is the
664
- library's. That fails closed, the way discovery-by-list does.
662
+ The partition is 75 rules and 238 declarations here, 50 rules left with the
663
+ preview, 2 dropped. This block is generated from `controls.css` by that
664
+ partition, so the two sides cannot drift.
665
665
 
666
- The partition is **75 rules and 238 declarations** here, 50 rules left with
667
- the preview, 2 dropped. This block is generated from `controls.css` by that
668
- partition rather than transcribed, so the two sides cannot drift.
666
+ Beyond geometry, the library styled no native form control before this
667
+ pass: checkbox, radio, range, file button, select option and menu item all
668
+ lived only in the preview.
669
669
 
670
- What the library turned out to be missing, beyond geometry: it styled no
671
- native form control at all — no checkbox, radio, range, file button, select
672
- option or menu item lived here, only in the preview.
673
-
674
- Three exceptions, each decided rather than derived:
670
+ Three exceptions to the predicate, each a decision:
675
671
 
676
672
  · `:not(.swatch)` is stripped from the sheen selector. `.swatch` is the
677
673
  preview's; the sheen is Crystal's. The preview keeps its swatches flush
@@ -679,68 +675,59 @@ span.cr-field-shell:focus-within {
679
675
  · `.cr-dock-inner` stays with the preview. `components.md` says it shares
680
676
  the Stone recipe; `materials.md` says a label on a Resin dock takes its
681
677
  own chip. The preview follows one and the library the other, and the
682
- preview's rule is measurably too broad — it also blanks
683
- `.cr-dock-inner.cr-stone`, the preview's own "Stone on Resin" specimen.
684
- That is Meridian's line to draw, and it is filed rather than guessed.
678
+ preview's rule is too broad: it also blanks `.cr-dock-inner.cr-stone`,
679
+ the preview's own "Stone on Resin" specimen. The line is Meridian's to
680
+ draw, and it is filed rather than guessed.
685
681
  · `.cr-button.danger`'s neutralisation is dropped from both. It styles
686
- nothing on the preview, and status colours are never redefined. The danger
687
- boundary below comes from `components.md`, not from the preview.
682
+ nothing on the preview, and status colours are never redefined. The
683
+ danger boundary below comes from `components.md`.
688
684
  --------------------------------------------------------------------------- */
689
685
  @layer crystal.component {
690
686
 
691
687
  /* Destructive actions take the Resin/Haze surface every button has, plus the
692
- independent danger boundary components.md requires. The reset layer used to
693
- ask for a danger *fill*; the component layer has silently outranked it since
694
- the surface was adopted, which left a danger button indistinguishable from
695
- any other button in the library. The boundary is the documented carrier. */
688
+ independent danger boundary components.md requires. The boundary is the
689
+ documented carrier. A danger fill cannot live in the reset layer: this layer
690
+ outranks it, so a fill declared there does not render. */
696
691
  .cr-button.danger {
697
692
  border-color: var(--cr-danger-ink)
698
693
  }
699
694
 
700
- /* The primary action's *reading fill* is the primary colour.
695
+ /* The primary action's reading fill is the primary colour.
701
696
  *
702
697
  * Meridian, 22 September 2026, twice. First: "the Haze content fill should adopt
703
698
  * the primary color, not the rim. The text color will need to be adjusted
704
- * depending on the primary color." Then, against the first attempt: "the Primary
705
- * button now has no Haze content fill … return Primary's Haze content fill, and
706
- * make the color of that content fill the primary color."
707
- *
708
- * What was wrong before either of those: the reset layer asked for
709
- * `background:var(--cr-primary)` on `.cr-button`, and the Resin control rule in
710
- * this layer has outranked it since the surface was adopted — so the primary
711
- * colour survived only as the 8px ring of element background left exposed around
712
- * an inset, white Haze fill, with white `onPrimary` text sitting on that white
713
- * fill. The colour was in the rim by accident and the label was barely legible.
699
+ * depending on the primary color." Then: "the Primary button now has no Haze
700
+ * content fill … return Primary's Haze content fill, and make the color of that
701
+ * content fill the primary color."
714
702
  *
715
- * What was wrong with the first attempt: it used `--cr-haze-own-fill`, the
716
- * palette's content-own surface at Haze's 80%. That is a *soft* tone, and over
717
- * Crystal's own light atmosphere an 80% soft tone is within a few percent of the
718
- * Resin shell around it. The fill was there and nobody could see it — which is
719
- * what Meridian reported, and it is also not "the primary color".
720
- *
721
- * So the fill is `--cr-primary` itself, and the ink is `--cr-on-primary`: the
722
- * palette's own tested pair, which `validate-tokens` already holds across all six
703
+ * The fill is `--cr-primary` itself and the ink is `--cr-on-primary`: the
704
+ * palette's own tested pair, which `validate-tokens` holds across all six
723
705
  * palettes and both modes. Measured against the rendered composite it is 4.74 to
724
706
  * 10.31, tightest on Ion in light mode.
725
707
  *
726
- * The fill is opaque where Haze's neutral fill is 80%, and that is the one
727
- * deliberate deviation here rather than an oversight. An 80% fill transmits a
728
- * fifth of whatever is behind it; white over a light page is still white, so the
729
- * neutral pad loses nothing, but a mid-tone primary at 80% over the Resin shell
730
- * composites to a washed-out lilac that sits at the exact luminance where neither
731
- * a white nor a near-black label clears 4.5 — measured, it is 3.37 to 4.55 with
732
- * `onPrimary` and 2.95 to 5.06 with `text`, failing in every light palette. A
733
- * reading ground whose whole job is to make the label independent of the backdrop
734
- * cannot be the one thing that depends on it.
708
+ * Two other placements do not carry the colour. A `background:var(--cr-primary)`
709
+ * on `.cr-button` in the reset layer is outranked by the Resin control rule in
710
+ * this layer, so the primary survives only as the 8px ring of element background
711
+ * left exposed around the inset, white Haze fill, with white `onPrimary` text on
712
+ * that white fill. `--cr-haze-own-fill`, the palette's content-own surface at
713
+ * Haze's 80%, is a soft tone, and over Crystal's own light atmosphere an 80%
714
+ * soft tone is within a few percent of the Resin shell around it.
715
+ *
716
+ * The fill is opaque where Haze's neutral fill is 80%, and that was decided. An
717
+ * 80% fill transmits a fifth of whatever is behind it. White over a light page
718
+ * is still white, so the neutral pad loses nothing, but a mid-tone primary at
719
+ * 80% over the Resin shell composites to a washed-out lilac at the luminance
720
+ * where neither a white nor a near-black label clears 4.5. Measured, it is 3.37
721
+ * to 4.55 with `onPrimary` and 2.95 to 5.06 with `text`, failing in every light
722
+ * palette. The reading ground exists to make the label independent of the
723
+ * backdrop, so it cannot itself depend on the backdrop.
735
724
  *
736
- * The rim stays the Resin rim. The colour is in the fill; the perimeter is glass,
725
+ * The rim stays the Resin rim. The colour is in the fill, and the perimeter is
737
726
  * the same glass every other control has.
738
727
  *
739
- * The tint is opt-in, on `.primary`, rather than applying to any button that is
740
- * not something else. It used to read `:not(.secondary):not(.quiet):not(.danger)`,
741
- * which was one forgotten modifier away from painting the whole surface, and it
742
- * named `.secondary` — a variant Crystal withdrew when it was established that
743
- * the palettes define one action pair and no second one.
728
+ * The tint is opt-in, on `.primary`. A rule that enumerates the variants it must
729
+ * not tint paints every variant it forgets, and there is no `.secondary`: the
730
+ * palettes define one action pair and no second one.
744
731
  */
745
732
  .cr-button.primary {
746
733
  color: var(--cr-on-primary)
@@ -753,19 +740,16 @@ span.cr-field-shell:focus-within {
753
740
  *
754
741
  * Meridian, 22 September 2026: "remove the Haze content fill from the Quiet
755
742
  * buttons." With the pad gone, quiet is the only one of the four that is glass
756
- * all the way through — a Resin shell, its rim, its float shadow and its sheen,
757
- * and the label directly on the material. That is what makes it quiet, and it is
758
- * the distinction that was missing when quiet took the base surface an hour
759
- * earlier: primary is tinted, secondary is the neutral pad, quiet is neither.
743
+ * all the way through: a Resin shell, its rim, its float shadow and its sheen,
744
+ * and the label directly on the material.
760
745
  *
761
- * The consequence is worth stating where it lives rather than being discovered.
762
- * The pad is what makes a label's contrast independent of whatever is behind the
763
- * control; without it the label reads against the Resin fill and therefore
764
- * against the backdrop. On Crystal's own foundation that is a wide margin —
746
+ * The pad is what makes a label's contrast independent of whatever is behind
747
+ * the control. Without it the label reads against the Resin fill and therefore
748
+ * against the backdrop. On Crystal's own foundation the margin is wide:
765
749
  * measured across all six palettes and both modes, `--cr-text` over the Resin
766
- * fill over canvas, surface, surface-alt and foundation is 10.88 to 18.28 — but
767
- * a quiet button placed over artwork has no protected ground, and that is the
768
- * one composition to avoid.
750
+ * fill over canvas, surface, surface-alt and foundation is 10.88 to 18.28. A
751
+ * quiet button placed over artwork has no protected ground, and that is the one
752
+ * composition to avoid.
769
753
  */
770
754
  .cr-button.quiet::before {
771
755
  display: none
@@ -806,7 +790,8 @@ input:is([type=checkbox],[type=radio]) {
806
790
  border:1px solid var(--cr-rim);
807
791
  border-radius:9px;
808
792
  background:linear-gradient(135deg,var(--cr-control-light),var(--cr-control-color)),var(--cr-resin-fill);
809
- backdrop-filter:blur(20px);
793
+ -webkit-backdrop-filter:blur(var(--cr-resin-blur));
794
+ backdrop-filter:blur(var(--cr-resin-blur));
810
795
  box-shadow:inset 0 2px 2px var(--cr-rim),0 2px 3px var(--cr-control-edge),0 5px 10px var(--cr-shadow-contact);
811
796
  display:inline-grid;
812
797
  place-items:center
@@ -915,6 +900,7 @@ input[type=file]::file-selector-button {
915
900
  padding:9px;
916
901
  gap:4px;
917
902
  box-shadow:var(--cr-shadow-float);
903
+ -webkit-backdrop-filter:blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation));
918
904
  backdrop-filter:blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation))
919
905
  }
920
906
  .cr-dock::before {
@@ -931,8 +917,8 @@ input[type=file]::file-selector-button {
931
917
  border:0;
932
918
  background:transparent;
933
919
  box-shadow:none;
934
- backdrop-filter:none;
935
920
  -webkit-backdrop-filter:none;
921
+ backdrop-filter:none;
936
922
  border-radius:999px;
937
923
  color:var(--cr-text)
938
924
  }
@@ -954,6 +940,7 @@ input[type=file]::file-selector-button {
954
940
  }
955
941
  [data-effects=opaque] .cr-dock {
956
942
  background:var(--cr-surface);
943
+ -webkit-backdrop-filter:none;
957
944
  backdrop-filter:none
958
945
  }
959
946
  span.cr-status {
@@ -992,8 +979,8 @@ span.cr-status>span {
992
979
  border-radius:var(--cr-radius);
993
980
  background:var(--cr-resin-fill);
994
981
  box-shadow:var(--cr-shadow-content);
995
- backdrop-filter:blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation));
996
- -webkit-backdrop-filter:blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation))
982
+ -webkit-backdrop-filter:blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation));
983
+ backdrop-filter:blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation))
997
984
  }
998
985
  .cr-table-scroll::before {
999
986
  content:'';
@@ -1062,8 +1049,8 @@ span.cr-status>span {
1062
1049
  }
1063
1050
  [data-effects=opaque] .cr-table-scroll {
1064
1051
  background:var(--cr-surface);
1065
- backdrop-filter:none;
1066
- -webkit-backdrop-filter:none
1052
+ -webkit-backdrop-filter:none;
1053
+ backdrop-filter:none
1067
1054
  }
1068
1055
  [data-effects=opaque] .cr-table-scroll::before {
1069
1056
  display:none
@@ -1108,6 +1095,7 @@ input:is([type=checkbox],[type=radio])::after {
1108
1095
  background:Canvas;
1109
1096
  border:1px solid ButtonText;
1110
1097
  box-shadow:none;
1098
+ -webkit-backdrop-filter:none;
1111
1099
  backdrop-filter:none
1112
1100
  }
1113
1101
  .cr-dock::before {
@@ -1142,6 +1130,7 @@ span.cr-status>span {
1142
1130
  background:Canvas;
1143
1131
  border:1px solid CanvasText;
1144
1132
  box-shadow:none;
1133
+ -webkit-backdrop-filter:none;
1145
1134
  backdrop-filter:none
1146
1135
  }
1147
1136
  .cr-table-scroll::before {
@@ -1160,12 +1149,13 @@ span.cr-status>span {
1160
1149
  @media (prefers-reduced-transparency:reduce) {
1161
1150
  .cr-dock {
1162
1151
  background:var(--cr-surface);
1152
+ -webkit-backdrop-filter:none;
1163
1153
  backdrop-filter:none
1164
1154
  }
1165
1155
  .cr-table-scroll {
1166
1156
  background:var(--cr-surface);
1167
- backdrop-filter:none;
1168
- -webkit-backdrop-filter:none
1157
+ -webkit-backdrop-filter:none;
1158
+ backdrop-filter:none
1169
1159
  }
1170
1160
  .cr-table-scroll::before {
1171
1161
  display:none
@@ -1175,21 +1165,19 @@ span.cr-status>span {
1175
1165
 
1176
1166
 
1177
1167
  /* ---------------------------------------------------------------------------
1178
- Component recipes for the catalogue — 28 September 2026.
1168
+ Component recipes for the catalogue, 28 September 2026.
1179
1169
 
1180
1170
  `core/tokens/surfaces.json` names the closed set of material compositions a
1181
- component may be made of, and every catalogue entry now says which it is.
1182
- Most of the vocabulary was already here. Four compositions were not, and
1183
- each was found the same way: Crystal React reached a component the catalogue
1184
- specified, looked for the recipe, and rebuilt it locally with a comment
1185
- saying Crystal had none. The R-19 sweep named them — a navigation link, a
1186
- nav rail item, a drag handle, and the "bare" control that eighteen distinct
1187
- controls and 127 instances had been approximating with `background:
1188
- transparent`, which takes off one layer of the Resin coat and leaves four.
1171
+ component may be made of, and every catalogue entry says which it is. Most
1172
+ of the vocabulary was already here. Four compositions were not, and the R-19
1173
+ sweep named them: a navigation link, a nav rail item, a drag handle, and the
1174
+ "bare" control that eighteen distinct controls and 127 instances in Crystal
1175
+ React had been approximating with `background: transparent`, which takes off
1176
+ one layer of the Resin coat and leaves four.
1189
1177
 
1190
1178
  Each recipe is authored here, in `@layer crystal.component`, and nowhere
1191
- else. Not in `crystal.reset`: D-20 and D-21 were both rules authored there
1192
- that this layer erased, and a recipe that may not render is worse than none.
1179
+ else. A rule authored in `crystal.reset` is erased by this layer (D-20,
1180
+ D-21), and a recipe that may not render is worse than none.
1193
1181
 
1194
1182
  Everything reads tokens where a token exists and falls back to the literal
1195
1183
  the token publishes, so a stylesheet loaded without the generated theme
@@ -1201,22 +1189,23 @@ span.cr-status>span {
1201
1189
  *
1202
1190
  * Selector note, which applies to the three recipes below: the coat is keyed on
1203
1191
  * `:is(button, a.cr-button, …)`, specificity (0,1,1), in this same layer. A lone
1204
- * class is (0,1,0) and loses to it whatever the source order — measured, a
1205
- * `<button class="cr-bare">` kept the fill, the rim and the blur. Each recipe
1206
- * therefore carries the element compound and reaches (0,2,0). A rule that must
1207
- * beat the coat and does not say so in its selector is D-20 by another route.
1192
+ * class is (0,1,0) and loses to it whatever the source order; measured, a
1193
+ * `<button class="cr-bare">` under a lone-class rule keeps the fill, the rim
1194
+ * and the blur. Each recipe therefore carries the element compound and reaches
1195
+ * (0,2,0). A rule that must beat the coat and does not say so in its selector
1196
+ * fails the way D-20 did.
1208
1197
  *
1209
- * Crystal paints the Resin coat by element — `:is(button, …)` above — so a
1198
+ * Crystal paints the Resin coat by element, `:is(button, …)` above, so a
1210
1199
  * `<button>` wears the fill, the rim, the float shadow, the backdrop blur and
1211
1200
  * both feathered pseudo-layers whether or not anything asked. A control that
1212
1201
  * sits inside a surface which already has a coat must not wear a second one: a
1213
1202
  * disclosure chevron, a chip's remove button, a sort header, a stepper's arrows,
1214
1203
  * the dismiss button on a toast. Declaring `background: transparent` on one of
1215
1204
  * those takes off one layer of five. This takes off all five and keeps what a
1216
- * control still owes — the 44px target, the pill hit area, the focus ring.
1205
+ * control still owes: the 44px target, the pill hit area and the focus ring.
1217
1206
  *
1218
1207
  * It is not `.cr-button.quiet`. Quiet keeps the whole shell and drops only the
1219
- * reading pad, which is what makes a quiet *button* quiet; a chevron is not a
1208
+ * reading pad, which is what makes a quiet button quiet; a chevron is not a
1220
1209
  * Resin control that has been quietened.
1221
1210
  */
1222
1211
  :is(button, a, [role=button], .cr-bare).cr-bare {
@@ -1231,8 +1220,8 @@ span.cr-status>span {
1231
1220
  border-radius: 999px;
1232
1221
  background: transparent;
1233
1222
  color: inherit;
1234
- backdrop-filter: none;
1235
1223
  -webkit-backdrop-filter: none;
1224
+ backdrop-filter: none;
1236
1225
  filter: none;
1237
1226
  font-weight: inherit;
1238
1227
  }
@@ -1251,7 +1240,7 @@ span.cr-status>span {
1251
1240
  filter: none;
1252
1241
  }
1253
1242
  /* An on state without a reading pad has nothing to tint, so it takes the
1254
- weight half of the selection rule and keeps the surface ink — the element
1243
+ weight half of the selection rule and keeps the surface ink. The element
1255
1244
  rule above would otherwise leave on-primary ink on a transparent ground. */
1256
1245
  .cr-bare:is([aria-pressed=true],[aria-selected=true],[aria-checked=true]) {
1257
1246
  color: var(--cr-text);
@@ -1286,22 +1275,22 @@ span.cr-status>span {
1286
1275
  /* A navigation entry.
1287
1276
  *
1288
1277
  * `docs/components.md` names the documentation site's side menu as the
1289
- * reference implementation of selection, and until now that recipe lived only
1290
- * in the site's own stylesheet — the same shape as D-9, a specification only
1291
- * one renderer could read. Lifted from `crystal-preview` `.menu-item` as it
1292
- * renders: an entry is furniture on the panel beneath it, so it has no material
1293
- * of its own and no Resin coat. Thirteen floating capsules in a sidebar would
1294
- * be exactly the legibility noise the hierarchy exists to prevent. The pill
1295
- * geometry stays, because "go here" is an action.
1278
+ * reference implementation of selection. The recipe is lifted from
1279
+ * `crystal-preview` `.menu-item` as it renders, so that it no longer lives only
1280
+ * in the site's own stylesheet (the shape of D-9). An entry is furniture on the
1281
+ * panel beneath it, so it has no material of its own and no Resin coat.
1282
+ * Thirteen floating capsules in a sidebar would be the legibility noise the
1283
+ * hierarchy exists to prevent. The pill geometry stays, because "go here" is
1284
+ * an action.
1296
1285
  *
1297
1286
  * Selection is label weight, 650 at rest and 800 when current. Nothing is drawn
1298
1287
  * beside the label for selection. `.stacked` puts the icon above the label for a
1299
1288
  * rail.
1300
1289
  *
1301
- * Current *location* is a different indicator, and the catalogue says so: "current
1290
+ * Current location is a different indicator, and the catalogue says so: "current
1302
1291
  * location is a dot; selection within a set is label weight" (D-22, ruled on
1303
- * 28 September 2026). The dot is drawn on `aria-current` only — never for
1304
- * `aria-selected` or `aria-pressed`, which are selection — and it sits inside the
1292
+ * 28 September 2026). The dot is drawn on `aria-current` only, never for
1293
+ * `aria-selected` or `aria-pressed`, which are selection. It sits inside the
1305
1294
  * entry's own inline-start padding, absolutely positioned, so the label does not
1306
1295
  * move by a pixel when the page changes. It is a flat mark in the primary colour:
1307
1296
  * no material, no elevation, no blur. An entry is furniture on the panel beneath
@@ -1325,8 +1314,8 @@ span.cr-status>span {
1325
1314
  line-height: 1.35;
1326
1315
  text-align: start;
1327
1316
  text-decoration: none;
1328
- backdrop-filter: none;
1329
1317
  -webkit-backdrop-filter: none;
1318
+ backdrop-filter: none;
1330
1319
  filter: none;
1331
1320
  }
1332
1321
  .cr-nav-item::before,
@@ -1385,9 +1374,10 @@ span.cr-status>span {
1385
1374
  }
1386
1375
 
1387
1376
  /* A Resin panel: the Resin plane with the content radius instead of the pill,
1388
- for a floating control plane that is a rectangle — a floating window, a wide
1389
- media control bar. Fill, rim, blur and shadow are the plane's; only the
1390
- geometry changes, and it matches the Frost panel's so nested radii line up. */
1377
+ for a floating control plane that is a rectangle, such as a floating window
1378
+ or a wide media control bar. Fill, rim, blur and shadow are the plane's; only
1379
+ the geometry changes, and it matches the Frost panel's so nested radii line
1380
+ up. */
1391
1381
  :is(.cr-resin,.cr-glass).panel {
1392
1382
  border-radius: calc(var(--cr-radius) + 6px);
1393
1383
  }
@@ -1446,10 +1436,10 @@ input[type=radio] {
1446
1436
  }
1447
1437
 
1448
1438
  /* Disabled. The reset layer dims a native `button:disabled` and nothing else,
1449
- so an action link, a control span and a navigation entry had no disabled
1450
- state at all. The opacity is the published token; a disabled element must
1451
- still not be the only explanation of unavailability, and the product still
1452
- has to refuse the action — this only shows that it will. */
1439
+ so an action link, a control span and a navigation entry take their disabled
1440
+ state here. The opacity is the published token. A disabled element must not
1441
+ be the only explanation of unavailability, and the product still has to
1442
+ refuse the action; this only shows that it will. */
1453
1443
  button:disabled,
1454
1444
  :is(a.cr-button,.cr-control,.cr-nav-item,.cr-bare,.cr-drag-handle)[aria-disabled=true] {
1455
1445
  opacity: var(--cr-action-disabled-opacity, .55);
@@ -1457,11 +1447,11 @@ button:disabled,
1457
1447
  filter: none;
1458
1448
  }
1459
1449
 
1460
- /* Controls inside a Resin plane lose their own backdrop filter — the rule above
1450
+ /* Controls inside a Resin plane lose their own backdrop filter. The rule above
1461
1451
  lists the action controls, and these are controls too. */
1462
1452
  :is(.cr-resin,.cr-glass,.cr-resin-haze) :is(.cr-bare,.cr-nav-item,.cr-drag-handle) {
1463
- backdrop-filter: none;
1464
1453
  -webkit-backdrop-filter: none;
1454
+ backdrop-filter: none;
1465
1455
  isolation: isolate;
1466
1456
  }
1467
1457
 
@@ -1505,11 +1495,11 @@ input[type=checkbox][role=switch] {
1505
1495
 
1506
1496
 
1507
1497
  /* ---------------------------------------------------------------------------
1508
- Rulings of 29 September 2026 — proposals/2026-09-29-rulings.md.
1498
+ Rulings of 29 September 2026, proposals/2026-09-29-rulings.md.
1509
1499
 
1510
- Each recipe below closes an open issue that a consumer found by reaching for
1511
- Crystal and finding it did not reach: a dock whose controls were not buttons,
1512
- a group whose segments touch, a dialog whose body scrolls, an overlay inside a
1500
+ Each recipe below closes an open issue a consumer found by reaching for
1501
+ Crystal where it did not reach: a dock whose controls are not buttons, a
1502
+ group whose segments touch, a dialog whose body scrolls, an overlay inside a
1513
1503
  pane, a count badge. As in the block above, each is authored in
1514
1504
  `@layer crystal.component` and nowhere else, and each carries its own
1515
1505
  reduced-transparency and forced-colours branches.
@@ -1521,8 +1511,8 @@ input[type=checkbox][role=switch] {
1521
1511
  * `.cr-dock button` reaches only a <button>. A tab is often `[role=tab]` on
1522
1512
  * another element, a segmented control is often radio inputs inside labels, and
1523
1513
  * a dock or bottom-bar destination is a link carrying `aria-current`. Each gets
1524
- * the dock button's values here, selected by its own state — `aria-selected`, a
1525
- * checked radio, `aria-current`.
1514
+ * the dock button's values here, selected by its own state: `aria-selected`, a
1515
+ * checked radio or `aria-current`.
1526
1516
  *
1527
1517
  * Every selector is inside `:where()`, so it adds no specificity to `.cr-dock`,
1528
1518
  * and the existing `.cr-dock button` rules (0,1,1) keep winning on a <button>
@@ -1556,8 +1546,8 @@ input[type=checkbox][role=switch] {
1556
1546
  }
1557
1547
  /* The radio is the control and the label is what is seen; the input stays in the
1558
1548
  accessibility tree and takes focus, and its ring is drawn on the label. The
1559
- label is matched by a radio anywhere inside it — React Aria, for one, wraps
1560
- its input in a visually hidden span — and only a radio that is the label's own
1549
+ label is matched by a radio anywhere inside it (React Aria, for one, wraps
1550
+ its input in a visually hidden span), and only a radio that is the label's own
1561
1551
  child is hidden here, because a wrapped one is already hidden by its wrapper. */
1562
1552
  .cr-dock :where(label:has(> input[type=radio])) > input[type=radio] {
1563
1553
  position: absolute;
@@ -1594,13 +1584,13 @@ input[type=checkbox][role=switch] {
1594
1584
  }
1595
1585
  }
1596
1586
 
1597
- /* A group — the `group` surface (D-26).
1587
+ /* A group: the `group` surface (D-26).
1598
1588
  *
1599
1589
  * A button group and a split button are one Resin plane whose segments touch:
1600
1590
  * the silhouette is a single pill, the interior corners square off against
1601
1591
  * their neighbours, and a hairline in `--cr-edge` separates them. The plane is
1602
- * the group's, so the children give up their own elevation and diffusion — a
1603
- * Resin button on a Resin plane is the composition Crystal forbids — and keep
1592
+ * the group's, so the children give up their own elevation and diffusion (a
1593
+ * Resin button on a Resin plane is the composition Crystal forbids) and keep
1604
1594
  * their fill, so a primary action's ink still has its fill beneath it.
1605
1595
  *
1606
1596
  * The child selector is `:is(button, a.cr-button, .cr-button, .cr-control)`
@@ -1615,8 +1605,8 @@ input[type=checkbox][role=switch] {
1615
1605
  border-radius: 999px;
1616
1606
  background: var(--cr-resin-fill);
1617
1607
  box-shadow: var(--cr-shadow-float);
1618
- backdrop-filter: blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation));
1619
1608
  -webkit-backdrop-filter: blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation));
1609
+ backdrop-filter: blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation));
1620
1610
  }
1621
1611
  .cr-group::before {
1622
1612
  content: '';
@@ -1631,8 +1621,8 @@ input[type=checkbox][role=switch] {
1631
1621
  .cr-group > :is(button, a.cr-button, .cr-button, .cr-control) {
1632
1622
  border-radius: 0;
1633
1623
  box-shadow: none;
1634
- backdrop-filter: none;
1635
1624
  -webkit-backdrop-filter: none;
1625
+ backdrop-filter: none;
1636
1626
  isolation: isolate;
1637
1627
  }
1638
1628
  .cr-group > :is(button, a.cr-button, .cr-button, .cr-control):first-child {
@@ -1667,14 +1657,14 @@ input[type=checkbox][role=switch] {
1667
1657
  }
1668
1658
  [data-effects=opaque] .cr-group {
1669
1659
  background: var(--cr-surface);
1670
- backdrop-filter: none;
1671
1660
  -webkit-backdrop-filter: none;
1661
+ backdrop-filter: none;
1672
1662
  }
1673
1663
  @media (prefers-reduced-transparency:reduce) {
1674
1664
  .cr-group {
1675
1665
  background: var(--cr-surface);
1676
- backdrop-filter: none;
1677
1666
  -webkit-backdrop-filter: none;
1667
+ backdrop-filter: none;
1678
1668
  }
1679
1669
  .cr-group::before {
1680
1670
  filter: none;
@@ -1685,6 +1675,7 @@ input[type=checkbox][role=switch] {
1685
1675
  background: ButtonFace;
1686
1676
  border: 1px solid ButtonText;
1687
1677
  box-shadow: none;
1678
+ -webkit-backdrop-filter: none;
1688
1679
  backdrop-filter: none;
1689
1680
  }
1690
1681
  .cr-group::before {
@@ -1701,13 +1692,13 @@ input[type=checkbox][role=switch] {
1701
1692
  * A surface that scrolls takes its title out of view in a tall dialog, and
1702
1693
  * cannot take the edge fade, because a mask fades an element's own fill and rim
1703
1694
  * along with its content. So the surface is a column that does not scroll, and
1704
- * `.cr-dialog-body` scrolls inside it — with `.cr-scroll-frost` beside it for
1695
+ * `.cr-dialog-body` scrolls inside it, with `.cr-scroll-frost` beside it for
1705
1696
  * the scroll contract, the Frost scrollbar and the edge fade, since a dialog is
1706
1697
  * a reading surface.
1707
1698
  *
1708
1699
  * Keyed on the body's presence, so a 2.2 dialog written without one goes on
1709
- * scrolling as its surface, exactly as before. And only an open native dialog is
1710
- * shown: an author `display` would otherwise beat the browser's
1700
+ * scrolling as its surface. And only an open native dialog is shown: an author
1701
+ * `display` would otherwise beat the browser's
1711
1702
  * `dialog:not([open]) { display: none }`. */
1712
1703
  .cr-dialog:has(> .cr-dialog-body) {
1713
1704
  display: flex;
@@ -1717,8 +1708,8 @@ input[type=checkbox][role=switch] {
1717
1708
  dialog.cr-dialog:has(> .cr-dialog-body):not([open]) {
1718
1709
  display: none;
1719
1710
  }
1720
- /* The header's gap, which body paragraphs' own margins used to supply. It
1721
- matches the gap inside the header, as the footer's 24px matches its own. */
1711
+ /* The gap below the header. It matches the gap inside the header, as the
1712
+ footer's 24px matches its own. */
1722
1713
  .cr-dialog > header + .cr-dialog-body {
1723
1714
  margin-top: 20px;
1724
1715
  }
@@ -1736,12 +1727,12 @@ dialog.cr-dialog:has(> .cr-dialog-body):not([open]) {
1736
1727
  /* An overlay inside a pane (D-25).
1737
1728
  *
1738
1729
  * On the page a transient overlay is Frost. Inside a pane that is already
1739
- * lifted — a Haze dialog, a Frost panel — it recesses into Haze rather than
1740
- * floating a second pane of glass, and plain Haze has no edge: a menu drawn that
1741
- * way over a Haze dialog cannot be told from the dialog. The recessed overlay is
1742
- * Haze given the one boundary it needs: a flat fill, the `--cr-edge` rim and the
1743
- * content shadow. There is no feather — a bordered box has no perimeter to
1744
- * dissolve into its surroundings. */
1730
+ * lifted (a Haze dialog, a Frost panel) it recesses into Haze rather than
1731
+ * floating a second pane of glass. Plain Haze has no edge, and a menu drawn that
1732
+ * way over a Haze dialog cannot be told from the dialog, so the recessed overlay
1733
+ * is Haze given the one boundary it needs: a flat fill, the `--cr-edge` rim and
1734
+ * the content shadow. There is no feather, because a bordered box has no
1735
+ * perimeter to dissolve into its surroundings. */
1745
1736
  :is(.cr-haze,.cr-surface).overlay {
1746
1737
  border: 1px solid var(--cr-edge);
1747
1738
  border-radius: var(--cr-radius);
@@ -1773,8 +1764,8 @@ dialog.cr-dialog:has(> .cr-dialog-body):not([open]) {
1773
1764
  * `.cr-resin-haze` is sized for a tag: its Haze pad is inset by
1774
1765
  * `--cr-haze-inset`, 8px, and its block padding is 17px. On a 20px count badge
1775
1766
  * the first leaves a pad a few pixels across with the digit mostly outside it,
1776
- * and the second makes the badge 55px tall. A count fills to its own edge — it
1777
- * is smaller than the perimeter the inset protects — has no block padding, and
1767
+ * and the second makes the badge 55px tall. A count fills to its own edge, since
1768
+ * it is smaller than the perimeter the inset protects, has no block padding, and
1778
1769
  * is a circle that becomes a pill as the digits need it: a square minimum and a
1779
1770
  * pill radius, so the shape follows the content. 20px is
1780
1771
  * `component.indicator.size`; 4px is the smallest spacing step. */
@@ -1799,11 +1790,520 @@ dialog.cr-dialog:has(> .cr-dialog-body):not([open]) {
1799
1790
  inset: 0;
1800
1791
  }
1801
1792
 
1802
- /* The indicator's field glyphs now reach any field shell (D-27); a shell that is
1803
- a block — a label, a textarea, a row of chips — makes the same room for the
1804
- glyph that the inline shell always has. `:where()` so this adds nothing to the
1805
- shell's own specificity; the inline shell's padding rule is unchanged. */
1793
+ /* The indicator's field glyphs reach any field shell (D-27). A shell that is a
1794
+ block (a label, a textarea, a row of chips) makes the same room for the glyph
1795
+ that the inline shell has. `:where()` so this adds nothing to the shell's own
1796
+ specificity; the inline shell's padding rule is unchanged. */
1806
1797
  :where(.cr-field-shell:not(span)):has(> .cr-indicator) {
1807
1798
  padding-inline-end: 40px;
1808
1799
  }
1809
1800
  }
1801
+
1802
+ /* ---------------------------------------------------------------------------
1803
+ Media and text recipes, proposals/2026-10-02-media-text-and-recipe-parity.md.
1804
+
1805
+ The media players and the text surfaces were the two places where every
1806
+ platform library had to invent its own layout: where the transport sits over
1807
+ the picture and how far from the edge, what a caption cue is painted on, how a
1808
+ heading, a checklist or an underline looks inside an editor, and where the
1809
+ formatting toolbar goes when a touch keyboard covers half the screen. Each
1810
+ recipe below is a composition of surfaces the vocabulary already has (Resin,
1811
+ Stone, Frost, Haze), so no platform gains a new material; it gains the
1812
+ geometry. As in the blocks above, each is authored in `@layer
1813
+ crystal.component` and carries its own fallback branches.
1814
+ --------------------------------------------------------------------------- */
1815
+ @layer crystal.component {
1816
+
1817
+ /* The media stage.
1818
+ *
1819
+ * The picture's frame: the content radius, the letterbox, and the aspect ratio
1820
+ * the product asked for, so the page does not jump when the first frame
1821
+ * decodes. `--cr-media-aspect` is unset by default, which leaves the media's
1822
+ * own ratio; a product sets `16 / 9`, `4 / 3`, `1` or `9 / 16`. `--cr-media-fit`
1823
+ * is `contain`, so nothing the author filmed is cropped unless they ask for
1824
+ * `cover`. */
1825
+ .cr-media {
1826
+ position: relative;
1827
+ isolation: isolate;
1828
+ overflow: hidden;
1829
+ container-type: inline-size;
1830
+ aspect-ratio: var(--cr-media-aspect, auto);
1831
+ border-radius: var(--cr-radius);
1832
+ background: var(--cr-surface-alt);
1833
+ line-height: 0;
1834
+ /* The transport's height, which the caption cue clears: the 48px action
1835
+ target (D-20), 4px above and below, and the 1px rim. */
1836
+ --cr-media-transport: 58px;
1837
+ }
1838
+ .cr-media > :is(video, img, canvas) {
1839
+ display: block;
1840
+ width: 100%;
1841
+ height: 100%;
1842
+ object-fit: var(--cr-media-fit, contain);
1843
+ }
1844
+ /* The transport's region. It is inset from the stage by the 12px spacing step on
1845
+ every side it touches, so the Resin pill never meets the content radius
1846
+ (a 999px pill inside a 28px corner touches it at a point), and the inset grows
1847
+ to the safe area in full screen on a device with a notch or a home bar. */
1848
+ .cr-media-bar {
1849
+ position: absolute;
1850
+ z-index: 2;
1851
+ inset-inline: var(--cr-spacing-sm);
1852
+ inset-block-end: var(--cr-spacing-sm);
1853
+ line-height: var(--cr-leading, 1.5);
1854
+ }
1855
+ .cr-media:fullscreen .cr-media-bar {
1856
+ inset-inline: max(var(--cr-spacing-sm), env(safe-area-inset-left), env(safe-area-inset-right));
1857
+ inset-block-end: max(var(--cr-spacing-sm), env(safe-area-inset-bottom));
1858
+ }
1859
+ .cr-media:fullscreen {
1860
+ border-radius: 0;
1861
+ }
1862
+
1863
+ /* The transport: a Resin pill holding the controls.
1864
+ *
1865
+ * 4px block padding around the 48px action targets (D-20) makes a 56px pill
1866
+ * inside its rim. 12px inline padding keeps the first and last targets' focus
1867
+ * halos (3px offset plus the feather) inside the pill's curve. The time
1868
+ * readouts are tabular so the bar does not shift as the seconds change. */
1869
+ :is(.cr-resin,.cr-glass).transport {
1870
+ display: flex;
1871
+ align-items: center;
1872
+ gap: var(--cr-spacing-2xs);
1873
+ min-height: 58px;
1874
+ box-sizing: border-box;
1875
+ padding: var(--cr-spacing-2xs) var(--cr-spacing-sm);
1876
+ color: var(--cr-text);
1877
+ }
1878
+ /* The readouts are labels read over moving pictures through a 20% fill, so
1879
+ each sits on its own Haze pill: the "Haze fills behind readable labels" the
1880
+ catalogue names. A control is not given one, because its own coat already
1881
+ carries a Haze pad. */
1882
+ :is(.cr-resin,.cr-glass).transport :where(time, output, .time) {
1883
+ flex: none;
1884
+ padding: 2px var(--cr-spacing-xs);
1885
+ border-radius: 999px;
1886
+ background: var(--cr-haze-fill);
1887
+ font-size: var(--cr-text-caption-size);
1888
+ font-weight: 650;
1889
+ font-variant-numeric: tabular-nums;
1890
+ line-height: var(--cr-text-caption-leading, 1.4);
1891
+ color: var(--cr-text);
1892
+ }
1893
+ /* Narrow players drop the inline padding to the smallest step and let the bar
1894
+ wrap its trailing controls onto a second row, rather than crushing the
1895
+ scrubber to nothing. */
1896
+ @container (max-width: 420px) {
1897
+ :is(.cr-resin,.cr-glass).transport {
1898
+ flex-wrap: wrap;
1899
+ padding-inline: var(--cr-spacing-xs);
1900
+ border-radius: calc(var(--cr-radius) - 4px);
1901
+ }
1902
+ }
1903
+
1904
+ /* A caption cue is a label over a moving backdrop, which is what Stone is for.
1905
+ *
1906
+ * Two forms. `::cue` reaches the browser's own caption renderer, which accepts
1907
+ * a background and a font but no pseudo-element, so the fill is flat there. A
1908
+ * library that renders cues itself (for the same look in every engine) wears
1909
+ * `.cr-media-caption`, which is `.cr-stone`'s feathered backing on a positioned
1910
+ * box. The cue sits above the transport, never under it. */
1911
+ .cr-media :is(video)::cue {
1912
+ background: var(--cr-stone-fill);
1913
+ color: var(--cr-text);
1914
+ font-family: var(--cr-font);
1915
+ font-weight: 650;
1916
+ line-height: 1.35;
1917
+ }
1918
+ .cr-media-caption {
1919
+ position: absolute;
1920
+ z-index: 1;
1921
+ inset-inline: var(--cr-spacing-lg);
1922
+ inset-block-end: calc(var(--cr-media-transport, 58px) + var(--cr-spacing-sm) * 2);
1923
+ display: flex;
1924
+ justify-content: center;
1925
+ pointer-events: none;
1926
+ line-height: 1.35;
1927
+ text-align: center;
1928
+ }
1929
+ .cr-media-caption > * {
1930
+ position: relative;
1931
+ isolation: isolate;
1932
+ max-width: 42ch;
1933
+ padding: var(--cr-spacing-2xs) var(--cr-spacing-sm);
1934
+ border-radius: var(--cr-spacing-xs);
1935
+ color: var(--cr-text);
1936
+ font-weight: 650;
1937
+ font-size: clamp(15px, 3.2cqi, 28px);
1938
+ }
1939
+ .cr-media-caption > *::before {
1940
+ content: '';
1941
+ position: absolute;
1942
+ inset: 0;
1943
+ z-index: -1;
1944
+ border-radius: inherit;
1945
+ background: var(--cr-stone-fill);
1946
+ filter: blur(var(--cr-stone-feather));
1947
+ }
1948
+
1949
+ /* The audio player: no picture, so the stage becomes a Haze reading surface
1950
+ (title, artist, chapter) holding the transport, with the card padding every
1951
+ other Haze card has. Worn as `.cr-haze.cr-media.audio`. */
1952
+ .cr-media.audio {
1953
+ display: grid;
1954
+ gap: var(--cr-spacing-sm);
1955
+ aspect-ratio: auto;
1956
+ overflow: visible;
1957
+ padding: var(--cr-space);
1958
+ /* The letterbox above is authored in this layer and would beat the Haze
1959
+ fill, which `.cr-haze` sets in the reset layer. `revert-layer` hands the
1960
+ background back to whichever surface the player wears. */
1961
+ background: revert-layer;
1962
+ line-height: var(--cr-leading, 1.5);
1963
+ }
1964
+ .cr-media.audio .cr-media-bar {
1965
+ position: static;
1966
+ }
1967
+
1968
+ /* A Frost overlay shaped as a bar of controls: the selection toolbar over
1969
+ highlighted text, a floating format bar. Transient overlays are Frost
1970
+ (R15e); this is the popover with the pill silhouette and the dock's spacing,
1971
+ because what it holds is a row of 48px targets and not a paragraph. */
1972
+ :is(.cr-frost,.cr-acrylic).bar {
1973
+ display: inline-flex;
1974
+ align-items: center;
1975
+ gap: 2px;
1976
+ padding: var(--cr-spacing-2xs);
1977
+ border-radius: 999px;
1978
+ }
1979
+
1980
+ /* Prose and the editor share one typographic vocabulary.
1981
+ *
1982
+ * `.cr-prose` is the reading rhythm for content the product did not lay out
1983
+ * (rendered Markdown, a CMS body); `.cr-editor` is the same vocabulary inside an
1984
+ * editable surface, plus the caret and the selection. The values are the ones
1985
+ * Crystal React's `Prose` renders and was reviewed at: block gaps of 24px,
1986
+ * headings stepping through the scale from display, muted list markers, a
1987
+ * primary-soft rule on a quotation. What is new is the part no platform had:
1988
+ * checklists, and the marks a document needs past bold and italic.
1989
+ *
1990
+ * A checklist is native checkboxes, so it wears the selection control and its
1991
+ * checked state is the control's, never a glyph drawn beside the text. Every
1992
+ * mark differs in shape as well as colour: an insertion is underlined, a
1993
+ * deletion struck through, a highlight filled, so none rests on colour alone. */
1994
+ :is(.cr-prose,.cr-editor) {
1995
+ color: var(--cr-text);
1996
+ font-size: var(--cr-text-body-size);
1997
+ line-height: var(--cr-text-body-leading);
1998
+ overflow-wrap: anywhere;
1999
+ }
2000
+ .cr-prose {
2001
+ max-width: 68ch;
2002
+ }
2003
+ :is(.cr-prose,.cr-editor) > * + * {
2004
+ margin-top: var(--cr-spacing-lg);
2005
+ }
2006
+ :is(.cr-prose,.cr-editor) > :first-child {
2007
+ margin-top: 0;
2008
+ }
2009
+ :is(.cr-prose,.cr-editor) :where(h1, h2, h3, h4, h5, h6) {
2010
+ margin-bottom: 0;
2011
+ font-weight: 750;
2012
+ text-wrap: balance;
2013
+ }
2014
+ :is(.cr-prose,.cr-editor) > :where(h1, h2, h3, h4, h5, h6):not(:first-child) {
2015
+ margin-top: var(--cr-spacing-xl);
2016
+ }
2017
+ :is(.cr-prose,.cr-editor) :where(h1) {
2018
+ font-size: var(--cr-text-display-size);
2019
+ line-height: var(--cr-text-display-leading);
2020
+ letter-spacing: var(--cr-text-display-tracking);
2021
+ }
2022
+ :is(.cr-prose,.cr-editor) :where(h2) {
2023
+ font-size: var(--cr-text-title-size);
2024
+ line-height: var(--cr-text-title-leading);
2025
+ letter-spacing: var(--cr-text-title-tracking);
2026
+ }
2027
+ :is(.cr-prose,.cr-editor) :where(h3) {
2028
+ font-size: var(--cr-text-heading-size);
2029
+ line-height: var(--cr-text-heading-leading);
2030
+ letter-spacing: var(--cr-text-heading-tracking);
2031
+ }
2032
+ :is(.cr-prose,.cr-editor) :where(h4, h5, h6) {
2033
+ font-size: var(--cr-text-subheading-size);
2034
+ line-height: var(--cr-text-subheading-leading);
2035
+ letter-spacing: var(--cr-text-subheading-tracking);
2036
+ }
2037
+ :is(.cr-prose,.cr-editor) :where(p, ul, ol, blockquote, pre) {
2038
+ margin-bottom: 0;
2039
+ }
2040
+ :is(.cr-prose,.cr-editor) :where(ul, ol) {
2041
+ padding-inline-start: var(--cr-spacing-lg);
2042
+ }
2043
+ :is(.cr-prose,.cr-editor) :where(ul, ol) :where(ul, ol) {
2044
+ margin-top: var(--cr-spacing-xs);
2045
+ }
2046
+ :is(.cr-prose,.cr-editor) :where(li) + :where(li) {
2047
+ margin-top: var(--cr-spacing-xs);
2048
+ }
2049
+ :is(.cr-prose,.cr-editor) :where(li)::marker {
2050
+ color: var(--cr-muted);
2051
+ }
2052
+ :is(.cr-prose,.cr-editor) :where(li) > :where(p) {
2053
+ margin: 0;
2054
+ }
2055
+ /* A checklist: `ul.checklist`, or `ul[data-type=taskList]` as ProseMirror and
2056
+ TipTap write it. The checkbox is the marker, so the list's own marker and
2057
+ indent go; the item is a row of the control and its text, top-aligned so a
2058
+ wrapped line keeps the control on the first. */
2059
+ :is(.cr-prose,.cr-editor) :where(ul.checklist, ul[data-type=taskList]) {
2060
+ padding-inline-start: 0;
2061
+ list-style: none;
2062
+ }
2063
+ :is(.cr-prose,.cr-editor) :where(ul.checklist, ul[data-type=taskList]) > li {
2064
+ display: flex;
2065
+ align-items: flex-start;
2066
+ gap: var(--cr-spacing-xs);
2067
+ }
2068
+ :is(.cr-prose,.cr-editor) :where(ul.checklist, ul[data-type=taskList]) > li > :where(label) {
2069
+ flex: none;
2070
+ display: inline-flex;
2071
+ margin-top: calc((var(--cr-text-body-leading) - var(--cr-choice-box-size, 26px)) / 2);
2072
+ }
2073
+ /* A checklist's checkbox is a choice, not the field's text entry. Inside an
2074
+ editor's field shell, `.cr-field-shell :is(input, select, textarea)` would
2075
+ give it the text entry's 44px floor, stretching the 26px box into a pill and
2076
+ dropping it below its line. */
2077
+ .cr-field-shell :is(.cr-prose,.cr-editor) input:is([type=checkbox],[type=radio]) {
2078
+ min-height: 0;
2079
+ }
2080
+ :is(.cr-prose,.cr-editor) :where(ul.checklist, ul[data-type=taskList]) > li > :where(div, p, span) {
2081
+ flex: 1;
2082
+ min-width: 0;
2083
+ }
2084
+ /* Done is the checkbox's state. The text recedes to the muted ink so a long
2085
+ list can be scanned, and is not struck through, which would make finished
2086
+ work harder to read. */
2087
+ :is(.cr-prose,.cr-editor) :where(ul.checklist, ul[data-type=taskList]) > li:where([data-checked=true], :has(> label input:checked)) > :where(div, p, span) {
2088
+ color: var(--cr-muted);
2089
+ }
2090
+ :is(.cr-prose,.cr-editor) :where(blockquote) {
2091
+ margin-inline: 0;
2092
+ padding-inline-start: var(--cr-spacing-md);
2093
+ border-inline-start: 3px solid var(--cr-primary-soft);
2094
+ color: var(--cr-muted);
2095
+ }
2096
+ :is(.cr-prose,.cr-editor) :where(pre) {
2097
+ padding: var(--cr-space);
2098
+ border-radius: var(--cr-radius);
2099
+ background: var(--cr-surface-alt);
2100
+ overflow-x: auto;
2101
+ overscroll-behavior: contain;
2102
+ }
2103
+ :is(.cr-prose,.cr-editor) :where(code, kbd, samp) {
2104
+ padding-inline: 0.2em;
2105
+ border-radius: 4px;
2106
+ background: var(--cr-surface-alt);
2107
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
2108
+ font-size: 0.9em;
2109
+ }
2110
+ :is(.cr-prose,.cr-editor) :where(pre code) {
2111
+ padding: 0;
2112
+ background: none;
2113
+ font-size: inherit;
2114
+ }
2115
+ /* A key is a key cap, so it has the edge and the deeper bottom a cap has, which
2116
+ tells it from inline code by shape. */
2117
+ :is(.cr-prose,.cr-editor) :where(kbd) {
2118
+ border: 1px solid var(--cr-outline);
2119
+ border-bottom-width: 2px;
2120
+ }
2121
+ :is(.cr-prose,.cr-editor) :where(a) {
2122
+ color: var(--cr-primary);
2123
+ text-underline-offset: 0.2em;
2124
+ }
2125
+ :is(.cr-prose,.cr-editor) :where(u) {
2126
+ text-decoration: underline;
2127
+ text-decoration-thickness: 1.5px;
2128
+ text-underline-offset: 0.2em;
2129
+ }
2130
+ :is(.cr-prose,.cr-editor) :where(s, strike) {
2131
+ text-decoration: line-through;
2132
+ text-decoration-thickness: 1.5px;
2133
+ }
2134
+ :is(.cr-prose,.cr-editor) :where(ins) {
2135
+ text-decoration: underline;
2136
+ text-decoration-color: var(--cr-success-ink);
2137
+ text-decoration-thickness: 2px;
2138
+ text-underline-offset: 0.2em;
2139
+ }
2140
+ :is(.cr-prose,.cr-editor) :where(del) {
2141
+ text-decoration: line-through;
2142
+ text-decoration-color: var(--cr-danger-ink);
2143
+ text-decoration-thickness: 2px;
2144
+ }
2145
+ :is(.cr-prose,.cr-editor) :where(mark) {
2146
+ background: var(--cr-primary-soft);
2147
+ color: var(--cr-on-primary-soft);
2148
+ }
2149
+ :is(.cr-prose,.cr-editor) :where(sub, sup) {
2150
+ font-size: 0.75em;
2151
+ line-height: 0;
2152
+ }
2153
+ :is(.cr-prose,.cr-editor) :where(hr) {
2154
+ height: 1px;
2155
+ border: 0;
2156
+ background: var(--cr-edge);
2157
+ }
2158
+
2159
+ /* The editable surface: the caret in the primary ink, and an outline-free
2160
+ focus, because the field shell around it draws the ring. The selection is a
2161
+ 28% primary tint under unchanged text. It is not the primary-soft pair,
2162
+ which a highlight (`mark`) already wears: a highlighted word that is then
2163
+ selected must still look selected. */
2164
+ .cr-editor {
2165
+ caret-color: var(--cr-primary);
2166
+ outline: none;
2167
+ min-height: calc(var(--cr-text-body-leading) * 4);
2168
+ padding: var(--cr-space);
2169
+ }
2170
+ .cr-editor ::selection,
2171
+ .cr-editor::selection {
2172
+ background: color-mix(in srgb, var(--cr-primary) 28%, transparent);
2173
+ }
2174
+ /* A highlighted word that is then selected takes the action pair, primary
2175
+ with on-primary ink, which the resolver holds at 4.5:1 in every palette.
2176
+ The 28% tint over the primary-soft highlight fell to 3.74:1 in Harbor
2177
+ (D-39). Forced colours below still draws every selection in Highlight. */
2178
+ .cr-editor :where(mark)::selection,
2179
+ .cr-editor :where(mark) ::selection {
2180
+ background: var(--cr-primary);
2181
+ color: var(--cr-on-primary);
2182
+ }
2183
+ /* An empty block's prompt, read from `data-placeholder`. Engines mark the empty
2184
+ block with `.is-empty` (ProseMirror, TipTap) or leave it `:empty`; both are
2185
+ reached. */
2186
+ .cr-editor :where(.is-empty, :empty)[data-placeholder]::before {
2187
+ content: attr(data-placeholder);
2188
+ float: inline-start;
2189
+ height: 0;
2190
+ pointer-events: none;
2191
+ color: var(--cr-muted);
2192
+ }
2193
+
2194
+ /* The editor's frame: a field shell holding a toolbar and an editable surface.
2195
+ * The shell is an inline control by default; holding an editor it becomes a
2196
+ * column at the content radius, padded by its own Haze inset so the toolbar
2197
+ * and the text sit on the well. The selector is (0,2,0), so it outranks the
2198
+ * shell's own (0,1,0) inline layout and 20px radius in this layer; written in
2199
+ * `:where()`, as first drafted, it lost to both and centred the toolbar. */
2200
+ .cr-field-shell:has(> .cr-editor) {
2201
+ display: flex;
2202
+ flex-direction: column;
2203
+ align-items: stretch;
2204
+ width: 100%;
2205
+ min-width: 0;
2206
+ box-sizing: border-box;
2207
+ padding: var(--cr-haze-inset);
2208
+ border-radius: var(--cr-radius);
2209
+ }
2210
+
2211
+ /* The formatting toolbar.
2212
+ *
2213
+ * On a fine pointer it sits above the text and sticks to the top of the
2214
+ * surface as the document scrolls. On a touch screen it moves below the text
2215
+ * and sticks to the bottom, above the on-screen keyboard where the browser
2216
+ * reports it (`keyboard-inset-height`, from the VirtualKeyboard API), so the
2217
+ * formatting a person is using is never under their keyboard and is in reach of
2218
+ * a thumb. */
2219
+ .cr-editor-toolbar {
2220
+ position: sticky;
2221
+ inset-block-start: 0;
2222
+ z-index: 1;
2223
+ display: flex;
2224
+ flex-wrap: wrap;
2225
+ align-items: center;
2226
+ gap: 2px;
2227
+ padding: var(--cr-spacing-2xs);
2228
+ border-bottom: 1px solid var(--cr-edge);
2229
+ }
2230
+ .cr-editor-toolbar > [role=separator] {
2231
+ align-self: stretch;
2232
+ width: 1px;
2233
+ margin: var(--cr-spacing-xs) var(--cr-spacing-2xs);
2234
+ background: var(--cr-edge);
2235
+ }
2236
+ /* `.below` asks for the touch placement on any pointer, for a product that
2237
+ knows its layout better than the media query does. */
2238
+ .cr-editor-toolbar.below {
2239
+ order: 2;
2240
+ inset-block-start: auto;
2241
+ inset-block-end: env(keyboard-inset-height, 0px);
2242
+ border-bottom: 0;
2243
+ border-top: 1px solid var(--cr-edge);
2244
+ }
2245
+ @media (pointer: coarse) {
2246
+ .cr-editor-toolbar {
2247
+ order: 2;
2248
+ inset-block-start: auto;
2249
+ inset-block-end: env(keyboard-inset-height, 0px);
2250
+ flex-wrap: nowrap;
2251
+ overflow-x: auto;
2252
+ overscroll-behavior: contain;
2253
+ border-bottom: 0;
2254
+ border-top: 1px solid var(--cr-edge);
2255
+ scrollbar-width: none;
2256
+ }
2257
+ .cr-editor-toolbar > * {
2258
+ flex: none;
2259
+ touch-action: manipulation;
2260
+ }
2261
+ }
2262
+
2263
+ [data-effects=opaque] .cr-media-caption > *::before {
2264
+ background: var(--cr-surface);
2265
+ filter: none;
2266
+ }
2267
+ @media (prefers-reduced-transparency:reduce) {
2268
+ .cr-media-caption > *::before {
2269
+ background: var(--cr-surface);
2270
+ filter: none;
2271
+ }
2272
+ .cr-media :is(video)::cue {
2273
+ background: var(--cr-surface);
2274
+ }
2275
+ }
2276
+ @media (forced-colors:active) {
2277
+ .cr-media {
2278
+ border: 1px solid CanvasText;
2279
+ }
2280
+ :is(.cr-resin,.cr-glass).transport :where(time, output, .time) {
2281
+ background: Canvas;
2282
+ color: CanvasText;
2283
+ }
2284
+ .cr-media-caption > * {
2285
+ background: Canvas;
2286
+ color: CanvasText;
2287
+ border: 1px solid CanvasText;
2288
+ }
2289
+ .cr-media-caption > *::before {
2290
+ display: none;
2291
+ }
2292
+ :is(.cr-prose,.cr-editor) :where(mark) {
2293
+ background: Mark;
2294
+ color: MarkText;
2295
+ }
2296
+ :is(.cr-prose,.cr-editor) :where(ins, del) {
2297
+ text-decoration-color: CanvasText;
2298
+ }
2299
+ .cr-editor ::selection,
2300
+ .cr-editor::selection {
2301
+ background: Highlight;
2302
+ color: HighlightText;
2303
+ }
2304
+ .cr-editor-toolbar,
2305
+ .cr-editor-toolbar > [role=separator] {
2306
+ border-color: CanvasText;
2307
+ }
2308
+ }
2309
+ }