@inklu/docs 0.2.0 → 0.2.2
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/CHANGELOG.md +12 -0
- package/dist/index.js +31 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +38 -43
- package/dist/index.mjs.map +1 -1
- package/dist/shiki.js +2 -2
- package/dist/shiki.js.map +1 -1
- package/dist/shiki.mjs +2 -2
- package/dist/shiki.mjs.map +1 -1
- package/dist/styles.css +113 -72
- package/package.json +2 -1
- package/src/components/content/code-block.tsx +6 -4
- package/src/components/layout/docs-layout.tsx +26 -39
- package/src/components/layout/site-header.tsx +1 -1
- package/src/components/layout/site-provider.tsx +2 -0
- package/src/components/shared/command-block.tsx +3 -3
- package/src/shiki.ts +2 -2
- package/src/styles.css +4 -4
- package/src/typeset.css +66 -37
package/src/typeset.css
CHANGED
|
@@ -11,7 +11,12 @@
|
|
|
11
11
|
--typeset-size: 1em;
|
|
12
12
|
--typeset-leading: 1.8;
|
|
13
13
|
--typeset-flow: 1.5em;
|
|
14
|
-
--typeset-body: color-mix(in oklab, currentColor
|
|
14
|
+
--typeset-body: color-mix(in oklab, currentColor 78%, transparent);
|
|
15
|
+
--typeset-muted: var(
|
|
16
|
+
--color-muted-foreground,
|
|
17
|
+
color-mix(in oklab, currentColor 58%, transparent)
|
|
18
|
+
);
|
|
19
|
+
--typeset-faint: color-mix(in oklab, currentColor 42%, transparent);
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
.typeset-docs {
|
|
@@ -25,6 +30,15 @@
|
|
|
25
30
|
|
|
26
31
|
.dark .typeset {
|
|
27
32
|
--typeset-leading: 1.85;
|
|
33
|
+
/* Muted tones need to be a touch brighter in dark mode to stay legible
|
|
34
|
+
against a near-black background, since the contrast ratio compresses
|
|
35
|
+
faster there than it does on light backgrounds. */
|
|
36
|
+
--typeset-body: color-mix(in oklab, currentColor 80%, transparent);
|
|
37
|
+
--typeset-muted: var(
|
|
38
|
+
--color-muted-foreground,
|
|
39
|
+
color-mix(in oklab, currentColor 55%, transparent)
|
|
40
|
+
);
|
|
41
|
+
--typeset-faint: color-mix(in oklab, currentColor 40%, transparent);
|
|
28
42
|
}
|
|
29
43
|
.dark .typeset-docs {
|
|
30
44
|
--typeset-leading: 1.6;
|
|
@@ -44,10 +58,6 @@
|
|
|
44
58
|
font-size: var(--typeset-size);
|
|
45
59
|
}
|
|
46
60
|
|
|
47
|
-
--typeset-muted: var(
|
|
48
|
-
--color-muted-foreground,
|
|
49
|
-
color-mix(in oklab, currentColor 60%, transparent)
|
|
50
|
-
);
|
|
51
61
|
--typeset-rule: var(
|
|
52
62
|
--color-border,
|
|
53
63
|
color-mix(in oklab, currentColor 20%, transparent)
|
|
@@ -57,11 +67,11 @@
|
|
|
57
67
|
.typeset
|
|
58
68
|
*:not(
|
|
59
69
|
:where(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
70
|
+
.not-typeset,
|
|
71
|
+
[data-not-typeset],
|
|
72
|
+
.not-typeset *,
|
|
73
|
+
[data-not-typeset] *
|
|
74
|
+
)
|
|
65
75
|
) {
|
|
66
76
|
/* Paragraphs. */
|
|
67
77
|
&:where(p) {
|
|
@@ -70,7 +80,18 @@
|
|
|
70
80
|
color: var(--typeset-body);
|
|
71
81
|
}
|
|
72
82
|
|
|
73
|
-
/*
|
|
83
|
+
/*
|
|
84
|
+
* Headings.
|
|
85
|
+
*
|
|
86
|
+
* The scale is intentionally compressed: h1 → h4 sit within ~0.25em of
|
|
87
|
+
* body text and of each other. Hierarchy is carried primarily by
|
|
88
|
+
* font-weight and full-opacity color (headings are never color-mixed,
|
|
89
|
+
* body copy always is), with size doing only secondary work. This reads
|
|
90
|
+
* as calmer and more "documentation-like" than a large type scale, and
|
|
91
|
+
* keeps h1–h4 visually close enough that jumping levels never feels like
|
|
92
|
+
* a jarring size cliff — only h5/h6 drop into the muted tier, since by
|
|
93
|
+
* that point they're acting more like eyebrow labels than headings.
|
|
94
|
+
*/
|
|
74
95
|
&:where(h1, h2, h3, h4, h5, h6) {
|
|
75
96
|
color: var(--color-foreground, currentColor);
|
|
76
97
|
font-family: var(--typeset-font-heading);
|
|
@@ -78,17 +99,18 @@
|
|
|
78
99
|
margin-block-end: 0;
|
|
79
100
|
}
|
|
80
101
|
&:where(h1) {
|
|
81
|
-
font-size: 1.
|
|
82
|
-
line-height: 1.
|
|
102
|
+
font-size: 1.25em;
|
|
103
|
+
line-height: 1.35;
|
|
104
|
+
letter-spacing: -0.01em;
|
|
83
105
|
margin-block-start: var(--typeset-flow);
|
|
84
106
|
}
|
|
85
107
|
&:where(h2) {
|
|
86
|
-
font-size: 1.
|
|
108
|
+
font-size: 1.125em;
|
|
87
109
|
line-height: 1.4;
|
|
88
110
|
margin-block-start: calc(var(--typeset-flow) * 1.4);
|
|
89
111
|
}
|
|
90
112
|
&:where(h3) {
|
|
91
|
-
font-size: 1.
|
|
113
|
+
font-size: 1.0625em;
|
|
92
114
|
line-height: 1.45;
|
|
93
115
|
margin-block-start: var(--typeset-flow);
|
|
94
116
|
}
|
|
@@ -98,17 +120,17 @@
|
|
|
98
120
|
margin-block-start: var(--typeset-flow);
|
|
99
121
|
}
|
|
100
122
|
&:where(h5) {
|
|
101
|
-
font-size: 0.
|
|
123
|
+
font-size: 0.9375em;
|
|
102
124
|
line-height: 1.5;
|
|
103
125
|
font-weight: 500;
|
|
104
126
|
color: var(--typeset-muted);
|
|
105
|
-
margin-block-start: calc(var(--typeset-flow) / 0.
|
|
127
|
+
margin-block-start: calc(var(--typeset-flow) / 0.9375);
|
|
106
128
|
}
|
|
107
129
|
&:where(h6) {
|
|
108
130
|
font-size: 0.8125em;
|
|
109
131
|
line-height: 1.5;
|
|
110
132
|
font-weight: 500;
|
|
111
|
-
letter-spacing: 0.
|
|
133
|
+
letter-spacing: 0.06em;
|
|
112
134
|
text-transform: uppercase;
|
|
113
135
|
color: var(--typeset-muted);
|
|
114
136
|
margin-block-start: calc(var(--typeset-flow) / 0.8125);
|
|
@@ -148,6 +170,7 @@
|
|
|
148
170
|
/* Inline semantics. */
|
|
149
171
|
&:where(strong, b) {
|
|
150
172
|
font-weight: 600;
|
|
173
|
+
color: var(--color-foreground, currentColor);
|
|
151
174
|
}
|
|
152
175
|
&:where(:is(h1, h2, h3, h4) :is(strong, b)) {
|
|
153
176
|
font-weight: 600;
|
|
@@ -169,7 +192,7 @@
|
|
|
169
192
|
cursor: help;
|
|
170
193
|
}
|
|
171
194
|
&:where(del, s) {
|
|
172
|
-
color: var(--typeset-
|
|
195
|
+
color: var(--typeset-faint);
|
|
173
196
|
text-decoration-line: line-through;
|
|
174
197
|
}
|
|
175
198
|
&:where(sup, sub) {
|
|
@@ -228,10 +251,10 @@
|
|
|
228
251
|
margin-block-start: 0.5em;
|
|
229
252
|
}
|
|
230
253
|
&:where(ul > li)::marker {
|
|
231
|
-
color: var(--typeset-
|
|
254
|
+
color: var(--typeset-faint);
|
|
232
255
|
}
|
|
233
256
|
&:where(ol > li)::marker {
|
|
234
|
-
color: var(--typeset-
|
|
257
|
+
color: var(--typeset-faint);
|
|
235
258
|
}
|
|
236
259
|
|
|
237
260
|
/* GFM task lists. */
|
|
@@ -255,7 +278,7 @@
|
|
|
255
278
|
font-weight: 500;
|
|
256
279
|
}
|
|
257
280
|
&:where(summary)::marker {
|
|
258
|
-
color: var(--typeset-
|
|
281
|
+
color: var(--typeset-faint);
|
|
259
282
|
}
|
|
260
283
|
|
|
261
284
|
/* Keyboard keys. */
|
|
@@ -263,6 +286,7 @@
|
|
|
263
286
|
font-family: inherit;
|
|
264
287
|
font-size: 0.85em;
|
|
265
288
|
font-weight: 500;
|
|
289
|
+
color: var(--typeset-body);
|
|
266
290
|
border: 1px solid var(--typeset-rule);
|
|
267
291
|
border-block-end-width: 2px;
|
|
268
292
|
border-radius: min(calc(var(--radius, 0.5em) * 0.6), 0.35em);
|
|
@@ -294,6 +318,7 @@
|
|
|
294
318
|
--color-muted,
|
|
295
319
|
color-mix(in oklab, currentColor 8%, transparent)
|
|
296
320
|
);
|
|
321
|
+
color: var(--typeset-body);
|
|
297
322
|
font-family: var(--typeset-font-mono);
|
|
298
323
|
font-size: 0.85em;
|
|
299
324
|
border-radius: min(calc(var(--radius, 0.5em) * 0.6), 0.35em);
|
|
@@ -319,6 +344,7 @@
|
|
|
319
344
|
}
|
|
320
345
|
&:where(pre code) {
|
|
321
346
|
background-color: transparent;
|
|
347
|
+
color: inherit;
|
|
322
348
|
font-family: inherit;
|
|
323
349
|
font-size: inherit;
|
|
324
350
|
padding: 0;
|
|
@@ -327,6 +353,7 @@
|
|
|
327
353
|
|
|
328
354
|
/* Blockquote. */
|
|
329
355
|
&:where(blockquote) {
|
|
356
|
+
color: var(--typeset-muted);
|
|
330
357
|
border-inline-start: 2px solid var(--typeset-rule);
|
|
331
358
|
padding-inline-start: 1em;
|
|
332
359
|
margin-block-start: var(--typeset-flow);
|
|
@@ -351,7 +378,7 @@
|
|
|
351
378
|
border-block-start: 1px solid var(--typeset-rule);
|
|
352
379
|
padding-block-start: var(--typeset-flow);
|
|
353
380
|
font-size: 0.875em;
|
|
354
|
-
color: var(--typeset-
|
|
381
|
+
color: var(--typeset-faint);
|
|
355
382
|
}
|
|
356
383
|
|
|
357
384
|
/* Math. */
|
|
@@ -380,7 +407,7 @@
|
|
|
380
407
|
margin-inline: 0;
|
|
381
408
|
}
|
|
382
409
|
&:where(figcaption, caption) {
|
|
383
|
-
color: var(--typeset-
|
|
410
|
+
color: var(--typeset-faint);
|
|
384
411
|
font-size: 0.875em;
|
|
385
412
|
text-align: center;
|
|
386
413
|
margin-block-start: calc(0.75em / 0.875);
|
|
@@ -419,6 +446,7 @@
|
|
|
419
446
|
}
|
|
420
447
|
&:where(thead th) {
|
|
421
448
|
font-weight: 500;
|
|
449
|
+
color: var(--typeset-muted);
|
|
422
450
|
text-align: start;
|
|
423
451
|
white-space: nowrap;
|
|
424
452
|
padding: 0.65em 1em;
|
|
@@ -434,6 +462,7 @@
|
|
|
434
462
|
}
|
|
435
463
|
&:where(tbody th, tfoot th) {
|
|
436
464
|
font-weight: 500;
|
|
465
|
+
color: var(--color-foreground, currentColor);
|
|
437
466
|
}
|
|
438
467
|
&:where(th:first-child, td:first-child) {
|
|
439
468
|
padding-inline-start: 0;
|
|
@@ -473,23 +502,23 @@
|
|
|
473
502
|
|
|
474
503
|
/* First child adds no space above. Last so it wins ties. */
|
|
475
504
|
.typeset
|
|
476
|
-
|
|
477
|
-
|
|
505
|
+
> :where(:first-child):not(
|
|
506
|
+
:where(
|
|
478
507
|
.not-typeset,
|
|
479
508
|
[data-not-typeset],
|
|
480
509
|
.not-typeset *,
|
|
481
510
|
[data-not-typeset] *
|
|
482
511
|
)
|
|
483
|
-
|
|
512
|
+
),
|
|
484
513
|
.typeset
|
|
485
514
|
> :where(:first-child)
|
|
486
515
|
> :where(:first-child):not(
|
|
487
516
|
:where(
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
517
|
+
.not-typeset,
|
|
518
|
+
[data-not-typeset],
|
|
519
|
+
.not-typeset *,
|
|
520
|
+
[data-not-typeset] *
|
|
521
|
+
)
|
|
493
522
|
),
|
|
494
523
|
.typeset
|
|
495
524
|
:where(
|
|
@@ -502,11 +531,11 @@
|
|
|
502
531
|
figure > picture > img
|
|
503
532
|
):not(
|
|
504
533
|
:where(
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
534
|
+
.not-typeset,
|
|
535
|
+
[data-not-typeset],
|
|
536
|
+
.not-typeset *,
|
|
537
|
+
[data-not-typeset] *
|
|
538
|
+
)
|
|
510
539
|
) {
|
|
511
540
|
margin-block-start: 0;
|
|
512
541
|
}
|