Repository navigation
Expand file tree
/
Copy pathsite.css
More file actions
825 lines (774 loc) · 30.2 KB
/
Copy pathsite.css
File metadata and controls
825 lines (774 loc) · 30.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
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
/* Paper & Ink palette, shared with the viewer's default theme. */
:root {
color-scheme: light dark;
--bg: #f9f7f4;
--surface: #f2efea;
--raised: #ffffff;
--border: #d8d3cc;
--text: #1c1c1c;
--muted: #5f5b55;
--accent: #2f6db0;
--focus: #2f6db0;
--control: #8a847b;
--tint: rgb(74 144 217 / 14%);
--live: #2e6b45;
--load: #8a5a00;
--t-comment: #6b655d;
--t-tag: #9c3d2e;
--t-attr: #8a5a00;
--t-string: #2e6b45;
--t-keyword: #7f3f86;
--t-function: #2f6db0;
--t-number: #a1452a;
--font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
--radius: 6px;
--preview-width: clamp(360px, 42vw, 760px);
/* The pages of one wide column, the org home and the H5P build page. Their prose keeps --measure. */
--page-width: 72rem;
--measure: 60ch;
}
@media (prefers-color-scheme: dark) {
:root:not(:has(meta[name="color-scheme"][content="light"])) {
--bg: #1b1a18;
--surface: #242220;
--raised: #26231f;
--border: #3a3630;
--text: #f2eee8;
--muted: #a8a197;
--accent: #7db0e4;
--focus: #7db0e4;
--control: #7d766b;
--tint: rgb(125 176 228 / 18%);
--live: #8fcf9f;
--load: #e0b46a;
--t-comment: #a39c91;
--t-tag: #e8917f;
--t-attr: #e0b46a;
--t-string: #9fd19a;
--t-keyword: #d6a0dc;
--t-function: #7db0e4;
--t-number: #e8a07f;
}
}
:root:has(meta[name="color-scheme"][content="dark"]) {
color-scheme: dark;
--bg: #1b1a18;
--surface: #242220;
--raised: #26231f;
--border: #3a3630;
--text: #f2eee8;
--muted: #a8a197;
--accent: #7db0e4;
--focus: #7db0e4;
--control: #7d766b;
--tint: rgb(125 176 228 / 18%);
--live: #8fcf9f;
--load: #e0b46a;
--t-comment: #a39c91;
--t-tag: #e8917f;
--t-attr: #e0b46a;
--t-string: #9fd19a;
--t-keyword: #d6a0dc;
--t-function: #7db0e4;
--t-number: #e8a07f;
}
:root:has(meta[name="color-scheme"][content="light"]) {
color-scheme: light;
}
/* Base */
*, *::before, *::after { box-sizing: border-box; }
body {
margin: 0;
background: var(--bg);
color: var(--text);
font: 16px/1.6 var(--font);
-webkit-text-size-adjust: 100%;
}
a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; text-wrap: balance; }
h2 { margin: 3rem 0 1rem; padding-top: 1.5rem; border-top: 1px solid var(--border); font-size: 1.5rem; }
h3 { margin: 2rem 0 0.5rem; font-size: 1.125rem; }
h2, h3 { scroll-margin-top: 1rem; }
p, ul, ol { margin: 0 0 1rem; }
li + li { margin-top: 0.25rem; }
code { font-family: var(--mono); font-size: 0.875em; }
:not(pre) > code {
padding: 0.1em 0.35em;
border-radius: 4px;
background: var(--surface);
overflow-wrap: anywhere;
}
blockquote {
margin: 1.25rem 0;
padding: 0.75rem 1rem;
border-left: 3px solid var(--focus);
border-radius: 0 var(--radius) var(--radius) 0;
background: var(--tint);
}
blockquote > :last-child { margin-bottom: 0; }
.skip-link {
position: absolute;
left: 1rem;
top: -3rem;
z-index: 100;
padding: 0.5rem 1rem;
background: var(--raised);
border: 1px solid var(--border);
border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }
.muted { color: var(--muted); }
.visually-hidden {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
.button {
display: inline-flex;
align-items: center;
gap: 0.35em;
padding: 0.3rem 0.7rem;
border: 1px solid var(--border);
border-radius: var(--radius);
background: var(--raised);
color: var(--text);
font: inherit;
font-size: 0.8125rem;
line-height: 1.4;
cursor: pointer;
}
.button:hover { background: var(--tint); }
.button-primary { border-color: var(--focus); color: var(--accent); font-weight: 600; }
/* Code blocks */
.code {
margin: 1rem 0 1.25rem;
border: 1px solid var(--border);
border-radius: var(--radius);
background: var(--surface);
overflow: hidden;
}
/* The preview pane's bar shares these, so it matches the Current markup bar below it. */
.code-bar, .preview-bar {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.3rem 0.4rem 0.3rem 0.85rem;
border-bottom: 1px solid var(--border);
font-size: 0.75rem;
color: var(--muted);
}
.code-lang { margin-right: auto; text-transform: uppercase; letter-spacing: 0.04em; }
.code-bar .button, .preview-bar .button { font-size: 0.75rem; padding: 0.2rem 0.55rem; }
pre[class*="language-"] {
margin: 0;
padding: 0.85rem 1rem;
overflow: auto;
background: var(--surface);
font: 0.8125rem/1.6 var(--mono);
tab-size: 2;
}
pre[class*="language-"]:focus-visible { outline-offset: -2px; }
/* Before the script wraps it, a code block still needs a frame. */
pre[class*="language-"]:not(.code > pre) { margin: 1rem 0 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); }
.token.comment, .token.prolog, .token.doctype { color: var(--t-comment); font-style: italic; }
.token.tag, .token.selector, .token.deleted { color: var(--t-tag); }
.token.attr-name, .token.property, .token.class-name { color: var(--t-attr); }
.token.string, .token.attr-value, .token.inserted { color: var(--t-string); }
.token.keyword, .token.atrule, .token.important { color: var(--t-keyword); }
.token.function, .token.builtin { color: var(--t-function); }
.token.number, .token.boolean, .token.constant { color: var(--t-number); }
.token.punctuation, .token.operator { color: var(--muted); }
/* Tables */
.table-wrap {
margin: 1rem 0 1.5rem;
overflow-x: auto;
container-type: inline-size;
}
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
thead th { font-size: 0.75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
tbody th { font-weight: normal; white-space: nowrap; }
tbody th a { color: inherit; text-decoration: none; }
tbody th a:hover code { text-decoration: underline; }
.attributes td.default { max-width: 14rem; overflow-wrap: anywhere; }
.attributes tr:target { background: var(--tint); }
.update { white-space: nowrap; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.update-live { color: var(--live); }
.update-load { color: var(--load); }
@container (width < 560px) {
.attributes, .attributes tbody, .attributes tr, .attributes th, .attributes td { display: block; }
.attributes thead { display: none; }
.attributes tr { padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.attributes th, .attributes td { padding: 0.1rem 0; border: 0; max-width: none; }
.attributes td.default::before { content: "Default: "; color: var(--muted); }
.attributes td:last-child::before { content: "Updates: "; color: var(--muted); font-weight: normal; }
}
/* Playground */
.playground {
display: grid;
grid-template-columns: max-content minmax(0, 1fr);
gap: 0.5rem 1rem;
align-items: center;
margin: 1rem 0 1.5rem;
padding: 1rem;
border: 1px solid var(--border);
border-radius: var(--radius);
background: var(--surface);
}
.playground .control { display: contents; }
.playground label { font-size: 0.875rem; }
.playground select, .playground input:not([type="checkbox"]) {
width: 100%;
max-width: 20rem;
padding: 0.3rem 0.5rem;
border: 1px solid var(--control);
border-radius: var(--radius);
background: var(--raised);
color: var(--text);
font: inherit;
font-size: 0.875rem;
}
.playground select:hover, .playground input:not([type="checkbox"]):hover { border-color: var(--text); }
/* Customizable select for mouse and trackpad. Touch keeps the native picker; other browsers keep the styled native select. */
@media (pointer: fine) {
@supports (appearance: base-select) {
.playground select,
.playground select::picker(select) { appearance: base-select; }
.playground select {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.5rem;
cursor: pointer;
transition: border-color 0.15s;
}
.playground select:open { border-color: var(--focus); }
.playground select::picker-icon {
content: "";
width: 0.75rem;
height: 0.75rem;
background: var(--muted);
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
transition: rotate 0.2s ease-out;
}
.playground select:open::picker-icon { rotate: 180deg; }
.playground select::picker(select) {
margin-block: 0.25rem;
padding: 0.25rem;
border: 1px solid var(--border);
border-radius: var(--radius);
background: var(--raised);
color: var(--text);
box-shadow: 0 8px 24px rgb(0 0 0 / 16%);
opacity: 0;
translate: 0 -0.25rem;
transition:
display 0.15s allow-discrete,
overlay 0.15s allow-discrete,
opacity 0.15s ease-out,
translate 0.15s ease-out;
}
.playground select:open::picker(select) { opacity: 1; translate: 0 0; }
@starting-style {
.playground select:open::picker(select) { opacity: 0; translate: 0 -0.25rem; }
}
.playground option {
gap: 0.5rem;
padding: 0.35rem 0.6rem 0.35rem 0.4rem;
border-radius: 4px;
font-size: 0.875rem;
cursor: pointer;
}
.playground option:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.playground option:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
/* Checked: checkmark, weight and background, so the state isn't carried by color alone. */
.playground option:checked { font-weight: 600; background: var(--tint); }
.playground option::checkmark { color: var(--focus); }
}
}
.playground input[type="checkbox"] { justify-self: start; width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--focus); }
.playground-hint { grid-column: 1 / -1; margin: 0 0 0.25rem; font-size: 0.8125rem; color: var(--muted); }
/* Docs layout: table of contents | content | preview */
.docs {
display: grid;
grid-template-columns: minmax(0, 1fr) var(--preview-width);
}
.toc {
display: none;
position: sticky;
top: 0;
height: 100dvh;
overflow-y: auto;
padding: 1.5rem 1rem 2rem 1.5rem;
border-right: 1px solid var(--border);
font-size: 0.875rem;
scroll-target-group: auto;
}
.brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--text); font-weight: 600; text-decoration: none; }
.brand img { width: 1.5rem; height: 1.5rem; }
.brand:hover { text-decoration: underline; }
.toc-home { margin-bottom: 1.25rem; }
.docs-brand { margin-bottom: 1.25rem; font-size: 0.9375rem; }
.toc ol, .toc-inline ol { margin: 0; padding: 0; list-style: none; }
.toc li + li, .toc-inline li + li { margin-top: 0; }
.toc ol a, .toc-inline a {
display: block;
padding: 0.2rem 0.5rem;
border-left: 2px solid transparent;
color: var(--muted);
text-decoration: none;
}
.toc ol a:hover { color: var(--text); }
.toc ol a:is(:target-current, .\:target-current) { border-left-color: var(--focus); color: var(--text); font-weight: 600; }
:is(.toc, .toc-inline) .toc-l3 a { padding-left: 1.25rem; font-size: 0.8125rem; }
.content {
min-width: 0;
width: 100%;
max-width: 48rem;
margin-inline: auto;
padding: 2rem clamp(1rem, 4vw, 3rem) 4rem;
}
.docs-header { margin-bottom: 2rem; }
.docs-header h1 { margin: 0; font-size: 2.25rem; letter-spacing: -0.01em; }
.docs-header-row { display: flex; align-items: center; gap: 1rem; justify-content: space-between; }
.lead { margin: 0.5rem 0 0.75rem; font-size: 1.125rem; color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0 0 1rem; padding: 0; list-style: none; font-size: 0.875rem; color: var(--muted); }
.meta li + li { margin-top: 0; }
.toc-inline { margin: 1rem 0 0; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.875rem; }
.toc-inline summary { padding: 0.5rem 0.75rem; cursor: pointer; font-weight: 600; }
.toc-inline ol { padding: 0 0.5rem 0.5rem; }
.docs-footer { margin-top: 4rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.875rem; color: var(--muted); }
/* Theme switch: the knob sits on the sun when light and on the moon when dark. */
.theme-switch {
--track-pad: 0.1875rem;
--knob: 1.5rem;
position: relative;
flex: none;
grid-template-columns: 1fr 1fr;
align-items: center;
justify-items: center;
width: 3.5rem;
height: 1.875rem;
padding: 0 var(--track-pad);
border: 1px solid var(--control);
border-radius: 999px;
background: var(--surface);
color: var(--muted);
cursor: pointer;
}
.theme-switch:not([hidden]) { display: inline-grid; }
.theme-switch input {
position: absolute;
inset: 0;
z-index: 2;
width: 100%;
height: 100%;
margin: 0;
appearance: none;
border-radius: inherit;
cursor: pointer;
}
.theme-switch:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.theme-switch input:focus-visible { outline: none; }
.theme-switch-knob {
position: absolute;
top: 50%;
left: var(--track-pad);
width: var(--knob);
height: var(--knob);
border-radius: 50%;
background: var(--text);
box-shadow: 0 1px 2px rgb(0 0 0 / 25%);
transform: translateY(-50%);
transition: transform 0.15s ease-out;
}
.theme-switch input:checked ~ .theme-switch-knob {
transform: translate(calc(3.5rem - 2px - 2 * var(--track-pad) - var(--knob)), -50%);
}
.theme-switch svg {
position: relative;
z-index: 1;
width: 0.95rem;
height: 0.95rem;
fill: none;
stroke: currentColor;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
}
.theme-switch input:not(:checked) ~ .theme-switch-sun,
.theme-switch input:checked ~ .theme-switch-moon { color: var(--bg); }
/* Preview pane */
.preview {
position: sticky;
top: 0;
height: 100dvh;
display: flex;
flex-direction: column;
border-left: 1px solid var(--border);
background: var(--surface);
}
.preview-title { margin-right: auto; font-weight: 600; }
.preview-close { display: none; }
.preview-stage { position: relative; flex: 1; min-height: 0; }
.preview-stage pdfjs-viewer-element { height: 100%; }
.preview-note { padding: 1rem; color: var(--muted); }
.preview .code { margin: 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; }
.preview .code-lang { text-transform: none; letter-spacing: 0; font-weight: 600; }
/* Decorative label icons, masked so they take a color like text does. */
.preview-title, .preview .code-lang { display: inline-flex; align-items: center; gap: 0.4rem; }
.preview-title::before, .preview .code-lang::before {
content: "";
flex: none;
width: 1rem;
height: 1rem;
background: var(--focus);
mask: var(--icon) center / contain no-repeat;
}
.preview-title {
--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}
.preview .code-lang {
--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m16 18 6-6-6-6M8 6l-6 6 6 6'/%3E%3C/svg%3E");
}
/* Grows with the markup, so a typical setup shows in full; past a third of the screen it scrolls,
leaving the viewer most of the pane. */
.preview pre.preview-markup { max-height: 35dvh; padding: 0.5rem 0.75rem; background: var(--bg); font-size: 0.75rem; }
.preview-markup code { white-space: pre-wrap; overflow-wrap: anywhere; }
.flash { animation: flash 0.6s ease-out; }
@keyframes flash { from { box-shadow: inset 0 0 0 3px var(--focus); } to { box-shadow: inset 0 0 0 3px transparent; } }
@media (min-width: 1280px) {
.docs { grid-template-columns: 15rem minmax(0, 1fr) var(--preview-width); }
.toc { display: block; }
.toc-inline, .docs-brand { display: none; }
}
/* Below 1000px the preview becomes a full-screen panel opened from a floating button. */
@media (max-width: 999px) {
.docs { grid-template-columns: minmax(0, 1fr); }
.preview {
position: fixed;
inset: 0;
z-index: 50;
height: auto;
border: 0;
visibility: hidden;
transform: translateY(100%);
transition: transform 0.2s ease-out, visibility 0s linear 0.2s;
}
.preview[data-open] { visibility: visible; transform: none; transition: transform 0.2s ease-out; }
.preview-close { display: inline-flex; }
.preview-open {
position: fixed;
right: 1rem;
bottom: 1rem;
z-index: 40;
padding: 0.6rem 1rem;
border-color: var(--focus);
color: var(--accent);
font-size: 0.875rem;
font-weight: 600;
box-shadow: 0 2px 10px rgb(0 0 0 / 18%);
}
.preview-open:not([hidden]) { display: inline-flex; }
html:has(.preview[data-open]) { overflow: hidden; }
}
@media (min-width: 1000px) {
.preview-open { display: none; }
}
/* Forced colors paint transparent borders, so give the TOC marker system colors. */
@media (forced-colors: active) {
/* Masked icons paint with their background, which forced colors would turn into Canvas. */
.preview-title::before, .preview .code-lang::before, .playground select::picker-icon { forced-color-adjust: none; background: CanvasText; }
.theme-switch-knob { border: 1px solid CanvasText; }
.toc ol a { border-left-color: Canvas; }
.toc ol a:is(:target-current, .\:target-current) { border-left-color: Highlight; }
}
@media (prefers-reduced-motion: reduce) {
.preview, .preview[data-open], .theme-switch-knob { transition: none; }
.playground select, .playground select::picker(select), .playground select::picker-icon { transition: none; }
.flash { animation: none; }
}
/* Org home */
.home { max-width: var(--page-width); margin: 0 auto; padding: 4rem clamp(1rem, 4vw, 3rem); }
.home h1 { margin: 0 0 0.5rem; font-size: 2rem; }
.brand-title { display: flex; align-items: center; gap: 0.75rem; }
.brand-title img { width: 3rem; height: 3rem; }
.home .lead { max-width: var(--measure); margin-bottom: 2rem; }
/* A group of cards under its title, the size of a docs page's section title, without its rule. */
.home section + section { margin-top: 3rem; }
.home section > h2 { margin: 0 0 0.75rem; padding: 0; border: 0; font-size: 1.5rem; }
.home section > p { max-width: var(--measure); margin: 0 0 1.25rem; color: var(--muted); }
/* The cards two to a row where two fit, each as tall as its row, with its links at its foot. Every
section has the same two columns, so a section of one card keeps it the width of the others. */
.home section { container-type: inline-size; }
.elements {
display: grid;
grid-template-columns: minmax(0, 1fr);
gap: 1rem;
margin: 0;
padding: 0;
list-style: none;
}
@container (width > 36rem) {
.elements { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.elements li { display: flex; flex-direction: column; margin: 0; padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.elements h3 { margin: 0 0 0.25rem; font-size: 1.125rem; }
.elements p { margin: 0 0 0.5rem; color: var(--muted); }
.elements .links { display: flex; gap: 1rem; margin-top: auto; font-size: 0.875rem; }
/* The home page's footer: where else the elements are, in columns of links. */
.site-footer { margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--border); font-size: 0.875rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.5rem 4rem; }
.footer-links h2 { margin: 0 0 0.5rem; padding: 0; border: 0; font-size: 0.875rem; }
.footer-links ul { margin: 0; padding: 0; list-style: none; }
.footer-links li + li { margin-top: 0.35rem; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }
/* The H5P pages, the build page and the skill's: one wide column, its prose at --measure, and its
sections as steps. */
:is(.build, .skill) { max-width: var(--page-width); }
.build-brand { margin-bottom: 1.25rem; font-size: 0.9375rem; }
/* A longer heading than the docs' package names, so it gives way on a phone. */
:is(.build, .skill) .docs-header h1 { font-size: clamp(1.75rem, 1.2rem + 3vw, 2.25rem); }
/* Prose keeps a line a reader can follow; the source, the lists and what plays take the whole width. */
:is(.build, .skill) p:not(.status) { max-width: var(--measure); }
/* H5P build page, /h5p/build/ */
.build {
--ok: var(--live);
--bad: var(--t-tag);
/* Masked, like the preview pane's icons, so they take a color like text does. */
--icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
--icon-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 5v8.5M12 18.5v.01'/%3E%3C/svg%3E");
}
/* The steps are a timeline, on this page and the skill's: a marker for each, on a rail that runs on
to the next. A step the page hides, as the files of a source that names none, is not on it, and
the rail ends at the last shown. How a step stands, done or wrong, is the build page's alone. */
.step {
--marker: 2rem;
--indent: calc(var(--marker) + 1rem);
/* How the step stands, which the rules under these set from what the page says of it. */
--step-color: var(--accent);
--step-fill: var(--bg);
--step-rail: var(--border);
--step-marked: 0;
position: relative;
padding: 0 0 1.5rem var(--indent);
}
.docs-header + .step { margin-top: 2.5rem; }
/* The source is JSON, every file it names is chosen, the build is ready: the step is done. */
.build .step:is(
:has(#source-state[data-state="ok"]),
:has(.file-list > li):not(:has(.file-list > [data-chosen="false"])),
:has(.status[data-state="ready"])
) {
--step-fill: var(--accent);
--step-rail: var(--accent);
--step-marked: 1;
--step-icon: var(--icon-check);
}
/* The text is not JSON, or nothing was built. */
.build .step:has(#source-state[data-state="error"], .status[data-state="error"]) {
--step-color: var(--bad);
--step-fill: var(--bad);
--step-marked: 1;
--step-icon: var(--icon-alert);
}
/* The rail, from under a step's marker to the next one's. It is a border, which forced colors keep. */
.step::before {
content: "";
position: absolute;
top: calc(var(--marker) + 0.5rem);
bottom: 0.5rem;
left: calc(var(--marker) / 2 - 1px);
border-left: 2px solid var(--step-rail);
transform-origin: top;
transition: border-color 0.2s, opacity 0.3s, scale 0.3s ease-out;
}
/* None from the last step shown: it is drawn down to a step as that one joins. */
.step:not(:has(~ .step:not([hidden])))::before { opacity: 0; }
/* A step that joins the others, the files or the play, comes in. */
#files-step, #play-step { transition: opacity 0.3s ease-out, translate 0.3s ease-out; }
@starting-style {
#files-step, #play-step { opacity: 0; }
}
.step h2 {
display: flex;
align-items: center;
min-height: var(--marker);
margin: 0 0 0.75rem;
padding: 0;
border: 0;
font-size: 1.25rem;
}
.build h3 { margin: 1.5rem 0 0.5rem; font-size: 1rem; }
.step-marker {
position: absolute;
top: 0;
left: 0;
display: grid;
place-items: center;
width: var(--marker);
height: var(--marker);
border: 2px solid var(--step-color);
border-radius: 50%;
background: var(--step-fill);
color: var(--step-color);
font-size: 0.875rem;
line-height: 1;
font-variant-numeric: tabular-nums;
transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
/* A check or a warning takes the number's place. The number stays in the heading's name. */
.step-number { opacity: calc(1 - var(--step-marked)); transition: opacity 0.2s; }
.step-marker::after {
content: "";
position: absolute;
inset: 0;
background: var(--bg);
mask: var(--step-icon, none) center / 1.125rem no-repeat;
opacity: var(--step-marked);
transition: opacity 0.2s;
}
/* While it builds, and until what was built plays, a ring around the marker, which turns. */
.step-marker::before {
content: "";
position: absolute;
inset: -0.3125rem;
border: 2px solid var(--tint);
border-top-color: var(--accent);
border-radius: 50%;
opacity: 0;
transition: opacity 0.2s;
}
.build .step:has(.status[data-state="building"]) .step-marker::before { opacity: 1; }
@keyframes turn { to { rotate: 1turn; } }
.build label { display: block; margin-bottom: 0.35rem; font-weight: 600; }
.build label.inline-label { display: inline; margin-right: 0.5rem; }
.build textarea {
display: block;
width: 100%;
min-height: 12rem;
resize: vertical;
padding: 0.6rem 0.75rem;
border: 1px solid var(--control);
border-radius: var(--radius);
background: var(--raised);
color: var(--text);
font: 0.8125rem/1.6 var(--mono);
}
.build textarea:hover { border-color: var(--text); }
/* The source's editor hides its textarea, which stays under it as the field the page reads. */
.build textarea[hidden] { display: none; }
.build .field { margin: 0 0 0.5rem; }
.source-editor { display: block; }
/* A line of its own, kept when it is empty, so that what is under it does not move as a mistake comes and goes:
two lines where the column is narrow enough for a message to wrap. */
.build #source-state { margin: 0.5rem 0 0.25rem; min-height: 1.5em; }
@media (max-width: 700px) { .build #source-state { min-height: 3em; } }
.build #source-state[data-state="error"] { color: var(--bad); }
.build .link-button, .build .problems .jump {
padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer;
}
.build .problems .jump code { color: inherit; }
.build input[type="file"] { max-width: 100%; font: inherit; font-size: 0.875rem; color: var(--muted); }
.build input[type="file"]::file-selector-button {
margin-right: 0.6rem;
padding: 0.3rem 0.7rem;
border: 1px solid var(--border);
border-radius: var(--radius);
background: var(--raised);
color: var(--text);
font: inherit;
cursor: pointer;
}
.build input[type="file"]::file-selector-button:hover { background: var(--tint); }
.build a.button { text-decoration: none; }
.button-large { padding: 0.55rem 1.1rem; font-size: 0.9375rem; }
/* The page's two main actions, Build and Download, filled where the site's other buttons are outlined. */
.button-solid, .button-solid:hover { border-color: var(--accent); background: var(--accent); color: var(--bg); font-weight: 600; }
.button-solid:hover:not(:disabled) { border-color: transparent; background: color-mix(in oklab, var(--accent) 85%, var(--text)); }
.build .button:disabled { opacity: 0.6; cursor: progress; }
.build .status {
padding: 0.6rem 0.85rem;
border-left: 3px solid var(--border);
border-radius: 0 var(--radius) var(--radius) 0;
background: var(--surface);
}
.build .status:empty { display: none; }
.build .status[data-state="building"] { border-left-color: var(--focus); background: var(--tint); }
.build .status[data-state="ready"] { border-left-color: var(--ok); }
.build .status[data-state="error"] { border-left-color: var(--bad); }
/* The problems, the notes and the files, a row each; on the skill page, its addresses. */
.build .messages, .build .file-list, .skill-files {
padding: 0;
border: 1px solid var(--border);
border-radius: var(--radius);
background: var(--raised);
list-style: none;
}
.build .messages li, .build .file-list li, .skill-files li { margin: 0; padding: 0.55rem 0.85rem; overflow-wrap: anywhere; }
.build .messages li + li, .build .file-list li + li, .skill-files li + li { border-top: 1px solid var(--border); }
/* A whole address in the site's mono font, and what the file is, muted, after it. */
.skill-files { color: var(--muted); }
.skill-files li { font-size: 0.875rem; }
.skill-files a { font-family: var(--mono); font-size: 0.9375em; }
/* A file's name, then whether it is chosen: at the row's end where both fit on a line, under the name where they do not. */
.build .file-list li {
position: relative;
display: flex;
flex-wrap: wrap;
align-items: baseline;
justify-content: space-between;
gap: 0 0.6rem;
padding-left: 2.45rem;
white-space: nowrap;
}
.build .file-list code { white-space: normal; }
/* Beside the name's first line: a ring to fill, then a check. */
.build .file-list li::before {
content: "";
position: absolute;
top: 0.85rem;
left: 0.85rem;
width: 1rem;
height: 1rem;
border: 2px dotted var(--control);
border-radius: 50%;
}
.build .file-list li[data-chosen="true"]::before { border: 0; border-radius: 0; background: var(--accent); mask: var(--icon-check) center / contain no-repeat; }
.build .file-list li[data-chosen="false"] { color: var(--muted); }
.build .hint { color: var(--muted); font-size: 0.875rem; }
/* H5P content draws on white, whatever the page's theme. */
.player-box { margin: 1rem 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #ffffff; }
.player-box h5p-player { display: block; }
@media (max-width: 480px) {
.step { --marker: 1.75rem; --indent: calc(var(--marker) + 0.75rem); }
.step-marker { font-size: 0.8125rem; }
/* The last step has no rail beside it, so on a phone what plays takes the column's whole width. */
.player-box { margin-left: calc(-1 * var(--indent)); }
}
/* A finger's target. */
@media (pointer: coarse) {
.button-large { min-height: 2.75rem; }
.build input[type="file"]::file-selector-button { padding-block: 0.6rem; }
}
/* What moves, only where motion is not asked to be reduced: the rail drawn down, a step coming up, the ring turning. */
@media (prefers-reduced-motion: no-preference) {
.step:not(:has(~ .step:not([hidden])))::before { scale: 1 0; }
@starting-style {
#files-step, #play-step { translate: 0 0.5rem; }
}
.build .step:has(.status[data-state="building"]) .step-marker::before { animation: turn 0.9s linear infinite; }
}
@media (forced-colors: active) {
/* Masked icons paint with their background, which forced colors would turn into Canvas. */
.step-marker::after, .build .file-list li[data-chosen="true"]::before { forced-color-adjust: none; background: CanvasText; }
.step-marker::before { border-color: GrayText; border-top-color: Highlight; }
}