@ambientcss/components 1.2.1 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +97 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +97 -28
- package/dist/index.js.map +1 -1
- package/dist/styles.css +336 -66
- package/package.json +2 -2
- package/src/components/AmbientButton.tsx +27 -4
- package/src/components/AmbientFader.tsx +3 -7
- package/src/components/AmbientKnob.tsx +95 -9
- package/src/components/AmbientSlider.tsx +3 -9
- package/src/components/AmbientSwitch.tsx +5 -2
- package/src/index.ts +2 -2
- package/src/styles.css +336 -66
package/src/styles.css
CHANGED
|
@@ -17,6 +17,31 @@
|
|
|
17
17
|
--ambx-fader-label-clearance: calc(var(--ambx-grid) * 4);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
/* Every control sizes its moving part as a percentage of a padded box —
|
|
21
|
+
a button's cap is 100% of a well inset by the clearance ring, a knob's
|
|
22
|
+
face 100% of the knob. Under the default content-box those paddings add
|
|
23
|
+
to the percentage instead of fitting inside it, and the cap renders
|
|
24
|
+
larger than the well it sits in. Scoped to the package's own elements
|
|
25
|
+
rather than shipped as a global reset: apps that already reset globally
|
|
26
|
+
(apps/demo does) see no change, and apps that do not are no longer
|
|
27
|
+
silently broken. */
|
|
28
|
+
.amb-button,
|
|
29
|
+
.amb-knob,
|
|
30
|
+
.amb-switch,
|
|
31
|
+
.amb-fader,
|
|
32
|
+
.amb-slider,
|
|
33
|
+
.ambx-panel,
|
|
34
|
+
.ambx-stack,
|
|
35
|
+
.amb-button *,
|
|
36
|
+
.amb-knob *,
|
|
37
|
+
.amb-switch *,
|
|
38
|
+
.amb-fader *,
|
|
39
|
+
.amb-slider *,
|
|
40
|
+
.ambx-panel *,
|
|
41
|
+
.ambx-stack * {
|
|
42
|
+
box-sizing: border-box;
|
|
43
|
+
}
|
|
44
|
+
|
|
20
45
|
.amb-heading-1 {
|
|
21
46
|
font-size: var(--ambx-type-1-size);
|
|
22
47
|
line-height: var(--ambx-type-1-line);
|
|
@@ -35,51 +60,264 @@
|
|
|
35
60
|
letter-spacing: var(--ambx-type-tracking);
|
|
36
61
|
}
|
|
37
62
|
|
|
63
|
+
/* Button: a chamfered key cap seated in a clearance well — the referent
|
|
64
|
+
is components/button.py's "flush" style (cap seated into a hole with a
|
|
65
|
+
shadow gap ring around it). The button element IS the well: a shallow
|
|
66
|
+
groove (seat depth ~1.2mm = thickness 0.27) whose lume interior shows
|
|
67
|
+
as the gap ring around the cap. Pressing sinks the cap by the
|
|
68
|
+
referent's 0.7mm travel (thickness 1 -> 0.84): the chamfer bands and
|
|
69
|
+
the swept shadow shrink with it for free. */
|
|
38
70
|
.amb-button {
|
|
39
71
|
cursor: pointer;
|
|
40
|
-
border:
|
|
41
|
-
|
|
42
|
-
|
|
72
|
+
border: none;
|
|
73
|
+
padding: var(--ambx-grid-half); /* the clearance gap ring */
|
|
74
|
+
--amb-thickness: 0.27; /* seat depth of the well */
|
|
75
|
+
background-color: var(--amb-lume);
|
|
76
|
+
border-radius: calc(var(--ambx-grid) * 3 + var(--ambx-grid-half));
|
|
77
|
+
min-width: calc(var(--ambx-grid) * 16);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.amb-button-cap {
|
|
81
|
+
display: grid;
|
|
82
|
+
place-items: center;
|
|
83
|
+
width: 100%;
|
|
84
|
+
padding: calc(var(--ambx-grid) * 1.5) calc(var(--ambx-grid) * 2);
|
|
43
85
|
border-radius: calc(var(--ambx-grid) * 3);
|
|
44
86
|
text-transform: uppercase;
|
|
45
|
-
min-width: calc(var(--ambx-grid) * 16);
|
|
46
87
|
font-weight: 600;
|
|
47
|
-
color: var(--amb-
|
|
88
|
+
color: var(--amb-label);
|
|
48
89
|
}
|
|
49
90
|
|
|
50
91
|
.amb-button:focus {
|
|
51
92
|
outline-offset: var(--ambx-grid);
|
|
52
93
|
}
|
|
53
94
|
|
|
54
|
-
.amb-button:hover
|
|
55
|
-
|
|
56
|
-
border-color: var(--amb-highlight-color);
|
|
95
|
+
.amb-button:hover .amb-button-cap {
|
|
96
|
+
color: var(--amb-highlight-color);
|
|
57
97
|
}
|
|
58
98
|
|
|
59
|
-
.amb-button:active {
|
|
60
|
-
--amb-
|
|
99
|
+
.amb-button:active .amb-button-cap {
|
|
100
|
+
--amb-thickness: 0.84;
|
|
61
101
|
}
|
|
62
102
|
|
|
103
|
+
/* Button shapes, matching the referent lineup (ambient3d/generate.py):
|
|
104
|
+
the default stadium key above, a round key (superellipse exponent 2 —
|
|
105
|
+
pair with amb-mat-shiny for the machined metal-button look), and a
|
|
106
|
+
squarer, flatter EP-133-style pad (exponent 6: tighter corners and a
|
|
107
|
+
3.6mm cap instead of the key's 4.5mm — thickness 0.8 — with the same
|
|
108
|
+
0.7mm press travel). */
|
|
109
|
+
.amb-button.amb-button-round {
|
|
110
|
+
min-width: calc(var(--ambx-grid) * 12);
|
|
111
|
+
aspect-ratio: 1;
|
|
112
|
+
border-radius: 50%;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.amb-button-round .amb-button-cap {
|
|
116
|
+
height: 100%;
|
|
117
|
+
padding: var(--ambx-grid);
|
|
118
|
+
border-radius: 50%;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.amb-button.amb-button-square {
|
|
122
|
+
min-width: calc(var(--ambx-grid) * 14);
|
|
123
|
+
aspect-ratio: 1;
|
|
124
|
+
border-radius: calc(var(--ambx-grid) * 2);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.amb-button-square .amb-button-cap {
|
|
128
|
+
height: 100%;
|
|
129
|
+
padding: var(--ambx-grid);
|
|
130
|
+
border-radius: calc(var(--ambx-grid) * 1.5);
|
|
131
|
+
--amb-thickness: 0.8;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.amb-button.amb-button-square:active .amb-button-cap {
|
|
135
|
+
--amb-thickness: 0.64;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/* Knob: a knob-scale body (thickness 2 = the referent knob.py's 9mm
|
|
139
|
+
height) resting on the panel. The rotating face carries the knurl — a
|
|
140
|
+
repeating-conic rib pattern, physically the referent's ribs catching
|
|
141
|
+
key light on one flank and shading on the other — under a smooth
|
|
142
|
+
opaque top disc (the OP-1-style cap), with an accent indicator dot.
|
|
143
|
+
The whole face rotates with the value, so the ribs move under the
|
|
144
|
+
fingers like the real thing. */
|
|
63
145
|
.amb-knob {
|
|
64
146
|
border-radius: 50%;
|
|
65
147
|
height: calc(var(--ambx-grid) * 16);
|
|
66
148
|
width: calc(var(--ambx-grid) * 16);
|
|
67
|
-
border: medium solid var(--amb-lume);
|
|
68
149
|
}
|
|
69
150
|
|
|
70
|
-
|
|
151
|
+
/* The body is the smooth circle at the tooth-root radius: it carries
|
|
152
|
+
the ambient drop shadow (kept circular — the teeth are too fine to
|
|
153
|
+
read in a penumbra) while the clipped face above it supplies the
|
|
154
|
+
knurled silhouette. */
|
|
155
|
+
.amb-knob-body {
|
|
156
|
+
position: absolute;
|
|
157
|
+
inset: calc(var(--ambx-grid) / 2);
|
|
158
|
+
border-radius: 50%;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/* The rotating face: clipped to the straight-knurl silhouette (the
|
|
162
|
+
inline SVG clipPath in AmbientKnob), opaque at the knob's surface
|
|
163
|
+
color, with per-tooth flank shading — a lit leading flank and a
|
|
164
|
+
shaded trailing flank every 10deg, phase-aligned with the clip's
|
|
165
|
+
teeth (conic 0 is rotated to the +x axis where the tooth path
|
|
166
|
+
starts) — under the smooth top disc. */
|
|
167
|
+
.amb-knob-face {
|
|
168
|
+
position: absolute;
|
|
169
|
+
inset: 0;
|
|
170
|
+
background-color: hsl(
|
|
171
|
+
var(--amb-light-hue)
|
|
172
|
+
var(--amb-light-saturation)
|
|
173
|
+
calc(
|
|
174
|
+
var(--amb-key-light-intensity) * 31.5% +
|
|
175
|
+
var(--amb-fill-light-intensity) * 26.4% + 43.6%
|
|
176
|
+
)
|
|
177
|
+
);
|
|
178
|
+
background-image:
|
|
179
|
+
radial-gradient(
|
|
180
|
+
circle,
|
|
181
|
+
hsl(
|
|
182
|
+
var(--amb-light-hue)
|
|
183
|
+
var(--amb-light-saturation)
|
|
184
|
+
calc(
|
|
185
|
+
var(--amb-key-light-intensity) * 31.5% +
|
|
186
|
+
var(--amb-fill-light-intensity) * 26.4% + 43.6%
|
|
187
|
+
)
|
|
188
|
+
) 0 60%,
|
|
189
|
+
transparent 61%
|
|
190
|
+
),
|
|
191
|
+
repeating-conic-gradient(
|
|
192
|
+
from 90deg,
|
|
193
|
+
hsl(var(--amb-light-hue) var(--amb-light-saturation) 100% /
|
|
194
|
+
calc(var(--amb-key-light-intensity) * 0.35)) 0deg 1.4deg,
|
|
195
|
+
transparent 2.2deg 4.6deg,
|
|
196
|
+
hsl(var(--amb-light-hue) var(--amb-light-saturation) 0% /
|
|
197
|
+
calc((var(--amb-key-light-intensity) - var(--amb-fill-light-intensity))
|
|
198
|
+
* 0.3 + 0.16)) 5deg 6.4deg,
|
|
199
|
+
transparent 7.2deg 10deg
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/* Fluted face (flute variant — the OP-Z-style referent: 14 broad
|
|
204
|
+
ridges split by narrow grooves, pitch 25.714deg). Flank bands sit on
|
|
205
|
+
the clip's rising (0–2.1deg) and falling (18.5–20.6deg) flanks;
|
|
206
|
+
deeper flutes catch more key light, so both bands run stronger than
|
|
207
|
+
the 36-rib knurl's. */
|
|
208
|
+
.amb-knob-face-flute {
|
|
209
|
+
background-image:
|
|
210
|
+
radial-gradient(
|
|
211
|
+
circle,
|
|
212
|
+
hsl(
|
|
213
|
+
var(--amb-light-hue)
|
|
214
|
+
var(--amb-light-saturation)
|
|
215
|
+
calc(
|
|
216
|
+
var(--amb-key-light-intensity) * 31.5% +
|
|
217
|
+
var(--amb-fill-light-intensity) * 26.4% + 43.6%
|
|
218
|
+
)
|
|
219
|
+
) 0 60%,
|
|
220
|
+
transparent 61%
|
|
221
|
+
),
|
|
222
|
+
repeating-conic-gradient(
|
|
223
|
+
from 90deg,
|
|
224
|
+
hsl(var(--amb-light-hue) var(--amb-light-saturation) 100% /
|
|
225
|
+
calc(var(--amb-key-light-intensity) * 0.45)) 0deg 2.1deg,
|
|
226
|
+
transparent 3.2deg 17.4deg,
|
|
227
|
+
hsl(var(--amb-light-hue) var(--amb-light-saturation) 0% /
|
|
228
|
+
calc((var(--amb-key-light-intensity) - var(--amb-fill-light-intensity))
|
|
229
|
+
* 0.35 + 0.2)) 18.5deg 20.6deg,
|
|
230
|
+
transparent 21.6deg 25.7143deg
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/* Fine knurl (cap and wheel variants: 48 ribs, pitch 7.5deg) — the
|
|
235
|
+
36-rib pattern's angles scaled by 3/4, same flank alphas. */
|
|
236
|
+
.amb-knob-face-fine {
|
|
237
|
+
background-image:
|
|
238
|
+
radial-gradient(
|
|
239
|
+
circle,
|
|
240
|
+
hsl(
|
|
241
|
+
var(--amb-light-hue)
|
|
242
|
+
var(--amb-light-saturation)
|
|
243
|
+
calc(
|
|
244
|
+
var(--amb-key-light-intensity) * 31.5% +
|
|
245
|
+
var(--amb-fill-light-intensity) * 26.4% + 43.6%
|
|
246
|
+
)
|
|
247
|
+
) 0 60%,
|
|
248
|
+
transparent 61%
|
|
249
|
+
),
|
|
250
|
+
repeating-conic-gradient(
|
|
251
|
+
from 90deg,
|
|
252
|
+
hsl(var(--amb-light-hue) var(--amb-light-saturation) 100% /
|
|
253
|
+
calc(var(--amb-key-light-intensity) * 0.35)) 0deg 1.05deg,
|
|
254
|
+
transparent 1.65deg 3.45deg,
|
|
255
|
+
hsl(var(--amb-light-hue) var(--amb-light-saturation) 0% /
|
|
256
|
+
calc((var(--amb-key-light-intensity) - var(--amb-fill-light-intensity))
|
|
257
|
+
* 0.3 + 0.16)) 3.75deg 4.8deg,
|
|
258
|
+
transparent 5.4deg 7.5deg
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/* Encoder cap (cap variant — the OP-1-style referent's smooth
|
|
263
|
+
contrasting top disc, 0.35mm proud of the knurl): the accent disc
|
|
264
|
+
replaces the surface-colored center disc over the fine knurl. */
|
|
265
|
+
.amb-knob-face-cap {
|
|
266
|
+
background-image:
|
|
267
|
+
radial-gradient(circle, var(--amb-highlight-color) 0 65%, transparent 66%),
|
|
268
|
+
repeating-conic-gradient(
|
|
269
|
+
from 90deg,
|
|
270
|
+
hsl(var(--amb-light-hue) var(--amb-light-saturation) 100% /
|
|
271
|
+
calc(var(--amb-key-light-intensity) * 0.35)) 0deg 1.05deg,
|
|
272
|
+
transparent 1.65deg 3.45deg,
|
|
273
|
+
hsl(var(--amb-light-hue) var(--amb-light-saturation) 0% /
|
|
274
|
+
calc((var(--amb-key-light-intensity) - var(--amb-fill-light-intensity))
|
|
275
|
+
* 0.3 + 0.16)) 3.75deg 4.8deg,
|
|
276
|
+
transparent 5.4deg 7.5deg
|
|
277
|
+
);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.amb-knob-indicator-dot {
|
|
71
281
|
position: absolute;
|
|
72
|
-
top:
|
|
282
|
+
top: 16%;
|
|
73
283
|
left: 50%;
|
|
74
284
|
transform: translateX(-50%);
|
|
285
|
+
width: calc(var(--ambx-grid) * 2);
|
|
286
|
+
height: calc(var(--ambx-grid) * 2);
|
|
287
|
+
border-radius: 50%;
|
|
288
|
+
background: var(--amb-highlight-color);
|
|
75
289
|
}
|
|
76
290
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
291
|
+
/* Centered dot (flute variant): the OP-Z referent's dot sits in the
|
|
292
|
+
middle of the cap (dot_frac 0.32), not at the rim. */
|
|
293
|
+
.amb-knob-indicator-dot-center {
|
|
294
|
+
top: 50%;
|
|
295
|
+
transform: translate(-50%, -50%);
|
|
296
|
+
width: calc(var(--ambx-grid) * 4.5);
|
|
297
|
+
height: calc(var(--ambx-grid) * 4.5);
|
|
81
298
|
}
|
|
82
299
|
|
|
300
|
+
/* Radial indicator line (line variant): the referent's accent bar,
|
|
301
|
+
center to ~85% of the cap radius, pointing at 12 o'clock. */
|
|
302
|
+
.amb-knob-indicator-line {
|
|
303
|
+
position: absolute;
|
|
304
|
+
top: 12%;
|
|
305
|
+
left: 50%;
|
|
306
|
+
transform: translateX(-50%);
|
|
307
|
+
width: calc(var(--ambx-grid) * 0.75);
|
|
308
|
+
height: 34%;
|
|
309
|
+
border-radius: calc(var(--ambx-grid) * 0.375);
|
|
310
|
+
background: var(--amb-highlight-color);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.amb-knob:hover .amb-knob-indicator-dot,
|
|
314
|
+
.amb-knob:hover .amb-knob-indicator-line {
|
|
315
|
+
background: color-mix(in oklab, var(--amb-highlight-color), white 25%);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/* Tracks are grounded grooves (.amb-groove supplies the recess: lit-wall
|
|
319
|
+
shadow band + far-wall bounce) with a lume interior — dark in bright
|
|
320
|
+
light, glowing in low light — overriding the groove's neutral floor. */
|
|
83
321
|
.amb-fader {
|
|
84
322
|
position: relative;
|
|
85
323
|
width: var(--ambx-grid);
|
|
@@ -88,6 +326,9 @@
|
|
|
88
326
|
background-color: var(--amb-lume);
|
|
89
327
|
}
|
|
90
328
|
|
|
329
|
+
/* Fader thumb: the referent (fader.py) is a pill cap on a stem — 7mm
|
|
330
|
+
tall (thickness 1.5) riding 2.2mm above the plate (elevation 0.28) —
|
|
331
|
+
with a single grip line across the top. */
|
|
91
332
|
.amb-fader-thumb {
|
|
92
333
|
position: absolute;
|
|
93
334
|
width: calc(var(--ambx-grid) * 6);
|
|
@@ -95,55 +336,41 @@
|
|
|
95
336
|
left: 50%;
|
|
96
337
|
top: 50%;
|
|
97
338
|
transform: translate(-50%, -50%);
|
|
98
|
-
border-radius: calc(var(--ambx-grid) *
|
|
339
|
+
border-radius: calc(var(--ambx-grid) * 2);
|
|
99
340
|
display: grid;
|
|
100
341
|
place-items: center;
|
|
342
|
+
--amb-thickness: 1.5;
|
|
343
|
+
--amb-elevation: 0.28;
|
|
101
344
|
}
|
|
102
345
|
|
|
103
|
-
.amb-fader-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
.amb-fader-dot {
|
|
109
|
-
width: 3px;
|
|
110
|
-
height: 3px;
|
|
111
|
-
border-radius: 50%;
|
|
112
|
-
background: radial-gradient(
|
|
113
|
-
circle at 30% 30%,
|
|
114
|
-
color-mix(in oklab, var(--amb-lume), white 30%) 0%,
|
|
115
|
-
var(--amb-lume) 55%,
|
|
116
|
-
color-mix(in oklab, var(--amb-lume), black 35%) 100%
|
|
117
|
-
);
|
|
346
|
+
.amb-fader-gripline {
|
|
347
|
+
width: 70%;
|
|
348
|
+
height: 2px;
|
|
349
|
+
border-radius: 1px;
|
|
350
|
+
background: var(--amb-lume);
|
|
118
351
|
}
|
|
119
352
|
|
|
353
|
+
/* Slider: the referent (slider.py) is a shallow concave channel (1mm
|
|
354
|
+
deep = thickness 0.22), not a through-slot, with a domed disc thumb
|
|
355
|
+
gliding over it. */
|
|
120
356
|
.amb-slider {
|
|
121
357
|
position: relative;
|
|
122
|
-
height: var(--ambx-grid);
|
|
358
|
+
height: calc(var(--ambx-grid) * 1.5);
|
|
123
359
|
width: calc(var(--ambx-grid) * 30);
|
|
124
360
|
border-radius: var(--ambx-grid);
|
|
125
361
|
background-color: var(--amb-lume);
|
|
362
|
+
--amb-thickness: 0.22;
|
|
126
363
|
}
|
|
127
364
|
|
|
128
365
|
.amb-slider-thumb {
|
|
129
366
|
position: absolute;
|
|
130
|
-
width: calc(var(--ambx-grid) *
|
|
367
|
+
width: calc(var(--ambx-grid) * 6);
|
|
131
368
|
height: calc(var(--ambx-grid) * 6);
|
|
132
369
|
top: 50%;
|
|
133
370
|
left: 50%;
|
|
134
371
|
transform: translate(-50%, -50%);
|
|
135
|
-
border-radius:
|
|
136
|
-
|
|
137
|
-
place-items: center;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.amb-slider-grip {
|
|
141
|
-
display: flex;
|
|
142
|
-
flex-direction: column;
|
|
143
|
-
gap: 2px;
|
|
144
|
-
box-shadow:
|
|
145
|
-
inset 0 var(--ambx-grid-quarter) var(--ambx-grid-quarter) rgb(255 255 255 / 0.28),
|
|
146
|
-
inset 0 calc(var(--ambx-grid-quarter) * -1) var(--ambx-grid-quarter) rgb(0 0 0 / 0.22);
|
|
372
|
+
border-radius: 50%;
|
|
373
|
+
--amb-thickness: 0.7;
|
|
147
374
|
}
|
|
148
375
|
|
|
149
376
|
.amb-led {
|
|
@@ -164,16 +391,65 @@
|
|
|
164
391
|
box-shadow: none;
|
|
165
392
|
}
|
|
166
393
|
|
|
394
|
+
/* Switch: a slide switch like the referent (switch.py) — a pill riding
|
|
395
|
+
in a dark stadium recess (well 1.5mm deep = thickness 0.33; the pill
|
|
396
|
+
stands 2.6mm above the recess floor = thickness 0.58), with an
|
|
397
|
+
optional LED above. The pill slides, nothing presses. */
|
|
167
398
|
.amb-switch {
|
|
168
|
-
position: relative;
|
|
169
|
-
width: calc(var(--ambx-grid) * 6);
|
|
170
|
-
height: calc(var(--ambx-grid) * 6);
|
|
171
|
-
border-radius: 50%;
|
|
172
399
|
cursor: pointer;
|
|
173
|
-
border:
|
|
400
|
+
border: none;
|
|
401
|
+
padding: 0;
|
|
402
|
+
background: none;
|
|
403
|
+
display: inline-grid;
|
|
404
|
+
justify-items: center;
|
|
405
|
+
gap: var(--ambx-grid);
|
|
174
406
|
margin: 0;
|
|
175
407
|
}
|
|
176
408
|
|
|
409
|
+
.amb-switch-track {
|
|
410
|
+
position: relative;
|
|
411
|
+
display: block;
|
|
412
|
+
width: var(--ambx-switch-w);
|
|
413
|
+
height: var(--ambx-switch-h);
|
|
414
|
+
border-radius: calc(var(--ambx-switch-h) / 2);
|
|
415
|
+
background-color: var(--amb-lume);
|
|
416
|
+
--amb-thickness: 0.33;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.amb-switch-pill {
|
|
420
|
+
position: absolute;
|
|
421
|
+
top: 50%;
|
|
422
|
+
left: 0;
|
|
423
|
+
width: calc(var(--ambx-switch-w) * 0.52);
|
|
424
|
+
height: calc(var(--ambx-switch-h) * 0.78);
|
|
425
|
+
border-radius: calc(var(--ambx-switch-h) * 0.39);
|
|
426
|
+
transform: translate(calc(var(--ambx-switch-h) * 0.11), -50%);
|
|
427
|
+
transition: transform 140ms ease;
|
|
428
|
+
--amb-thickness: 0.58;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
.amb-switch-on .amb-switch-pill {
|
|
432
|
+
transform: translate(
|
|
433
|
+
calc(var(--ambx-switch-w) - 100% - var(--ambx-switch-h) * 0.11),
|
|
434
|
+
-50%
|
|
435
|
+
);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.amb-switch:hover .amb-switch-pill {
|
|
439
|
+
background-color: color-mix(
|
|
440
|
+
in oklab,
|
|
441
|
+
hsl(
|
|
442
|
+
var(--amb-light-hue)
|
|
443
|
+
var(--amb-light-saturation)
|
|
444
|
+
calc(
|
|
445
|
+
var(--amb-key-light-intensity) * 31.5% +
|
|
446
|
+
var(--amb-fill-light-intensity) * 26.4% + 43.6%
|
|
447
|
+
)
|
|
448
|
+
),
|
|
449
|
+
var(--amb-highlight-color) 12%
|
|
450
|
+
);
|
|
451
|
+
}
|
|
452
|
+
|
|
177
453
|
.ambx-panel {
|
|
178
454
|
border-radius: calc(var(--ambx-grid) * 4);
|
|
179
455
|
padding: calc(var(--ambx-grid) * 4);
|
|
@@ -185,29 +461,23 @@
|
|
|
185
461
|
}
|
|
186
462
|
|
|
187
463
|
.ambx-switch {
|
|
188
|
-
--ambx-switch-
|
|
189
|
-
|
|
190
|
-
height: var(--ambx-switch-size);
|
|
191
|
-
display: inline-grid;
|
|
192
|
-
place-items: center;
|
|
193
|
-
padding: 0;
|
|
464
|
+
--ambx-switch-w: calc(var(--ambx-grid) * 12);
|
|
465
|
+
--ambx-switch-h: calc(var(--ambx-grid) * 6);
|
|
194
466
|
}
|
|
195
467
|
|
|
196
468
|
.ambx-switch-sm {
|
|
197
|
-
--ambx-switch-
|
|
469
|
+
--ambx-switch-w: calc(var(--ambx-grid) * 10);
|
|
470
|
+
--ambx-switch-h: calc(var(--ambx-grid) * 5);
|
|
198
471
|
}
|
|
199
472
|
|
|
200
473
|
.ambx-switch-md {
|
|
201
|
-
--ambx-switch-
|
|
474
|
+
--ambx-switch-w: calc(var(--ambx-grid) * 12);
|
|
475
|
+
--ambx-switch-h: calc(var(--ambx-grid) * 6);
|
|
202
476
|
}
|
|
203
477
|
|
|
204
478
|
.ambx-switch-lg {
|
|
205
|
-
--ambx-switch-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
.amb-switch-on {
|
|
209
|
-
box-shadow:
|
|
210
|
-
inset 0 0 0 var(--ambx-grid-quarter) rgb(255 255 255 / 0.25);
|
|
479
|
+
--ambx-switch-w: calc(var(--ambx-grid) * 16);
|
|
480
|
+
--ambx-switch-h: calc(var(--ambx-grid) * 8);
|
|
211
481
|
}
|
|
212
482
|
|
|
213
483
|
.ambx-stack {
|