@crystal-ui/core 2.3.1 → 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.
- package/README.md +82 -23
- package/assets/core/preferences.d.ts +4 -4
- package/assets/core/preferences.js +4 -4
- package/assets/core/presets.d.ts +4 -3
- package/assets/core/presets.js +24 -18
- package/assets/core/spring.js +9 -10
- package/assets/core/state.js +7 -7
- package/assets/crystal.css +783 -288
- package/assets/crystal.d.ts +3 -3
- package/assets/crystal.js +100 -123
- package/assets/icons/heading-2.svg +1 -0
- package/assets/icons/heading-3.svg +1 -0
- package/assets/icons/heading-4.svg +1 -0
- package/assets/icons/link.svg +1 -0
- package/assets/icons/list-ordered.svg +1 -0
- package/assets/icons/list.svg +1 -0
- package/assets/icons/manifest.json +81 -2
- package/assets/icons/quote.svg +1 -0
- package/assets/icons/redo.svg +1 -0
- package/assets/icons/subscript.svg +1 -0
- package/assets/icons/undo.svg +1 -0
- package/assets/icons/unlink.svg +1 -0
- package/assets/motion.js +13 -12
- package/docs/accessibility.md +50 -54
- package/docs/adoption.md +33 -19
- package/docs/catalogue.md +113 -108
- package/docs/colors.md +67 -73
- package/docs/components.md +142 -66
- package/docs/icons.md +9 -3
- package/docs/materials.md +129 -117
- package/docs/motion-components.md +15 -15
- package/docs/motion.md +156 -158
- package/docs/principles.md +12 -12
- package/docs/tokens.md +129 -130
- package/engines.js +3 -3
- package/package.json +11 -3
- package/tokens/catalogue/01-layout.json +1 -1
- package/tokens/catalogue/02-navigation.json +4 -4
- package/tokens/catalogue/03-actions.json +2 -1
- package/tokens/catalogue/04-inputs.json +30 -22
- package/tokens/catalogue/05-data-display.json +9 -14
- package/tokens/catalogue/06-feedback.json +8 -6
- package/tokens/catalogue/07-overlays.json +4 -4
- package/tokens/catalogue/08-typography.json +12 -8
- package/tokens/catalogue/09-utility.json +1 -1
- package/tokens/catalogue/10-charts.json +7 -7
- package/tokens/catalogue/11-media.json +33 -20
- package/tokens/catalogue/12-commerce.json +4 -4
- package/tokens/catalogue/13-screens.json +2 -3
- package/tokens/catalogue/14-blocks.json +3 -3
- package/tokens/catalogue.json +176 -116
- package/tokens/crystal.tokens.json +6 -6
- package/tokens/motion-recipes.json +6 -6
- package/tokens/surface-recipes.json +3452 -0
- package/tokens/surfaces.json +48 -17
package/assets/crystal.css
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* Crystal cascade layers, declared once and in precedence order.
|
|
2
|
-
reset
|
|
3
|
-
base
|
|
4
|
-
component
|
|
5
|
-
override
|
|
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
|
|
17
|
-
|
|
18
|
-
|
|
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)
|
|
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)
|
|
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
|
|
28
|
-
|
|
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
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
|
52
|
-
.cr-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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)}/*
|
|
59
|
-
|
|
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)
|
|
64
|
-
[data-effects=opaque] :is(.cr-frost,.cr-acrylic),[data-effects=opaque] :is(.cr-resin,.cr-glass){backdrop-filter: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)
|
|
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
|
|
115
|
-
*
|
|
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
|
|
126
|
-
*
|
|
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
|
|
133
|
-
* list jitter. It is not applied to horizontal-only scrollers,
|
|
134
|
-
* reserves space
|
|
135
|
-
* to say a scroller is horizontal-only, since CSS cannot
|
|
136
|
-
*
|
|
137
|
-
*
|
|
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
|
-
*
|
|
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
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
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
|
|
148
|
-
|
|
149
|
-
|
|
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,23 +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
|
|
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}
|
|
163
|
-
/* A dialog's code block scrolls down past 300px
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
code in it for the first time (D-4); a phone's overlay scrollbar hid it. */
|
|
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. */
|
|
167
159
|
.cr-dialog pre{scrollbar-gutter:stable}
|
|
168
160
|
/* A horizontal-only scroller says so, because the stylesheet cannot tell. Setting
|
|
169
161
|
`overflow-x: auto` alone makes `overflow-y` compute to `auto` as well, so the
|
|
170
162
|
browser reserves the inline gutter for a vertical scrollbar that can never
|
|
171
|
-
appear
|
|
163
|
+
appear: 12px lost on every such surface, protecting against no shift. This is
|
|
172
164
|
the declaration `.cr-table-scroll` gets by being excluded from the rule above,
|
|
173
|
-
made available to anything that
|
|
174
|
-
|
|
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. */
|
|
175
167
|
.cr-scroll-x{overflow-x:auto;overflow-y:hidden;scrollbar-gutter:auto}
|
|
176
168
|
|
|
177
169
|
/* A dialog is a reading surface, so it takes the Frost scrollbar; the table
|
|
@@ -192,27 +184,27 @@ dialog.cr-dialog{position:fixed}
|
|
|
192
184
|
|
|
193
185
|
/* The scroll area's edge fade.
|
|
194
186
|
*
|
|
195
|
-
* A fade says there is more in that direction
|
|
196
|
-
* on a touch device where the scrollbar is an overlay that
|
|
197
|
-
* is a mask
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
*
|
|
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.
|
|
201
193
|
*
|
|
202
194
|
* `data-cr-scroll` says which edges have content beyond them and is set by
|
|
203
|
-
* whatever runtime owns the container
|
|
204
|
-
* listener.
|
|
205
|
-
* runtime
|
|
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.
|
|
206
198
|
*
|
|
207
|
-
* `scroll-padding`
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
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.
|
|
211
203
|
*
|
|
212
|
-
* A mask fades the whole element, its own fill and border included.
|
|
213
|
-
* belongs on the element that scrolls, and a material surface that
|
|
214
|
-
* puts its material on a wrapper
|
|
215
|
-
* content it
|
|
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. */
|
|
216
208
|
:is(.cr-scroll,.cr-scroll-frost,.cr-scroll-resin)[data-cr-scroll]{
|
|
217
209
|
--cr-scroll-fade-start:0px;--cr-scroll-fade-end:0px;
|
|
218
210
|
scroll-padding:var(--cr-scroll-fade);
|
|
@@ -238,27 +230,26 @@ dialog.cr-dialog{position:fixed}
|
|
|
238
230
|
#000 calc(100% - var(--cr-scroll-fade-end)),transparent 100%);
|
|
239
231
|
}
|
|
240
232
|
@media(forced-colors:active){
|
|
241
|
-
/* Forced colours exist to make everything legible
|
|
242
|
-
|
|
233
|
+
/* Forced colours exist to make everything legible, and a fade reduces
|
|
234
|
+
legibility. The scrollbar is already system-coloured and marks the edge. */
|
|
243
235
|
:is(.cr-scroll,.cr-scroll-frost,.cr-scroll-resin)[data-cr-scroll]{mask-image:none}
|
|
244
236
|
}
|
|
245
237
|
|
|
246
|
-
/* The older path, for engines that predate the standard properties
|
|
247
|
-
* before 18.2, Chromium before 121. It is
|
|
248
|
-
*
|
|
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.
|
|
249
241
|
*
|
|
250
242
|
* Chromium 121 and later ignore every `::-webkit-scrollbar` pseudo-element on a
|
|
251
243
|
* container whose `scrollbar-width` or `scrollbar-color` is anything but `auto`,
|
|
252
244
|
* and they are set above on exactly these selectors. Left unguarded, these rules
|
|
253
|
-
* are dead in the browser most people use and live in the
|
|
254
|
-
*
|
|
255
|
-
* 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.
|
|
256
247
|
*
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
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. */
|
|
262
253
|
@supports not (scrollbar-color:auto){
|
|
263
254
|
:is(.cr-scroll,.cr-scroll-frost,.cr-scroll-resin,.cr-table-scroll,.cr-dialog)::-webkit-scrollbar{
|
|
264
255
|
width:var(--cr-scrollbar-width);height:var(--cr-scrollbar-width);
|
|
@@ -301,12 +292,12 @@ dialog.cr-dialog{position:fixed}
|
|
|
301
292
|
[data-effects=opaque] :is(.cr-stone,.cr-dock-inner)::before{background:var(--cr-surface);filter:none}
|
|
302
293
|
@media(prefers-reduced-transparency:reduce){
|
|
303
294
|
:is(.cr-stone,.cr-dock-inner)::before{background:var(--cr-surface);filter:none}
|
|
304
|
-
.cr-dialog::backdrop,.cr-mirage{background:var(--cr-mirage-fallback-fill)
|
|
295
|
+
.cr-dialog::backdrop,.cr-mirage{background:var(--cr-mirage-fallback-fill);-webkit-backdrop-filter:none;backdrop-filter:none}
|
|
305
296
|
}
|
|
306
297
|
@media(forced-colors:active){
|
|
307
298
|
.cr-stone{background:Canvas!important;color:CanvasText!important;border:1px solid CanvasText}
|
|
308
299
|
:is(.cr-stone,.cr-dock-inner)::before{display:none}
|
|
309
|
-
.cr-dialog::backdrop,.cr-mirage{background:var(--cr-mirage-fallback-fill)
|
|
300
|
+
.cr-dialog::backdrop,.cr-mirage{background:var(--cr-mirage-fallback-fill);-webkit-backdrop-filter:none;backdrop-filter:none}
|
|
310
301
|
}
|
|
311
302
|
|
|
312
303
|
/* Mirage draws its chroma from the actual backdrop, never an invented overlay gradient. */
|
|
@@ -320,29 +311,22 @@ dialog.cr-dialog{position:fixed}
|
|
|
320
311
|
only ever in the preview's stylesheet.
|
|
321
312
|
|
|
322
313
|
`.cr-control`, `.cr-field-shell`, `.cr-indicator`, `.cr-resin-haze` and
|
|
323
|
-
`.cr-tag` are named throughout `docs/components.md
|
|
324
|
-
circle with
|
|
325
|
-
small display elements use
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
`crystal
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
layer order at the top of this file already reserves a slot. That matters for
|
|
340
|
-
more than tidiness: the rules above sit in `crystal.reset`, an earlier layer,
|
|
341
|
-
so these win regardless of specificity — which is what let a reset-layer hover
|
|
342
|
-
(D-21) and a reset-layer target size (D-20) publish values that never
|
|
343
|
-
rendered. A component recipe belongs in this layer or nowhere. The cascade is
|
|
344
|
-
the one the preview has been rendering all along, which is what makes this an
|
|
345
|
-
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.
|
|
346
330
|
--------------------------------------------------------------------------- */
|
|
347
331
|
@layer crystal.component {
|
|
348
332
|
:is(button,a.cr-button,.cr-control,.cr-field-shell,.cr-resin-haze,.cr-status) {
|
|
@@ -352,8 +336,8 @@ dialog.cr-dialog{position:fixed}
|
|
|
352
336
|
color: var(--cr-text);
|
|
353
337
|
border: 1px solid var(--cr-rim);
|
|
354
338
|
box-shadow: var(--cr-shadow-float);
|
|
355
|
-
backdrop-filter: blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation));
|
|
356
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));
|
|
357
341
|
filter: none;
|
|
358
342
|
}
|
|
359
343
|
:is(button,a.cr-button,.cr-control,.cr-field-shell,.cr-resin-haze,.cr-status)::before {
|
|
@@ -410,8 +394,8 @@ dialog.cr-dialog{position:fixed}
|
|
|
410
394
|
}
|
|
411
395
|
[data-effects=opaque] :is(button,a.cr-button,.cr-control,.cr-field-shell,.cr-resin-haze,.cr-status) {
|
|
412
396
|
background: var(--cr-surface);
|
|
413
|
-
backdrop-filter: none;
|
|
414
397
|
-webkit-backdrop-filter: none;
|
|
398
|
+
backdrop-filter: none;
|
|
415
399
|
}
|
|
416
400
|
[data-effects=opaque] :is(button,a.cr-button,.cr-control,.cr-field-shell,.cr-resin-haze,.cr-status)::after {
|
|
417
401
|
display: none;
|
|
@@ -479,14 +463,13 @@ span.cr-field-shell :is(input,select,textarea):focus-visible {
|
|
|
479
463
|
box-shadow: inset 0 1px 2px var(--cr-shadow-contact),inset 0 -1px 0 var(--cr-rim);
|
|
480
464
|
}
|
|
481
465
|
:is(.cr-resin,.cr-glass,.cr-resin-haze) :is(button,a.cr-button,.cr-button,.cr-control) {
|
|
482
|
-
backdrop-filter: none;
|
|
483
466
|
-webkit-backdrop-filter: none;
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
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. */
|
|
490
473
|
isolation: isolate;
|
|
491
474
|
}
|
|
492
475
|
.cr-indicator {
|
|
@@ -502,8 +485,8 @@ span.cr-field-shell :is(input,select,textarea):focus-visible {
|
|
|
502
485
|
border-radius: 50%;
|
|
503
486
|
border: 1px solid var(--cr-rim);
|
|
504
487
|
background: transparent;
|
|
505
|
-
backdrop-filter: none;
|
|
506
488
|
-webkit-backdrop-filter: none;
|
|
489
|
+
backdrop-filter: none;
|
|
507
490
|
box-shadow: 0 2px 4px var(--cr-control-edge),0 4px 8px var(--cr-shadow-contact);
|
|
508
491
|
color: var(--cr-text);
|
|
509
492
|
font: 800 12px/1 var(--cr-font);
|
|
@@ -576,6 +559,7 @@ span.cr-field-shell {
|
|
|
576
559
|
}
|
|
577
560
|
[data-effects=opaque] .cr-indicator {
|
|
578
561
|
background: var(--cr-surface);
|
|
562
|
+
-webkit-backdrop-filter: none;
|
|
579
563
|
backdrop-filter: none;
|
|
580
564
|
}
|
|
581
565
|
[data-effects=opaque] .cr-indicator::before {
|
|
@@ -587,8 +571,8 @@ span.cr-field-shell {
|
|
|
587
571
|
@media (prefers-reduced-transparency:reduce) {
|
|
588
572
|
:is(button,a.cr-button,.cr-control,.cr-field-shell,.cr-resin-haze,.cr-status) {
|
|
589
573
|
background: var(--cr-surface);
|
|
590
|
-
backdrop-filter: none;
|
|
591
|
-
|
|
574
|
+
-webkit-backdrop-filter: none;
|
|
575
|
+
backdrop-filter: none
|
|
592
576
|
}
|
|
593
577
|
:is(button,a.cr-button,.cr-control,.cr-field-shell,.cr-resin-haze,.cr-status)::after {
|
|
594
578
|
display: none
|
|
@@ -598,6 +582,7 @@ span.cr-field-shell::after {
|
|
|
598
582
|
}
|
|
599
583
|
.cr-indicator {
|
|
600
584
|
background: var(--cr-surface);
|
|
585
|
+
-webkit-backdrop-filter: none;
|
|
601
586
|
backdrop-filter: none
|
|
602
587
|
}
|
|
603
588
|
.cr-indicator::before {
|
|
@@ -613,11 +598,22 @@ span.cr-field-shell::after {
|
|
|
613
598
|
color: CanvasText!important;
|
|
614
599
|
border: 1px solid ButtonText;
|
|
615
600
|
box-shadow: none;
|
|
601
|
+
-webkit-backdrop-filter: none;
|
|
616
602
|
backdrop-filter: none
|
|
617
603
|
}
|
|
618
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 {
|
|
619
605
|
display: none
|
|
620
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
|
+
}
|
|
621
617
|
span.cr-field-shell {
|
|
622
618
|
border: 1px solid ButtonText
|
|
623
619
|
}
|
|
@@ -629,6 +625,7 @@ span.cr-field-shell::after {
|
|
|
629
625
|
color: CanvasText;
|
|
630
626
|
border: 1px solid ButtonText;
|
|
631
627
|
box-shadow: none;
|
|
628
|
+
-webkit-backdrop-filter: none;
|
|
632
629
|
backdrop-filter: none
|
|
633
630
|
}
|
|
634
631
|
.cr-indicator::before {
|
|
@@ -653,30 +650,24 @@ span.cr-field-shell:focus-within {
|
|
|
653
650
|
|
|
654
651
|
|
|
655
652
|
/* ---------------------------------------------------------------------------
|
|
656
|
-
Second adoption pass
|
|
653
|
+
Second adoption pass, 21 September 2026, D-11's third divergence.
|
|
657
654
|
|
|
658
655
|
The first pass lifted the Resin interaction surface and five components the
|
|
659
|
-
preview defined and the library did not
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
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.
|
|
663
661
|
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
question was inverted: a rule belongs to the preview only if it names a
|
|
668
|
-
class or id outside Crystal's `cr-` namespace, and everything else is the
|
|
669
|
-
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.
|
|
670
665
|
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
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.
|
|
674
669
|
|
|
675
|
-
|
|
676
|
-
native form control at all — no checkbox, radio, range, file button, select
|
|
677
|
-
option or menu item lived here, only in the preview.
|
|
678
|
-
|
|
679
|
-
Three exceptions, each decided rather than derived:
|
|
670
|
+
Three exceptions to the predicate, each a decision:
|
|
680
671
|
|
|
681
672
|
· `:not(.swatch)` is stripped from the sheen selector. `.swatch` is the
|
|
682
673
|
preview's; the sheen is Crystal's. The preview keeps its swatches flush
|
|
@@ -684,68 +675,59 @@ span.cr-field-shell:focus-within {
|
|
|
684
675
|
· `.cr-dock-inner` stays with the preview. `components.md` says it shares
|
|
685
676
|
the Stone recipe; `materials.md` says a label on a Resin dock takes its
|
|
686
677
|
own chip. The preview follows one and the library the other, and the
|
|
687
|
-
preview's rule is
|
|
688
|
-
|
|
689
|
-
|
|
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.
|
|
690
681
|
· `.cr-button.danger`'s neutralisation is dropped from both. It styles
|
|
691
|
-
nothing on the preview, and status colours are never redefined. The
|
|
692
|
-
boundary below comes from `components.md
|
|
682
|
+
nothing on the preview, and status colours are never redefined. The
|
|
683
|
+
danger boundary below comes from `components.md`.
|
|
693
684
|
--------------------------------------------------------------------------- */
|
|
694
685
|
@layer crystal.component {
|
|
695
686
|
|
|
696
687
|
/* Destructive actions take the Resin/Haze surface every button has, plus the
|
|
697
|
-
independent danger boundary components.md requires. The
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
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. */
|
|
701
691
|
.cr-button.danger {
|
|
702
692
|
border-color: var(--cr-danger-ink)
|
|
703
693
|
}
|
|
704
694
|
|
|
705
|
-
/* The primary action's
|
|
695
|
+
/* The primary action's reading fill is the primary colour.
|
|
706
696
|
*
|
|
707
697
|
* Meridian, 22 September 2026, twice. First: "the Haze content fill should adopt
|
|
708
698
|
* the primary color, not the rim. The text color will need to be adjusted
|
|
709
|
-
* depending on the primary color." Then
|
|
710
|
-
*
|
|
711
|
-
*
|
|
712
|
-
*
|
|
713
|
-
* What was wrong before either of those: the reset layer asked for
|
|
714
|
-
* `background:var(--cr-primary)` on `.cr-button`, and the Resin control rule in
|
|
715
|
-
* this layer has outranked it since the surface was adopted — so the primary
|
|
716
|
-
* colour survived only as the 8px ring of element background left exposed around
|
|
717
|
-
* an inset, white Haze fill, with white `onPrimary` text sitting on that white
|
|
718
|
-
* 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."
|
|
719
702
|
*
|
|
720
|
-
*
|
|
721
|
-
* palette's
|
|
722
|
-
* Crystal's own light atmosphere an 80% soft tone is within a few percent of the
|
|
723
|
-
* Resin shell around it. The fill was there and nobody could see it — which is
|
|
724
|
-
* what Meridian reported, and it is also not "the primary color".
|
|
725
|
-
*
|
|
726
|
-
* So the fill is `--cr-primary` itself, and the ink is `--cr-on-primary`: the
|
|
727
|
-
* 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
|
|
728
705
|
* palettes and both modes. Measured against the rendered composite it is 4.74 to
|
|
729
706
|
* 10.31, tightest on Ion in light mode.
|
|
730
707
|
*
|
|
731
|
-
*
|
|
732
|
-
*
|
|
733
|
-
*
|
|
734
|
-
*
|
|
735
|
-
*
|
|
736
|
-
*
|
|
737
|
-
*
|
|
738
|
-
*
|
|
739
|
-
*
|
|
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.
|
|
740
724
|
*
|
|
741
|
-
* The rim stays the Resin rim. The colour is in the fill
|
|
725
|
+
* The rim stays the Resin rim. The colour is in the fill, and the perimeter is
|
|
742
726
|
* the same glass every other control has.
|
|
743
727
|
*
|
|
744
|
-
* The tint is opt-in, on `.primary
|
|
745
|
-
* not
|
|
746
|
-
*
|
|
747
|
-
* named `.secondary` — a variant Crystal withdrew when it was established that
|
|
748
|
-
* 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.
|
|
749
731
|
*/
|
|
750
732
|
.cr-button.primary {
|
|
751
733
|
color: var(--cr-on-primary)
|
|
@@ -758,19 +740,16 @@ span.cr-field-shell:focus-within {
|
|
|
758
740
|
*
|
|
759
741
|
* Meridian, 22 September 2026: "remove the Haze content fill from the Quiet
|
|
760
742
|
* buttons." With the pad gone, quiet is the only one of the four that is glass
|
|
761
|
-
* all the way through
|
|
762
|
-
* and the label directly on the material.
|
|
763
|
-
* the distinction that was missing when quiet took the base surface an hour
|
|
764
|
-
* 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.
|
|
765
745
|
*
|
|
766
|
-
* The
|
|
767
|
-
*
|
|
768
|
-
*
|
|
769
|
-
* 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:
|
|
770
749
|
* measured across all six palettes and both modes, `--cr-text` over the Resin
|
|
771
|
-
* fill over canvas, surface, surface-alt and foundation is 10.88 to 18.28
|
|
772
|
-
*
|
|
773
|
-
*
|
|
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.
|
|
774
753
|
*/
|
|
775
754
|
.cr-button.quiet::before {
|
|
776
755
|
display: none
|
|
@@ -811,7 +790,8 @@ input:is([type=checkbox],[type=radio]) {
|
|
|
811
790
|
border:1px solid var(--cr-rim);
|
|
812
791
|
border-radius:9px;
|
|
813
792
|
background:linear-gradient(135deg,var(--cr-control-light),var(--cr-control-color)),var(--cr-resin-fill);
|
|
814
|
-
backdrop-filter:blur(
|
|
793
|
+
-webkit-backdrop-filter:blur(var(--cr-resin-blur));
|
|
794
|
+
backdrop-filter:blur(var(--cr-resin-blur));
|
|
815
795
|
box-shadow:inset 0 2px 2px var(--cr-rim),0 2px 3px var(--cr-control-edge),0 5px 10px var(--cr-shadow-contact);
|
|
816
796
|
display:inline-grid;
|
|
817
797
|
place-items:center
|
|
@@ -920,6 +900,7 @@ input[type=file]::file-selector-button {
|
|
|
920
900
|
padding:9px;
|
|
921
901
|
gap:4px;
|
|
922
902
|
box-shadow:var(--cr-shadow-float);
|
|
903
|
+
-webkit-backdrop-filter:blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation));
|
|
923
904
|
backdrop-filter:blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation))
|
|
924
905
|
}
|
|
925
906
|
.cr-dock::before {
|
|
@@ -936,8 +917,8 @@ input[type=file]::file-selector-button {
|
|
|
936
917
|
border:0;
|
|
937
918
|
background:transparent;
|
|
938
919
|
box-shadow:none;
|
|
939
|
-
backdrop-filter:none;
|
|
940
920
|
-webkit-backdrop-filter:none;
|
|
921
|
+
backdrop-filter:none;
|
|
941
922
|
border-radius:999px;
|
|
942
923
|
color:var(--cr-text)
|
|
943
924
|
}
|
|
@@ -959,6 +940,7 @@ input[type=file]::file-selector-button {
|
|
|
959
940
|
}
|
|
960
941
|
[data-effects=opaque] .cr-dock {
|
|
961
942
|
background:var(--cr-surface);
|
|
943
|
+
-webkit-backdrop-filter:none;
|
|
962
944
|
backdrop-filter:none
|
|
963
945
|
}
|
|
964
946
|
span.cr-status {
|
|
@@ -997,8 +979,8 @@ span.cr-status>span {
|
|
|
997
979
|
border-radius:var(--cr-radius);
|
|
998
980
|
background:var(--cr-resin-fill);
|
|
999
981
|
box-shadow:var(--cr-shadow-content);
|
|
1000
|
-
backdrop-filter:blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation));
|
|
1001
|
-
|
|
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))
|
|
1002
984
|
}
|
|
1003
985
|
.cr-table-scroll::before {
|
|
1004
986
|
content:'';
|
|
@@ -1067,8 +1049,8 @@ span.cr-status>span {
|
|
|
1067
1049
|
}
|
|
1068
1050
|
[data-effects=opaque] .cr-table-scroll {
|
|
1069
1051
|
background:var(--cr-surface);
|
|
1070
|
-
backdrop-filter:none;
|
|
1071
|
-
|
|
1052
|
+
-webkit-backdrop-filter:none;
|
|
1053
|
+
backdrop-filter:none
|
|
1072
1054
|
}
|
|
1073
1055
|
[data-effects=opaque] .cr-table-scroll::before {
|
|
1074
1056
|
display:none
|
|
@@ -1113,6 +1095,7 @@ input:is([type=checkbox],[type=radio])::after {
|
|
|
1113
1095
|
background:Canvas;
|
|
1114
1096
|
border:1px solid ButtonText;
|
|
1115
1097
|
box-shadow:none;
|
|
1098
|
+
-webkit-backdrop-filter:none;
|
|
1116
1099
|
backdrop-filter:none
|
|
1117
1100
|
}
|
|
1118
1101
|
.cr-dock::before {
|
|
@@ -1147,6 +1130,7 @@ span.cr-status>span {
|
|
|
1147
1130
|
background:Canvas;
|
|
1148
1131
|
border:1px solid CanvasText;
|
|
1149
1132
|
box-shadow:none;
|
|
1133
|
+
-webkit-backdrop-filter:none;
|
|
1150
1134
|
backdrop-filter:none
|
|
1151
1135
|
}
|
|
1152
1136
|
.cr-table-scroll::before {
|
|
@@ -1165,12 +1149,13 @@ span.cr-status>span {
|
|
|
1165
1149
|
@media (prefers-reduced-transparency:reduce) {
|
|
1166
1150
|
.cr-dock {
|
|
1167
1151
|
background:var(--cr-surface);
|
|
1152
|
+
-webkit-backdrop-filter:none;
|
|
1168
1153
|
backdrop-filter:none
|
|
1169
1154
|
}
|
|
1170
1155
|
.cr-table-scroll {
|
|
1171
1156
|
background:var(--cr-surface);
|
|
1172
|
-
backdrop-filter:none;
|
|
1173
|
-
|
|
1157
|
+
-webkit-backdrop-filter:none;
|
|
1158
|
+
backdrop-filter:none
|
|
1174
1159
|
}
|
|
1175
1160
|
.cr-table-scroll::before {
|
|
1176
1161
|
display:none
|
|
@@ -1180,21 +1165,19 @@ span.cr-status>span {
|
|
|
1180
1165
|
|
|
1181
1166
|
|
|
1182
1167
|
/* ---------------------------------------------------------------------------
|
|
1183
|
-
Component recipes for the catalogue
|
|
1168
|
+
Component recipes for the catalogue, 28 September 2026.
|
|
1184
1169
|
|
|
1185
1170
|
`core/tokens/surfaces.json` names the closed set of material compositions a
|
|
1186
|
-
component may be made of, and every catalogue entry
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
controls and 127 instances had been approximating with `background:
|
|
1193
|
-
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.
|
|
1194
1177
|
|
|
1195
1178
|
Each recipe is authored here, in `@layer crystal.component`, and nowhere
|
|
1196
|
-
else.
|
|
1197
|
-
|
|
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.
|
|
1198
1181
|
|
|
1199
1182
|
Everything reads tokens where a token exists and falls back to the literal
|
|
1200
1183
|
the token publishes, so a stylesheet loaded without the generated theme
|
|
@@ -1206,22 +1189,23 @@ span.cr-status>span {
|
|
|
1206
1189
|
*
|
|
1207
1190
|
* Selector note, which applies to the three recipes below: the coat is keyed on
|
|
1208
1191
|
* `:is(button, a.cr-button, …)`, specificity (0,1,1), in this same layer. A lone
|
|
1209
|
-
* class is (0,1,0) and loses to it whatever the source order
|
|
1210
|
-
* `<button class="cr-bare">`
|
|
1211
|
-
* therefore carries the element compound and reaches
|
|
1212
|
-
* beat the coat and does not say so in its selector
|
|
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.
|
|
1213
1197
|
*
|
|
1214
|
-
* Crystal paints the Resin coat by element
|
|
1198
|
+
* Crystal paints the Resin coat by element, `:is(button, …)` above, so a
|
|
1215
1199
|
* `<button>` wears the fill, the rim, the float shadow, the backdrop blur and
|
|
1216
1200
|
* both feathered pseudo-layers whether or not anything asked. A control that
|
|
1217
1201
|
* sits inside a surface which already has a coat must not wear a second one: a
|
|
1218
1202
|
* disclosure chevron, a chip's remove button, a sort header, a stepper's arrows,
|
|
1219
1203
|
* the dismiss button on a toast. Declaring `background: transparent` on one of
|
|
1220
1204
|
* those takes off one layer of five. This takes off all five and keeps what a
|
|
1221
|
-
* control still owes
|
|
1205
|
+
* control still owes: the 44px target, the pill hit area and the focus ring.
|
|
1222
1206
|
*
|
|
1223
1207
|
* It is not `.cr-button.quiet`. Quiet keeps the whole shell and drops only the
|
|
1224
|
-
* reading pad, which is what makes a quiet
|
|
1208
|
+
* reading pad, which is what makes a quiet button quiet; a chevron is not a
|
|
1225
1209
|
* Resin control that has been quietened.
|
|
1226
1210
|
*/
|
|
1227
1211
|
:is(button, a, [role=button], .cr-bare).cr-bare {
|
|
@@ -1236,8 +1220,8 @@ span.cr-status>span {
|
|
|
1236
1220
|
border-radius: 999px;
|
|
1237
1221
|
background: transparent;
|
|
1238
1222
|
color: inherit;
|
|
1239
|
-
backdrop-filter: none;
|
|
1240
1223
|
-webkit-backdrop-filter: none;
|
|
1224
|
+
backdrop-filter: none;
|
|
1241
1225
|
filter: none;
|
|
1242
1226
|
font-weight: inherit;
|
|
1243
1227
|
}
|
|
@@ -1256,7 +1240,7 @@ span.cr-status>span {
|
|
|
1256
1240
|
filter: none;
|
|
1257
1241
|
}
|
|
1258
1242
|
/* An on state without a reading pad has nothing to tint, so it takes the
|
|
1259
|
-
weight half of the selection rule and keeps the surface ink
|
|
1243
|
+
weight half of the selection rule and keeps the surface ink. The element
|
|
1260
1244
|
rule above would otherwise leave on-primary ink on a transparent ground. */
|
|
1261
1245
|
.cr-bare:is([aria-pressed=true],[aria-selected=true],[aria-checked=true]) {
|
|
1262
1246
|
color: var(--cr-text);
|
|
@@ -1291,22 +1275,22 @@ span.cr-status>span {
|
|
|
1291
1275
|
/* A navigation entry.
|
|
1292
1276
|
*
|
|
1293
1277
|
* `docs/components.md` names the documentation site's side menu as the
|
|
1294
|
-
* reference implementation of selection
|
|
1295
|
-
*
|
|
1296
|
-
*
|
|
1297
|
-
*
|
|
1298
|
-
*
|
|
1299
|
-
*
|
|
1300
|
-
*
|
|
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.
|
|
1301
1285
|
*
|
|
1302
1286
|
* Selection is label weight, 650 at rest and 800 when current. Nothing is drawn
|
|
1303
1287
|
* beside the label for selection. `.stacked` puts the icon above the label for a
|
|
1304
1288
|
* rail.
|
|
1305
1289
|
*
|
|
1306
|
-
* Current
|
|
1290
|
+
* Current location is a different indicator, and the catalogue says so: "current
|
|
1307
1291
|
* location is a dot; selection within a set is label weight" (D-22, ruled on
|
|
1308
|
-
* 28 September 2026). The dot is drawn on `aria-current` only
|
|
1309
|
-
* `aria-selected` or `aria-pressed`, which are selection
|
|
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
|
|
1310
1294
|
* entry's own inline-start padding, absolutely positioned, so the label does not
|
|
1311
1295
|
* move by a pixel when the page changes. It is a flat mark in the primary colour:
|
|
1312
1296
|
* no material, no elevation, no blur. An entry is furniture on the panel beneath
|
|
@@ -1330,8 +1314,8 @@ span.cr-status>span {
|
|
|
1330
1314
|
line-height: 1.35;
|
|
1331
1315
|
text-align: start;
|
|
1332
1316
|
text-decoration: none;
|
|
1333
|
-
backdrop-filter: none;
|
|
1334
1317
|
-webkit-backdrop-filter: none;
|
|
1318
|
+
backdrop-filter: none;
|
|
1335
1319
|
filter: none;
|
|
1336
1320
|
}
|
|
1337
1321
|
.cr-nav-item::before,
|
|
@@ -1390,9 +1374,10 @@ span.cr-status>span {
|
|
|
1390
1374
|
}
|
|
1391
1375
|
|
|
1392
1376
|
/* A Resin panel: the Resin plane with the content radius instead of the pill,
|
|
1393
|
-
for a floating control plane that is a rectangle
|
|
1394
|
-
media control bar. Fill, rim, blur and shadow are the plane's; only
|
|
1395
|
-
geometry changes, and it matches the Frost panel's so nested radii line
|
|
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. */
|
|
1396
1381
|
:is(.cr-resin,.cr-glass).panel {
|
|
1397
1382
|
border-radius: calc(var(--cr-radius) + 6px);
|
|
1398
1383
|
}
|
|
@@ -1451,10 +1436,10 @@ input[type=radio] {
|
|
|
1451
1436
|
}
|
|
1452
1437
|
|
|
1453
1438
|
/* Disabled. The reset layer dims a native `button:disabled` and nothing else,
|
|
1454
|
-
so an action link, a control span and a navigation entry
|
|
1455
|
-
state
|
|
1456
|
-
|
|
1457
|
-
|
|
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. */
|
|
1458
1443
|
button:disabled,
|
|
1459
1444
|
:is(a.cr-button,.cr-control,.cr-nav-item,.cr-bare,.cr-drag-handle)[aria-disabled=true] {
|
|
1460
1445
|
opacity: var(--cr-action-disabled-opacity, .55);
|
|
@@ -1462,11 +1447,11 @@ button:disabled,
|
|
|
1462
1447
|
filter: none;
|
|
1463
1448
|
}
|
|
1464
1449
|
|
|
1465
|
-
/* Controls inside a Resin plane lose their own backdrop filter
|
|
1450
|
+
/* Controls inside a Resin plane lose their own backdrop filter. The rule above
|
|
1466
1451
|
lists the action controls, and these are controls too. */
|
|
1467
1452
|
:is(.cr-resin,.cr-glass,.cr-resin-haze) :is(.cr-bare,.cr-nav-item,.cr-drag-handle) {
|
|
1468
|
-
backdrop-filter: none;
|
|
1469
1453
|
-webkit-backdrop-filter: none;
|
|
1454
|
+
backdrop-filter: none;
|
|
1470
1455
|
isolation: isolate;
|
|
1471
1456
|
}
|
|
1472
1457
|
|
|
@@ -1510,11 +1495,11 @@ input[type=checkbox][role=switch] {
|
|
|
1510
1495
|
|
|
1511
1496
|
|
|
1512
1497
|
/* ---------------------------------------------------------------------------
|
|
1513
|
-
Rulings of 29 September 2026
|
|
1498
|
+
Rulings of 29 September 2026, proposals/2026-09-29-rulings.md.
|
|
1514
1499
|
|
|
1515
|
-
Each recipe below closes an open issue
|
|
1516
|
-
Crystal
|
|
1517
|
-
|
|
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
|
|
1518
1503
|
pane, a count badge. As in the block above, each is authored in
|
|
1519
1504
|
`@layer crystal.component` and nowhere else, and each carries its own
|
|
1520
1505
|
reduced-transparency and forced-colours branches.
|
|
@@ -1526,8 +1511,8 @@ input[type=checkbox][role=switch] {
|
|
|
1526
1511
|
* `.cr-dock button` reaches only a <button>. A tab is often `[role=tab]` on
|
|
1527
1512
|
* another element, a segmented control is often radio inputs inside labels, and
|
|
1528
1513
|
* a dock or bottom-bar destination is a link carrying `aria-current`. Each gets
|
|
1529
|
-
* the dock button's values here, selected by its own state
|
|
1530
|
-
* checked radio
|
|
1514
|
+
* the dock button's values here, selected by its own state: `aria-selected`, a
|
|
1515
|
+
* checked radio or `aria-current`.
|
|
1531
1516
|
*
|
|
1532
1517
|
* Every selector is inside `:where()`, so it adds no specificity to `.cr-dock`,
|
|
1533
1518
|
* and the existing `.cr-dock button` rules (0,1,1) keep winning on a <button>
|
|
@@ -1561,8 +1546,8 @@ input[type=checkbox][role=switch] {
|
|
|
1561
1546
|
}
|
|
1562
1547
|
/* The radio is the control and the label is what is seen; the input stays in the
|
|
1563
1548
|
accessibility tree and takes focus, and its ring is drawn on the label. The
|
|
1564
|
-
label is matched by a radio anywhere inside it
|
|
1565
|
-
its input in a visually hidden span
|
|
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
|
|
1566
1551
|
child is hidden here, because a wrapped one is already hidden by its wrapper. */
|
|
1567
1552
|
.cr-dock :where(label:has(> input[type=radio])) > input[type=radio] {
|
|
1568
1553
|
position: absolute;
|
|
@@ -1599,13 +1584,13 @@ input[type=checkbox][role=switch] {
|
|
|
1599
1584
|
}
|
|
1600
1585
|
}
|
|
1601
1586
|
|
|
1602
|
-
/* A group
|
|
1587
|
+
/* A group: the `group` surface (D-26).
|
|
1603
1588
|
*
|
|
1604
1589
|
* A button group and a split button are one Resin plane whose segments touch:
|
|
1605
1590
|
* the silhouette is a single pill, the interior corners square off against
|
|
1606
1591
|
* their neighbours, and a hairline in `--cr-edge` separates them. The plane is
|
|
1607
|
-
* the group's, so the children give up their own elevation and diffusion
|
|
1608
|
-
* Resin button on a Resin plane is the composition Crystal forbids
|
|
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
|
|
1609
1594
|
* their fill, so a primary action's ink still has its fill beneath it.
|
|
1610
1595
|
*
|
|
1611
1596
|
* The child selector is `:is(button, a.cr-button, .cr-button, .cr-control)`
|
|
@@ -1620,8 +1605,8 @@ input[type=checkbox][role=switch] {
|
|
|
1620
1605
|
border-radius: 999px;
|
|
1621
1606
|
background: var(--cr-resin-fill);
|
|
1622
1607
|
box-shadow: var(--cr-shadow-float);
|
|
1623
|
-
backdrop-filter: blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation));
|
|
1624
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));
|
|
1625
1610
|
}
|
|
1626
1611
|
.cr-group::before {
|
|
1627
1612
|
content: '';
|
|
@@ -1636,8 +1621,8 @@ input[type=checkbox][role=switch] {
|
|
|
1636
1621
|
.cr-group > :is(button, a.cr-button, .cr-button, .cr-control) {
|
|
1637
1622
|
border-radius: 0;
|
|
1638
1623
|
box-shadow: none;
|
|
1639
|
-
backdrop-filter: none;
|
|
1640
1624
|
-webkit-backdrop-filter: none;
|
|
1625
|
+
backdrop-filter: none;
|
|
1641
1626
|
isolation: isolate;
|
|
1642
1627
|
}
|
|
1643
1628
|
.cr-group > :is(button, a.cr-button, .cr-button, .cr-control):first-child {
|
|
@@ -1672,14 +1657,14 @@ input[type=checkbox][role=switch] {
|
|
|
1672
1657
|
}
|
|
1673
1658
|
[data-effects=opaque] .cr-group {
|
|
1674
1659
|
background: var(--cr-surface);
|
|
1675
|
-
backdrop-filter: none;
|
|
1676
1660
|
-webkit-backdrop-filter: none;
|
|
1661
|
+
backdrop-filter: none;
|
|
1677
1662
|
}
|
|
1678
1663
|
@media (prefers-reduced-transparency:reduce) {
|
|
1679
1664
|
.cr-group {
|
|
1680
1665
|
background: var(--cr-surface);
|
|
1681
|
-
backdrop-filter: none;
|
|
1682
1666
|
-webkit-backdrop-filter: none;
|
|
1667
|
+
backdrop-filter: none;
|
|
1683
1668
|
}
|
|
1684
1669
|
.cr-group::before {
|
|
1685
1670
|
filter: none;
|
|
@@ -1690,6 +1675,7 @@ input[type=checkbox][role=switch] {
|
|
|
1690
1675
|
background: ButtonFace;
|
|
1691
1676
|
border: 1px solid ButtonText;
|
|
1692
1677
|
box-shadow: none;
|
|
1678
|
+
-webkit-backdrop-filter: none;
|
|
1693
1679
|
backdrop-filter: none;
|
|
1694
1680
|
}
|
|
1695
1681
|
.cr-group::before {
|
|
@@ -1706,13 +1692,13 @@ input[type=checkbox][role=switch] {
|
|
|
1706
1692
|
* A surface that scrolls takes its title out of view in a tall dialog, and
|
|
1707
1693
|
* cannot take the edge fade, because a mask fades an element's own fill and rim
|
|
1708
1694
|
* along with its content. So the surface is a column that does not scroll, and
|
|
1709
|
-
* `.cr-dialog-body` scrolls inside it
|
|
1695
|
+
* `.cr-dialog-body` scrolls inside it, with `.cr-scroll-frost` beside it for
|
|
1710
1696
|
* the scroll contract, the Frost scrollbar and the edge fade, since a dialog is
|
|
1711
1697
|
* a reading surface.
|
|
1712
1698
|
*
|
|
1713
1699
|
* Keyed on the body's presence, so a 2.2 dialog written without one goes on
|
|
1714
|
-
* scrolling as its surface
|
|
1715
|
-
*
|
|
1700
|
+
* scrolling as its surface. And only an open native dialog is shown: an author
|
|
1701
|
+
* `display` would otherwise beat the browser's
|
|
1716
1702
|
* `dialog:not([open]) { display: none }`. */
|
|
1717
1703
|
.cr-dialog:has(> .cr-dialog-body) {
|
|
1718
1704
|
display: flex;
|
|
@@ -1722,8 +1708,8 @@ input[type=checkbox][role=switch] {
|
|
|
1722
1708
|
dialog.cr-dialog:has(> .cr-dialog-body):not([open]) {
|
|
1723
1709
|
display: none;
|
|
1724
1710
|
}
|
|
1725
|
-
/* The header
|
|
1726
|
-
|
|
1711
|
+
/* The gap below the header. It matches the gap inside the header, as the
|
|
1712
|
+
footer's 24px matches its own. */
|
|
1727
1713
|
.cr-dialog > header + .cr-dialog-body {
|
|
1728
1714
|
margin-top: 20px;
|
|
1729
1715
|
}
|
|
@@ -1741,12 +1727,12 @@ dialog.cr-dialog:has(> .cr-dialog-body):not([open]) {
|
|
|
1741
1727
|
/* An overlay inside a pane (D-25).
|
|
1742
1728
|
*
|
|
1743
1729
|
* On the page a transient overlay is Frost. Inside a pane that is already
|
|
1744
|
-
* lifted
|
|
1745
|
-
* floating a second pane of glass
|
|
1746
|
-
* way over a Haze dialog cannot be told from the dialog
|
|
1747
|
-
* Haze given the one boundary it needs: a flat fill, the `--cr-edge` rim and
|
|
1748
|
-
* content shadow. There is no feather
|
|
1749
|
-
* 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. */
|
|
1750
1736
|
:is(.cr-haze,.cr-surface).overlay {
|
|
1751
1737
|
border: 1px solid var(--cr-edge);
|
|
1752
1738
|
border-radius: var(--cr-radius);
|
|
@@ -1778,8 +1764,8 @@ dialog.cr-dialog:has(> .cr-dialog-body):not([open]) {
|
|
|
1778
1764
|
* `.cr-resin-haze` is sized for a tag: its Haze pad is inset by
|
|
1779
1765
|
* `--cr-haze-inset`, 8px, and its block padding is 17px. On a 20px count badge
|
|
1780
1766
|
* the first leaves a pad a few pixels across with the digit mostly outside it,
|
|
1781
|
-
* and the second makes the badge 55px tall. A count fills to its own edge
|
|
1782
|
-
* is smaller than the perimeter the inset protects
|
|
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
|
|
1783
1769
|
* is a circle that becomes a pill as the digits need it: a square minimum and a
|
|
1784
1770
|
* pill radius, so the shape follows the content. 20px is
|
|
1785
1771
|
* `component.indicator.size`; 4px is the smallest spacing step. */
|
|
@@ -1804,11 +1790,520 @@ dialog.cr-dialog:has(> .cr-dialog-body):not([open]) {
|
|
|
1804
1790
|
inset: 0;
|
|
1805
1791
|
}
|
|
1806
1792
|
|
|
1807
|
-
/* The indicator's field glyphs
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
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. */
|
|
1811
1797
|
:where(.cr-field-shell:not(span)):has(> .cr-indicator) {
|
|
1812
1798
|
padding-inline-end: 40px;
|
|
1813
1799
|
}
|
|
1814
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
|
+
}
|