Repository navigation
Expand file tree
/
Copy pathlayout.css
More file actions
705 lines (591 loc) · 18.2 KB
/
Copy pathlayout.css
File metadata and controls
705 lines (591 loc) · 18.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
/* ====================================================================
LAYOUT.CSS — Page Shell, Grid, Content Area, Responsive
Liquid Galaxy Docs · References tokens from tokens.css
==================================================================== */
/* ─────────────────────────────────────────────────────────────────────
PAGE SHELL
───────────────────────────────────────────────────────────────────── */
body {
min-height: 100dvh;
height: 100dvh;
display: flex;
flex-direction: column;
overflow: hidden;
}
/* Wrapper that holds sidebar + content horizontally */
.layout-body {
display: flex;
flex: 1;
overflow: hidden;
position: relative;
}
/* ─────────────────────────────────────────────────────────────────────
DRAWER — DESKTOP COLLAPSED STATE
───────────────────────────────────────────────────────────────────── */
.drawer.collapsed {
width: 0;
overflow: hidden;
}
/* ─────────────────────────────────────────────────────────────────────
MAIN CONTENT AREA
───────────────────────────────────────────────────────────────────── */
.content-area {
flex: 1;
overflow-y: auto;
overflow-x: hidden;
background: var(--md-sys-color-background);
scroll-behavior: smooth;
}
/* Inner content wrapper: article + optional TOC gutter */
.content-wrapper {
display: flex;
gap: 0;
align-items: flex-start;
min-height: 100%;
flex: 1;
}
/* Article column */
.markdown-body {
flex: 1;
min-width: 0;
max-width: var(--content-max);
margin: 0 auto;
padding: var(--space-16) var(--space-12) var(--space-32); /* Generous top/bottom breathing space */
}
/* TOC column — right gutter, only shown on wide screens */
.toc-sidebar {
display: none; /* shown via media query below */
padding-top: calc(var(--topbar-h) + var(--space-8));
padding-right: var(--space-6);
}
/* ─────────────────────────────────────────────────────────────────────
HOMEPAGE SPECIAL LAYOUT
When the content area holds a home page (.home-hero is present),
we remove reading-width constraints and allow full bleed sections.
───────────────────────────────────────────────────────────────────── */
.zoomable-image-wrapper {
display: inline-block;
position: relative;
cursor: zoom-in;
margin: var(--space-5) 0;
}
.zoomable-image-wrapper img {
max-width: 100%;
max-height: 250px;
object-fit: contain;
display: block;
/* border-radius: var(--md-sys-shape-corner-medium); */
transition: transform 0.2s;
}
.zoomable-image-wrapper:hover img {
transform: scale(1.02);
}
.zoomable-image-wrapper .zoom-icon {
position: absolute;
bottom: 20px;
right: 2px;
background: var(--md-sys-color-inverse-surface);
color: var(--md-sys-color-inverse-on-surface);
border-radius: 50%;
padding: 6px;
font-size: 24px;
opacity: 0;
transition: opacity 0.2s;
pointer-events: none;
}
.zoomable-image-wrapper:hover .zoom-icon {
opacity: 1;
}
/* Laid out at all times so it can animate out as well as in */
.lightbox {
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
background: color-mix(in srgb, var(--md-sys-color-scrim) 85%, transparent);
z-index: 10000;
display: flex;
opacity: 0;
visibility: hidden;
pointer-events: none;
align-items: center;
justify-content: center;
backdrop-filter: blur(5px);
cursor: zoom-out;
transition:
opacity var(--md-sys-motion-duration-short-3) var(--md-sys-motion-easing-emphasized-accel),
visibility 0s linear var(--md-sys-motion-duration-short-3);
}
.lightbox.active {
opacity: 1;
visibility: visible;
pointer-events: auto;
transition:
opacity var(--md-sys-motion-duration-medium-1) var(--md-sys-motion-easing-emphasized-decel),
visibility 0s linear 0s;
}
.lightbox img {
width: 80vw;
height: 80vh;
object-fit: contain;
/* border-radius: var(--md-sys-shape-corner-large); */
box-shadow: 0 10px 40px rgba(0,0,0,0.5);
cursor: default;
/* transform-origin is set in markdown-setup.js */
transform: scale(0.94);
transition: transform var(--md-sys-motion-duration-short-3)
var(--md-sys-motion-easing-emphasized-accel);
will-change: transform;
}
.lightbox.active img {
transform: scale(1);
transition: transform var(--md-sys-motion-duration-medium-1)
var(--md-sys-motion-easing-emphasized-decel);
}
@media (prefers-reduced-motion: reduce) {
.lightbox img,
.lightbox.active img {
transform: none;
transition: none;
}
}
.markdown-body pre code {
background: transparent;
padding: 0;
border-radius: 0;
font-size: inherit;
/* Not `inherit`: blocks are always dark, the page text colour is not */
color: #e2e2e2;
}
/* Code Block Copy Button */
.code-block-wrapper {
position: relative;
margin-bottom: var(--space-4);
}
/* data-lang is set by attachCopyButtons */
.code-block-wrapper[data-lang]::before {
content: attr(data-lang);
position: absolute;
top: 7px;
left: 14px;
font-family: var(--md-sys-typescale-font-family-mono);
font-size: 10px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.08em;
color: rgba(255, 255, 255, 0.4);
pointer-events: none;
}
.code-block-wrapper pre {
margin-bottom: 0;
}
.copy-code-btn {
position: absolute;
top: 8px;
right: 8px;
background: var(--md-sys-color-surface-container-highest);
color: var(--md-sys-color-on-surface-variant);
border: none;
border-radius: 4px;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
opacity: 0;
transition: opacity 0.2s, background 0.2s, color 0.2s,
transform var(--md-sys-motion-duration-short-2) var(--md-sys-motion-easing-standard);
}
.copy-code-btn:active {
transform: scale(0.92);
transition-duration: 80ms;
}
/* The icon element is replaced on copy, so this runs on each insert */
.copy-code-btn .material-icons {
animation: copyIconPop var(--md-sys-motion-duration-short-2)
var(--md-sys-motion-easing-emphasized-decel);
}
@keyframes copyIconPop {
from { opacity: 0; transform: scale(0.7); }
to { opacity: 1; transform: scale(1); }
}
/* Reveal-on-hover is pointer-only; on touch the button must always be visible */
@media (hover: hover) and (pointer: fine) {
.code-block-wrapper:hover .copy-code-btn {
opacity: 1;
}
}
@media (hover: none), (pointer: coarse) {
.copy-code-btn {
opacity: 1;
width: 40px;
height: 40px;
}
}
.copy-code-btn:focus-visible {
opacity: 1;
outline: 2px solid var(--md-sys-color-primary);
outline-offset: 2px;
}
.copy-code-btn:hover {
background: var(--md-sys-color-primary);
color: var(--md-sys-color-on-primary);
}
.copy-code-btn.copied {
background: var(--lg-accent-green);
color: white;
opacity: 1;
}
.copy-code-btn .material-icons {
font-size: 18px;
}
/* One gutter token drives every section below the hero; override --home-gutter only */
.markdown-body:has(.home-hero) {
--home-gutter: var(--space-6);
--home-col: 1100px;
max-width: none;
margin: 0;
padding: 0;
}
/* :has() (0,2,0) outranks the breakpoint padding below (0,1,0) */
.content-wrapper:has(.home-hero) {
max-width: none;
padding: 0;
}
/* Article pages clear the fixed bar; the hero runs beneath it deliberately */
.markdown-body:not(:has(.home-hero)) {
padding-top: calc(var(--topbar-h) + var(--space-8));
}
/* Content box is (col - 2*gutter): the shared alignment line */
.home-hero ~ * {
max-width: var(--home-col);
margin-left: auto;
margin-right: auto;
padding-left: var(--home-gutter);
padding-right: var(--home-gutter);
}
/* These own a background/border, so their border box must match that line */
.home-hero ~ .home-cta-section,
.home-hero ~ .home-footer {
max-width: min(
calc(var(--home-col) - 2 * var(--home-gutter)),
calc(100% - 2 * var(--home-gutter))
);
}
.home-hero ~ .home-footer {
padding-left: 0;
padding-right: 0;
}
/* The hero itself is full-width */
.home-hero {
width: 100%;
}
/* Info cards grid layout — bottom spacing from doc-grid-section below */
.home-cards {
padding-bottom: 0;
}
/* ─────────────────────────────────────────────────────────────────────
FOOTER
───────────────────────────────────────────────────────────────────── */
.site-footer {
flex-shrink: 0;
background: var(--md-sys-color-surface-container);
/* Faint hairline — softer than a solid line, consistent with outline-variant philosophy */
border-top: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 60%, transparent);
padding: var(--space-4) var(--space-8);
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-4);
flex-wrap: wrap;
}
.site-footer p {
margin: 0;
font-size: var(--md-sys-typescale-body-small-size);
color: var(--md-sys-color-on-surface-variant);
letter-spacing: var(--md-sys-typescale-body-small-tracking);
}
.site-footer a {
color: var(--md-sys-color-primary);
font-size: var(--md-sys-typescale-body-small-size);
font-weight: 500;
}
/* ─────────────────────────────────────────────────────────────────────
RESPONSIVE BREAKPOINTS
Mobile-first — add features as viewport grows.
───────────────────────────────────────────────────────────────────── */
/* ── LARGE DESKTOP: Show TOC right gutter (≥ 1280px) ── */
@media (min-width: 1280px) {
.content-wrapper {
/* Article max-width + TOC gutter + gap */
max-width: calc(var(--content-max) + var(--toc-w) + var(--space-8));
margin: 0 auto;
gap: var(--space-8);
padding: 0 var(--space-8);
}
.markdown-body {
margin: 0;
padding: var(--space-10) 0 var(--space-24);
}
/* Reveal TOC sidebar */
.toc-sidebar {
display: block;
}
/* (Homepage full-bleed rule is global — see HOMEPAGE SPECIAL LAYOUT above) */
/* When drawer is collapsed or TOC is hidden, keep markdown-body centered */
.drawer.collapsed ~ .content-area .markdown-body,
.content-wrapper:has(#toc-sidebar[style*="display: none"]) .markdown-body {
margin: 0 auto;
}
}
/* ── MEDIUM DESKTOP: Content with comfortable padding (≥ 960px) ── */
@media (min-width: 960px) and (max-width: 1279px) {
.content-wrapper {
padding: 0 var(--space-8);
}
.markdown-body {
padding: var(--space-10) 0 var(--space-24);
}
}
/* ── TABLET: Sidebar becomes overlay drawer (< 960px) ── */
@media (max-width: 959px) {
.drawer {
position: fixed;
left: 0;
top: var(--topbar-h);
height: calc(100dvh - var(--topbar-h));
z-index: 180;
box-shadow: var(--md-sys-elevation-shadow-5);
/* Overlay drawer = real material here: content actually sits behind it
(on desktop it's a side-by-side panel, so it stays a tonal surface) */
background: color-mix(in srgb, var(--md-sys-color-surface-container-low) 82%, transparent);
backdrop-filter: blur(20px) saturate(160%);
-webkit-backdrop-filter: blur(20px) saturate(160%);
/* Hidden by default on mobile */
transform: translateX(-100%);
/* Override collapsed so width stays for the animation */
width: var(--sidebar-w) !important;
}
@media (prefers-reduced-transparency: reduce) {
.drawer {
background: var(--md-sys-color-surface-container-low);
backdrop-filter: none;
-webkit-backdrop-filter: none;
}
}
/* When drawer is open on mobile (NOT collapsed) */
.drawer:not(.collapsed) {
transform: translateX(0);
}
/* Collapsed = off-screen */
.drawer.collapsed {
transform: translateX(-100%);
overflow: hidden;
}
.content-wrapper {
padding: 0 var(--space-4);
}
.markdown-body {
padding: var(--space-6) 0 var(--space-16);
}
}
/* ── MOBILE: Reduce padding further (< 600px) ── */
@media (max-width: 599px) {
.app-bar {
padding: 0 var(--space-2);
gap: var(--space-1);
}
.brand h1 {
/* Shorten on very small screens */
font-size: 15px;
}
.search-container {
display: none; /* hidden on mobile per existing behavior */
}
.content-wrapper {
padding: 0 var(--space-4);
}
.markdown-body {
padding: var(--space-5) 0 var(--space-12);
}
.markdown-body h1 {
font-size: var(--md-sys-typescale-headline-large-size);
line-height: var(--md-sys-typescale-headline-large-line-height);
}
.home-hero {
/* Keep bottom padding: the 3px 4-color stripe ::after sits at the very edge.
Top clears the fixed glass bar. */
padding: calc(var(--topbar-h) + var(--space-4)) var(--space-4) var(--space-8);
}
.markdown-body:has(.home-hero) {
--home-gutter: var(--space-4);
}
.home-hero {
min-height: auto;
}
.home-hero h1 {
font-size: clamp(2.1rem, 8.5vw, 2.75rem);
}
.home-hero p {
font-size: 1rem;
}
.browse-header {
flex-direction: column;
align-items: stretch;
}
.browse-toggle {
width: 100%;
justify-content: center;
min-height: 48px;
}
.home-footer {
flex-direction: column;
align-items: flex-start;
gap: var(--space-4);
}
.home-cta-section {
padding: var(--space-6) var(--space-4);
}
.home-section {
padding-top: var(--space-6);
padding-bottom: var(--space-6);
}
.home-cards {
grid-template-columns: 1fr;
}
.site-footer {
padding: var(--space-3) var(--space-4);
justify-content: center;
text-align: center;
}
/* ── DOCUMENTATION PAGES ON MOBILE ────────────────────────────────── */
.markdown-body pre {
padding: var(--space-4) var(--space-3);
border-radius: 8px;
margin-left: calc(-1 * var(--space-2));
margin-right: calc(-1 * var(--space-2));
}
.markdown-body pre code {
font-size: 0.8125rem;
line-height: 1.6;
}
.code-block-wrapper[data-lang]::before {
top: 5px;
left: 10px;
}
.doc-navigation {
flex-direction: column;
}
.markdown-body table {
display: block;
width: 100%;
overflow-x: auto;
white-space: nowrap;
}
.markdown-body p,
.markdown-body li,
.markdown-body a,
.markdown-body code {
overflow-wrap: anywhere;
}
.dynamic-title {
font-size: clamp(1.75rem, 7.5vw, 2.25rem);
}
}
/* ── TOC as a collapsible panel below 1280px (no gutter to live in) ── */
@media (max-width: 1279px) {
/* On the wrapper so it holds whether or not a TOC was built */
.content-wrapper {
flex-direction: column;
/* In a column, flex-start would size children to content and let
.markdown-body's max-width win, overflowing narrow viewports. */
align-items: stretch;
padding-top: calc(var(--topbar-h) + var(--space-4));
}
.markdown-body:not(:has(.home-hero)) {
padding-top: 0;
}
.markdown-body {
max-width: 100%;
}
.toc-sidebar {
display: block;
order: -1;
width: 100%;
padding: 0;
margin-bottom: var(--space-5);
position: static;
}
#toc-nav {
border: 1px solid var(--md-sys-color-outline-variant);
border-radius: 12px;
background: var(--md-sys-color-surface-container-low);
overflow: hidden;
}
.toc-heading {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-2);
min-height: 48px;
margin: 0;
padding: 0 var(--space-4);
cursor: pointer;
color: var(--md-sys-color-on-surface);
}
.toc-heading .material-icons {
display: block;
font-size: 20px;
color: var(--md-sys-color-on-surface-variant);
transition: transform var(--md-sys-motion-duration-medium-2)
var(--md-sys-motion-easing-emphasized);
}
#toc-nav.open .toc-heading .material-icons {
transform: rotate(180deg);
}
.toc-heading:active {
background: var(--md-sys-color-surface-container-high);
}
/* The row collapses a single child, so the <ul> is wrapped: collapsing the
<li>s directly would give each its own row and never reach zero height. */
.toc-list-wrap {
display: grid;
grid-template-rows: 0fr;
transition: grid-template-rows var(--md-sys-motion-duration-medium-3)
var(--md-sys-motion-easing-emphasized);
}
#toc-nav.open .toc-list-wrap {
grid-template-rows: 1fr;
}
.toc-list {
min-height: 0;
overflow: hidden;
}
.toc-link {
min-height: 40px;
display: flex;
align-items: center;
padding-left: var(--space-4);
padding-right: var(--space-4);
}
@media (prefers-reduced-motion: reduce) {
.toc-list,
.toc-heading .material-icons {
transition: none;
}
}
}
/* ── VERY SMALL: Contribute button label shortens (< 400px) ── */
@media (max-width: 399px) {
.brand {
min-width: 0;
}
.brand h1 {
display: none;
}
}
/* < 360px, not < 400px: 375 and 390 are common phone widths and keep the full gutter */
@media (max-width: 359px) {
.markdown-body:has(.home-hero) {
--home-gutter: var(--space-3);
}
}