@sofyan/glass 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/glass.css ADDED
@@ -0,0 +1,699 @@
1
+ /*
2
+ * @sofyan/glass: Liquid Glass material
3
+ * ---------------------------------------------------------------------------
4
+ * A translucent, light-bending material inspired by Apple's Liquid Glass:
5
+ * - backdrop blur + saturation boost so content behind the layer glows through
6
+ * - a specular rim (bright top edge that fades) drawn as a masked gradient ring,
7
+ * so it follows any border-radius
8
+ * - a near-invisible sheen, soft depth shadows and a gentle spring on press
9
+ *
10
+ * Every visual decision is a CSS custom property (--lg-*). Override any of them on
11
+ * :root (or on an element) to retune the material without touching components.
12
+ *
13
+ * Cascade: everything lives in cascade layers, in Tailwind v4's order. Tailwind
14
+ * utilities (layer `utilities`) therefore always beat these classes, and any unlayered
15
+ * CSS of yours beats both. The order is declared here as well, so it holds even when
16
+ * this file is imported before Tailwind, or in a project without Tailwind.
17
+ *
18
+ * Accessibility (bottom of file):
19
+ * - no backdrop-filter support → denser fill
20
+ * - prefers-reduced-transparency → near-opaque fill, no blur
21
+ * - prefers-contrast: more → solid edges, no sheen
22
+ * - prefers-reduced-motion → no lift, press or slide animations
23
+ */
24
+
25
+ @layer theme, base, components, utilities;
26
+
27
+ /* ── Tokens ───────────────────────────────────────────────────────────── */
28
+ @layer base {
29
+ :root {
30
+ /* Accent colours. Fall back to the --color-primary / --color-secondary that many apps
31
+ already set; set --lg-accent directly to use something else. */
32
+ --lg-accent: var(--color-primary, #0a84ff);
33
+ --lg-accent-strong: var(--color-primary-dark, #0060df);
34
+ --lg-accent-2: var(--color-secondary, #5e5ce6);
35
+ --lg-accent-2-strong: var(--color-secondary-dark, #4b49c9);
36
+ --lg-danger: #ff3b30; /* iOS system red */
37
+ --lg-danger-strong: #e5352b;
38
+
39
+ /* Theme-aware neutrals as RGB triplets, so `rgb(var(--lg-c-ink) / 0.5)` works.
40
+ tailwind.css maps them to `lg-*` colours. Redefine them for dark mode. */
41
+ --lg-c-canvas: 245 245 247;
42
+ --lg-c-paper: 255 255 255;
43
+ --lg-c-raised: 255 255 255;
44
+ --lg-c-ink: 29 29 31;
45
+ --lg-c-ink-2: 110 110 115;
46
+ --lg-c-ink-3: 160 160 166;
47
+ --lg-c-line: 0 0 0;
48
+
49
+ /* Material */
50
+ --lg-blur: 24px;
51
+ --lg-blur-thin: 12px;
52
+ --lg-blur-thick: 40px;
53
+ --lg-saturate: 180%;
54
+
55
+ /* Light glass (over light or colourful content) */
56
+ --lg-light-fill: rgba(255, 255, 255, 0.66);
57
+ --lg-light-fill-hover: rgba(255, 255, 255, 0.8);
58
+ --lg-light-text: #0b1220;
59
+ --lg-light-rim: rgba(255, 255, 255, 0.8);
60
+ --lg-light-rim-low: rgba(255, 255, 255, 0);
61
+ --lg-light-edge: rgba(15, 23, 42, 0.06);
62
+
63
+ /* Dark glass (over dark or photographic content) */
64
+ --lg-dark-fill: rgba(30, 30, 34, 0.5);
65
+ --lg-dark-fill-hover: rgba(44, 44, 50, 0.58);
66
+ --lg-dark-text: #ffffff;
67
+ --lg-dark-rim: rgba(255, 255, 255, 0.16);
68
+ --lg-dark-rim-low: rgba(255, 255, 255, 0);
69
+ --lg-dark-edge: rgba(255, 255, 255, 0.08);
70
+
71
+ /* Clear glass (minimal tint, floating over media) */
72
+ --lg-clear-fill: rgba(255, 255, 255, 0.1);
73
+ --lg-clear-fill-hover: rgba(255, 255, 255, 0.18);
74
+
75
+ /* Sheen: deliberately near-invisible. A visible gloss band reads as 2009-era Aero;
76
+ modern glass is flat and lit only at the edge. */
77
+ --lg-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 30%);
78
+ --lg-sheen-dark: none;
79
+
80
+ /* Depth: one large, faint, diffuse shadow, no hard contact shadows. */
81
+ --lg-shadow-sm: 0 2px 12px rgba(15, 23, 42, 0.05);
82
+ --lg-shadow-md: 0 8px 32px rgba(15, 23, 42, 0.08);
83
+ --lg-shadow-lg: 0 16px 48px rgba(15, 23, 42, 0.12);
84
+ --lg-shadow-dark: 0 12px 40px rgba(0, 0, 0, 0.35);
85
+
86
+ /* Shape: soft, not bubbly. */
87
+ --lg-radius-sm: 10px;
88
+ --lg-radius-md: 14px;
89
+ --lg-radius-lg: 16px;
90
+ --lg-radius-xl: 20px;
91
+ --lg-radius-sheet: 20px;
92
+
93
+ /* Motion: a gentle settle, not a bouncy overshoot. */
94
+ --lg-ease-spring: cubic-bezier(0.32, 1.2, 0.5, 1);
95
+ --lg-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
96
+ --lg-duration: 380ms;
97
+ --lg-duration-fast: 180ms;
98
+
99
+ /* Overlays */
100
+ --lg-scrim: rgba(0, 0, 0, 0.4);
101
+ --lg-sheet-fill: rgb(var(--lg-c-paper));
102
+ --lg-sheet-max-height: 85dvh;
103
+ --lg-sheet-max-width: 640px;
104
+ }
105
+
106
+ /* Fallbacks that change tokens. */
107
+ @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
108
+ :root {
109
+ --lg-light-fill: rgba(255, 255, 255, 0.92);
110
+ --lg-light-fill-hover: rgba(255, 255, 255, 0.98);
111
+ --lg-dark-fill: rgba(16, 16, 20, 0.9);
112
+ --lg-dark-fill-hover: rgba(28, 28, 34, 0.94);
113
+ --lg-clear-fill: rgba(16, 16, 20, 0.6);
114
+ --lg-clear-fill-hover: rgba(16, 16, 20, 0.7);
115
+ }
116
+ }
117
+
118
+ @media (prefers-reduced-transparency: reduce) {
119
+ :root {
120
+ --lg-light-fill: rgba(255, 255, 255, 0.97);
121
+ --lg-light-fill-hover: #ffffff;
122
+ --lg-dark-fill: rgba(18, 18, 22, 0.97);
123
+ --lg-dark-fill-hover: #1c1c22;
124
+ --lg-clear-fill: rgba(18, 18, 22, 0.85);
125
+ --lg-clear-fill-hover: rgba(18, 18, 22, 0.92);
126
+ --lg-blur: 0px;
127
+ --lg-blur-thin: 0px;
128
+ --lg-blur-thick: 0px;
129
+ --lg-saturate: 100%;
130
+ }
131
+ }
132
+
133
+ @media (prefers-contrast: more) {
134
+ :root {
135
+ --lg-light-edge: rgba(15, 23, 42, 0.45);
136
+ --lg-dark-edge: rgba(255, 255, 255, 0.55);
137
+ --lg-sheen: none;
138
+ --lg-sheen-dark: none;
139
+ }
140
+ }
141
+ }
142
+
143
+ @layer components {
144
+ /* ── Base material ──────────────────────────────────────────────────── */
145
+ /* Every class in this list is a glass surface; the composites below add to it. */
146
+ :where(.glass, .glass-btn, .glass-menu, .glass-sheet, .glass-chip) {
147
+ --lg-fill: var(--lg-light-fill);
148
+ --lg-fill-hover: var(--lg-light-fill-hover);
149
+ --lg-rim: var(--lg-light-rim);
150
+ --lg-rim-low: var(--lg-light-rim-low);
151
+ --lg-edge: var(--lg-light-edge);
152
+ --lg-shadow: var(--lg-shadow-md);
153
+ --lg-surface-sheen: var(--lg-sheen);
154
+ --lg-surface-blur: var(--lg-blur);
155
+ }
156
+
157
+ .glass,
158
+ .glass-btn,
159
+ .glass-menu,
160
+ .glass-sheet,
161
+ .glass-chip {
162
+ position: relative;
163
+ isolation: isolate;
164
+ color: var(--lg-light-text);
165
+ background-color: var(--lg-fill);
166
+ background-image: var(--lg-surface-sheen);
167
+ border-radius: var(--lg-radius-md);
168
+ box-shadow:
169
+ inset 0 0 0 1px var(--lg-edge),
170
+ var(--lg-shadow);
171
+ -webkit-backdrop-filter: blur(var(--lg-surface-blur)) saturate(var(--lg-saturate));
172
+ backdrop-filter: blur(var(--lg-surface-blur)) saturate(var(--lg-saturate));
173
+ }
174
+
175
+ /* Specular rim: a 1px gradient ring that follows the border radius. Light catches the
176
+ top edge only, then fades. */
177
+ :is(.glass, .glass-btn, .glass-menu, .glass-sheet, .glass-chip)::before {
178
+ content: '';
179
+ position: absolute;
180
+ inset: 0;
181
+ z-index: 1;
182
+ border-radius: inherit;
183
+ padding: 1px;
184
+ pointer-events: none;
185
+ background: linear-gradient(180deg, var(--lg-rim) 0%, var(--lg-rim-low) 40%);
186
+ -webkit-mask:
187
+ linear-gradient(#000 0 0) content-box,
188
+ linear-gradient(#000 0 0);
189
+ -webkit-mask-composite: xor;
190
+ mask:
191
+ linear-gradient(#000 0 0) content-box exclude,
192
+ linear-gradient(#000 0 0);
193
+ }
194
+
195
+ /* ── Interaction ────────────────────────────────────────────────────── */
196
+ .glass-interactive,
197
+ .glass-btn {
198
+ cursor: pointer;
199
+ transition:
200
+ transform var(--lg-duration) var(--lg-ease-spring),
201
+ background-color var(--lg-duration-fast) ease,
202
+ box-shadow var(--lg-duration) var(--lg-ease-out);
203
+ }
204
+
205
+ :is(.glass-interactive, .glass-btn):hover {
206
+ background-color: var(--lg-fill-hover);
207
+ }
208
+
209
+ :is(.glass-interactive, .glass-btn):active {
210
+ transform: scale(0.97);
211
+ transition-duration: var(--lg-duration-fast);
212
+ }
213
+
214
+ :is(.glass-interactive, .glass-btn):focus-visible {
215
+ outline: 2px solid color-mix(in srgb, var(--lg-accent) 70%, white);
216
+ outline-offset: 2px;
217
+ }
218
+
219
+ /* Cards that float up on hover. */
220
+ .glass-lift {
221
+ transition:
222
+ transform var(--lg-duration) var(--lg-ease-spring),
223
+ box-shadow var(--lg-duration) var(--lg-ease-out),
224
+ background-color var(--lg-duration-fast) ease;
225
+ }
226
+
227
+ .glass-lift:hover {
228
+ --lg-shadow: var(--lg-shadow-lg);
229
+ transform: translateY(-4px);
230
+ }
231
+
232
+ /* ── Composite components ───────────────────────────────────────────── */
233
+
234
+ /* Buttons: small radius, interactive, 44px touch target. */
235
+ .glass-btn {
236
+ display: inline-flex;
237
+ align-items: center;
238
+ justify-content: center;
239
+ gap: 0.5rem;
240
+ min-height: 44px;
241
+ padding: 0.625rem 1.25rem;
242
+ border-radius: var(--lg-radius-sm);
243
+ font-size: 0.875rem;
244
+ line-height: 1.25rem;
245
+ font-weight: 600;
246
+ }
247
+
248
+ .glass-btn-sm {
249
+ padding: 0.375rem 0.875rem;
250
+ font-size: 0.75rem;
251
+ line-height: 1rem;
252
+ }
253
+
254
+ .glass-btn-lg {
255
+ padding: 0.875rem 1.75rem;
256
+ font-size: 1rem;
257
+ line-height: 1.5rem;
258
+ }
259
+
260
+ .glass-block {
261
+ width: 100%;
262
+ }
263
+
264
+ .glass-btn:disabled,
265
+ .glass-btn[aria-disabled='true'] {
266
+ cursor: not-allowed;
267
+ opacity: 0.5;
268
+ transform: none;
269
+ }
270
+
271
+ /* Popover / dropdown menus: thick, large radius, dense enough that saturated content
272
+ (badges, red buttons) doesn't read through. */
273
+ .glass-menu {
274
+ --lg-surface-blur: var(--lg-blur-thick);
275
+ --lg-shadow: var(--lg-shadow-lg);
276
+ --lg-fill: rgba(250, 250, 252, 0.86);
277
+ padding: 0.375rem;
278
+ border-radius: var(--lg-radius-lg);
279
+ animation: lg-pop var(--lg-duration) var(--lg-ease-spring) both;
280
+ transform-origin: top right;
281
+ }
282
+
283
+ .glass-menu-item {
284
+ display: flex;
285
+ width: 100%;
286
+ align-items: center;
287
+ gap: 0.75rem;
288
+ padding: 0.625rem 0.875rem;
289
+ border-radius: 0.75rem;
290
+ text-align: left;
291
+ font-size: 0.875rem;
292
+ line-height: 1.25rem;
293
+ font-weight: 500;
294
+ transition:
295
+ background-color var(--lg-duration-fast) ease,
296
+ transform var(--lg-duration-fast) ease;
297
+ }
298
+
299
+ .glass-menu-item:hover,
300
+ .glass-menu-item:focus-visible {
301
+ background-color: rgba(15, 23, 42, 0.06);
302
+ outline: none;
303
+ }
304
+
305
+ .glass-menu-item:active {
306
+ transform: scale(0.985);
307
+ }
308
+
309
+ .glass-menu-separator {
310
+ height: 1px;
311
+ margin: 0.25rem 0.5rem;
312
+ background: linear-gradient(90deg, transparent, rgba(15, 23, 42, 0.1), transparent);
313
+ }
314
+
315
+ /* Modal surface + scrim (for overlays you position yourself; see .glass-dialog for the
316
+ native <dialog> sheet). */
317
+ .glass-scrim {
318
+ background-color: var(--lg-scrim);
319
+ /* Fade the colour, not opacity: an opacity animation would make the scrim a backdrop
320
+ root and stop the sheet inside it from blurring the page. */
321
+ animation: lg-scrim-in var(--lg-duration-fast) ease;
322
+ }
323
+
324
+ .glass-sheet {
325
+ --lg-surface-blur: var(--lg-blur-thick);
326
+ --lg-shadow: var(--lg-shadow-lg);
327
+ --lg-fill: rgba(255, 255, 255, 0.9);
328
+ border-radius: var(--lg-radius-xl);
329
+ animation: lg-sheet-in var(--lg-duration) var(--lg-ease-spring) both;
330
+ }
331
+
332
+ /* Inputs */
333
+ .glass-input {
334
+ width: 100%;
335
+ padding: 0.625rem 1rem;
336
+ border-radius: 0.75rem;
337
+ font-size: 0.875rem;
338
+ line-height: 1.25rem;
339
+ color: #111827;
340
+ background-color: rgba(255, 255, 255, 0.55);
341
+ box-shadow:
342
+ inset 0 1px 2px rgba(15, 23, 42, 0.08),
343
+ inset 0 0 0 1px rgba(15, 23, 42, 0.08);
344
+ -webkit-backdrop-filter: blur(var(--lg-blur-thin));
345
+ backdrop-filter: blur(var(--lg-blur-thin));
346
+ transition:
347
+ background-color var(--lg-duration-fast) ease,
348
+ box-shadow var(--lg-duration-fast) ease;
349
+ }
350
+
351
+ .glass-input::placeholder {
352
+ color: #6b7280;
353
+ }
354
+
355
+ .glass-input:focus {
356
+ outline: none;
357
+ background-color: rgba(255, 255, 255, 0.85);
358
+ box-shadow:
359
+ inset 0 0 0 1.5px color-mix(in srgb, var(--lg-accent) 70%, transparent),
360
+ 0 0 0 4px color-mix(in srgb, var(--lg-accent) 16%, transparent);
361
+ }
362
+
363
+ /* Small chip / badge: thin, pill. */
364
+ .glass-chip {
365
+ --lg-surface-blur: var(--lg-blur-thin);
366
+ --lg-shadow: var(--lg-shadow-sm);
367
+ display: inline-flex;
368
+ align-items: center;
369
+ gap: 0.375rem;
370
+ padding: 0.25rem 0.75rem;
371
+ border-radius: 9999px;
372
+ font-size: 0.75rem;
373
+ line-height: 1rem;
374
+ font-weight: 600;
375
+ }
376
+
377
+ /* ── Tones ──────────────────────────────────────────────────────────── */
378
+ .glass-dark {
379
+ --lg-fill: var(--lg-dark-fill);
380
+ --lg-fill-hover: var(--lg-dark-fill-hover);
381
+ --lg-rim: var(--lg-dark-rim);
382
+ --lg-rim-low: var(--lg-dark-rim-low);
383
+ --lg-edge: var(--lg-dark-edge);
384
+ --lg-shadow: var(--lg-shadow-dark);
385
+ --lg-surface-sheen: var(--lg-sheen-dark);
386
+ color: var(--lg-dark-text);
387
+ }
388
+
389
+ .glass-dark .glass-menu-item:hover,
390
+ .glass-dark .glass-menu-item:focus-visible {
391
+ background-color: rgba(255, 255, 255, 0.1);
392
+ }
393
+
394
+ .glass-dark .glass-menu-separator {
395
+ background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
396
+ }
397
+
398
+ .glass-clear {
399
+ --lg-fill: var(--lg-clear-fill);
400
+ --lg-fill-hover: var(--lg-clear-fill-hover);
401
+ --lg-rim: rgba(255, 255, 255, 0.6);
402
+ --lg-rim-low: rgba(255, 255, 255, 0.12);
403
+ --lg-edge: rgba(255, 255, 255, 0.08);
404
+ --lg-shadow: var(--lg-shadow-sm);
405
+ color: #fff;
406
+ }
407
+
408
+ /* Solid tones for primary actions. */
409
+ .glass-tinted,
410
+ .glass-tinted-secondary,
411
+ .glass-danger {
412
+ --lg-rim: rgba(255, 255, 255, 0.28);
413
+ --lg-rim-low: rgba(255, 255, 255, 0);
414
+ --lg-edge: transparent;
415
+ --lg-shadow: 0 0 #0000;
416
+ --lg-surface-sheen: none;
417
+ color: #fff;
418
+ }
419
+
420
+ .glass-tinted {
421
+ --lg-fill: var(--lg-accent);
422
+ --lg-fill-hover: var(--lg-accent-strong);
423
+ }
424
+
425
+ .glass-tinted-secondary {
426
+ --lg-fill: var(--lg-accent-2);
427
+ --lg-fill-hover: var(--lg-accent-2-strong);
428
+ }
429
+
430
+ .glass-danger {
431
+ --lg-fill: var(--lg-danger);
432
+ --lg-fill-hover: var(--lg-danger-strong);
433
+ }
434
+
435
+ /* ── Thickness ──────────────────────────────────────────────────────── */
436
+ .glass-thin {
437
+ --lg-surface-blur: var(--lg-blur-thin);
438
+ --lg-shadow: var(--lg-shadow-sm);
439
+ }
440
+
441
+ .glass-thick {
442
+ --lg-surface-blur: var(--lg-blur-thick);
443
+ --lg-shadow: var(--lg-shadow-lg);
444
+ }
445
+
446
+ .glass-flat {
447
+ --lg-shadow: 0 0 #0000;
448
+ }
449
+
450
+ /* ── Shape ──────────────────────────────────────────────────────────── */
451
+ .glass-sm {
452
+ border-radius: var(--lg-radius-sm);
453
+ }
454
+
455
+ .glass-lg {
456
+ border-radius: var(--lg-radius-lg);
457
+ }
458
+
459
+ .glass-xl {
460
+ border-radius: var(--lg-radius-xl);
461
+ }
462
+
463
+ .glass-pill {
464
+ border-radius: 9999px;
465
+ }
466
+
467
+ /* Denser fills for floating overlays in dark mode. */
468
+ .glass-menu.glass-dark {
469
+ --lg-fill: rgba(20, 20, 24, 0.9);
470
+ }
471
+
472
+ .glass-sheet.glass-dark {
473
+ --lg-fill: rgba(20, 20, 24, 0.8);
474
+ }
475
+
476
+ /* ── Backgrounds ────────────────────────────────────────────────────── */
477
+ /* Page backgrounds behind glass: flat and neutral. */
478
+ .glass-canvas {
479
+ background-color: rgb(var(--lg-c-canvas));
480
+ }
481
+
482
+ /* Chromium-only refraction: <GlassFilter /> sets data-lg-refract on <html> when the
483
+ browser supports SVG filters inside backdrop-filter. Elsewhere this is a no-op. */
484
+ [data-lg-refract] .glass-refract {
485
+ -webkit-backdrop-filter: url(#lg-refract) blur(var(--lg-surface-blur))
486
+ saturate(var(--lg-saturate));
487
+ backdrop-filter: url(#lg-refract) blur(var(--lg-surface-blur)) saturate(var(--lg-saturate));
488
+ }
489
+
490
+ /* ── Dialog sheet (<GlassSheet />, or a <dialog class="glass-dialog">) ──── */
491
+ /* Centred card from 640px up; a bottom sheet on phones. The header and grabber drag the
492
+ sheet; the body scrolls. */
493
+ dialog.glass-dialog {
494
+ width: 100%;
495
+ max-width: var(--lg-sheet-max-width);
496
+ max-height: 80dvh;
497
+ margin: auto;
498
+ padding: 0;
499
+ border: 0;
500
+ overflow: hidden;
501
+ border-radius: var(--lg-radius-xl);
502
+ color: rgb(var(--lg-c-ink));
503
+ background-color: var(--lg-sheet-fill);
504
+ box-shadow:
505
+ inset 0 0 0 1px rgb(var(--lg-c-line) / 0.1),
506
+ var(--lg-shadow-lg);
507
+ overscroll-behavior: contain;
508
+ }
509
+
510
+ dialog.glass-dialog[open] {
511
+ display: flex;
512
+ flex-direction: column;
513
+ }
514
+
515
+ dialog.glass-dialog:focus {
516
+ outline: none;
517
+ }
518
+
519
+ dialog.glass-dialog::backdrop {
520
+ background-color: var(--lg-scrim);
521
+ overflow: hidden;
522
+ overscroll-behavior: contain;
523
+ }
524
+
525
+ .glass-dialog-grabber {
526
+ display: none;
527
+ }
528
+
529
+ .glass-dialog-header {
530
+ display: flex;
531
+ flex-shrink: 0;
532
+ align-items: flex-start;
533
+ gap: 0.75rem;
534
+ padding: 1rem 1.5rem;
535
+ border-bottom: 1px solid rgb(var(--lg-c-line) / 0.08);
536
+ }
537
+
538
+ .glass-dialog-heading {
539
+ min-width: 0;
540
+ flex: 1 1 auto;
541
+ }
542
+
543
+ .glass-dialog-eyebrow {
544
+ margin: 0;
545
+ font-size: 13px;
546
+ line-height: 1rem;
547
+ color: rgb(var(--lg-c-ink-2));
548
+ }
549
+
550
+ .glass-dialog-title {
551
+ margin: 0.25rem 0 0;
552
+ font-size: 1.25rem;
553
+ line-height: 1.75rem;
554
+ font-weight: 600;
555
+ color: rgb(var(--lg-c-ink));
556
+ }
557
+
558
+ .glass-dialog-close {
559
+ display: flex;
560
+ flex-shrink: 0;
561
+ align-items: center;
562
+ justify-content: center;
563
+ width: 44px;
564
+ height: 44px;
565
+ padding: 0;
566
+ border: 0;
567
+ border-radius: 9999px;
568
+ color: rgb(var(--lg-c-ink-2));
569
+ background-color: rgb(var(--lg-c-line) / 0.05);
570
+ cursor: pointer;
571
+ transition: background-color var(--lg-duration-fast) ease;
572
+ }
573
+
574
+ .glass-dialog-close:hover {
575
+ background-color: rgb(var(--lg-c-line) / 0.1);
576
+ }
577
+
578
+ .glass-dialog-close:focus-visible {
579
+ outline: 2px solid var(--lg-accent);
580
+ outline-offset: 2px;
581
+ }
582
+
583
+ /* flex-auto, not flex-1: Safari resolves a 0% basis to zero in this auto-height column
584
+ dialog and collapses the body (WebKit bug 281973). */
585
+ .glass-dialog-body {
586
+ min-height: 0;
587
+ flex: 1 1 auto;
588
+ overflow-y: auto;
589
+ overscroll-behavior: contain;
590
+ padding: 1.25rem 1.5rem;
591
+ }
592
+
593
+ .glass-dialog-footer {
594
+ flex-shrink: 0;
595
+ padding: 1rem 1.5rem;
596
+ border-top: 1px solid rgb(var(--lg-c-line) / 0.08);
597
+ }
598
+
599
+ @media (max-width: 639.98px) {
600
+ dialog.glass-dialog[open] {
601
+ max-width: none;
602
+ max-height: var(--lg-sheet-max-height);
603
+ margin: auto 0 0;
604
+ border-radius: var(--lg-radius-sheet) var(--lg-radius-sheet) 0 0;
605
+ /* Slides up on open. A keyframe animation, not a transition from @starting-style:
606
+ iOS Safari could leave that transition stuck part way. */
607
+ animation: lg-dialog-up 0.28s var(--lg-ease-out);
608
+ }
609
+
610
+ /* The grabber: a visible hint that the sheet can be pulled down. */
611
+ .glass-dialog-grabber {
612
+ display: block;
613
+ flex-shrink: 0;
614
+ padding: 6px 0 0;
615
+ touch-action: none;
616
+ }
617
+
618
+ .glass-dialog-grabber::after {
619
+ content: '';
620
+ display: block;
621
+ width: 36px;
622
+ height: 5px;
623
+ margin: 0 auto;
624
+ border-radius: 9999px;
625
+ background-color: rgb(var(--lg-c-line) / 0.2);
626
+ }
627
+
628
+ .glass-dialog-header {
629
+ padding-top: 0.5rem;
630
+ }
631
+
632
+ /* Clear the home indicator under the last line. */
633
+ .glass-dialog-body:last-child,
634
+ .glass-dialog-footer {
635
+ padding-bottom: max(env(safe-area-inset-bottom), 20px);
636
+ }
637
+ }
638
+
639
+ /* While a finger drags the sheet, it follows exactly (no easing). */
640
+ dialog.glass-dialog[data-dragging] {
641
+ animation: none;
642
+ transition: none;
643
+ user-select: none;
644
+ }
645
+
646
+ /* ── Keyframes ──────────────────────────────────────────────────────── */
647
+ /* Pop-ins animate transform only: an element with opacity < 1 can't sample its
648
+ backdrop in Chromium, so fading would show unblurred content until it settles. */
649
+ @keyframes lg-pop {
650
+ from {
651
+ transform: scale(0.92) translateY(-6px);
652
+ }
653
+ to {
654
+ transform: scale(1) translateY(0);
655
+ }
656
+ }
657
+
658
+ @keyframes lg-sheet-in {
659
+ from {
660
+ transform: scale(0.94) translateY(12px);
661
+ }
662
+ to {
663
+ transform: scale(1) translateY(0);
664
+ }
665
+ }
666
+
667
+ @keyframes lg-dialog-up {
668
+ from {
669
+ transform: translateY(100%);
670
+ }
671
+ }
672
+
673
+ @keyframes lg-scrim-in {
674
+ from {
675
+ background-color: transparent;
676
+ }
677
+ }
678
+
679
+ /* ── Reduced motion (last, so it wins over everything above) ────────── */
680
+ @media (prefers-reduced-motion: reduce) {
681
+ .glass-btn,
682
+ .glass-interactive,
683
+ .glass-lift,
684
+ .glass-menu,
685
+ .glass-menu-item,
686
+ .glass-sheet,
687
+ .glass-scrim,
688
+ dialog.glass-dialog[open] {
689
+ animation: none;
690
+ transition: none;
691
+ }
692
+
693
+ :is(.glass-interactive, .glass-btn):active,
694
+ .glass-menu-item:active,
695
+ .glass-lift:hover {
696
+ transform: none;
697
+ }
698
+ }
699
+ }