@minidocs/astro 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/LICENSE +21 -0
- package/README.md +26 -2
- package/dist/behaviors.d.mts +114 -0
- package/dist/behaviors.mjs +635 -0
- package/dist/index.d.mts +25 -0
- package/dist/index.mjs +262 -0
- package/dist/links-UTLyoo_o.mjs +177 -0
- package/dist/loaders.d.mts +20 -0
- package/dist/loaders.mjs +76 -0
- package/dist/routing-TMqRCY2Q.mjs +48 -0
- package/dist/runtime.d.mts +160 -0
- package/dist/runtime.mjs +310 -0
- package/package.json +80 -3
- package/src/components/Prose.astro +9 -0
- package/src/components/callout/Root.astro +14 -0
- package/src/components/callout/Title.astro +9 -0
- package/src/components/callout/index.ts +2 -0
- package/src/components/index.ts +7 -0
- package/src/components/layout/Aside.astro +29 -0
- package/src/components/layout/Header.astro +18 -0
- package/src/components/layout/Main.astro +9 -0
- package/src/components/layout/Root.astro +15 -0
- package/src/components/layout/Sidebar.astro +9 -0
- package/src/components/layout/Title.astro +10 -0
- package/src/components/layout/index.ts +6 -0
- package/src/components/pager/Label.astro +9 -0
- package/src/components/pager/Link.astro +12 -0
- package/src/components/pager/Root.astro +12 -0
- package/src/components/pager/Title.astro +9 -0
- package/src/components/pager/index.ts +4 -0
- package/src/components/search/Count.astro +10 -0
- package/src/components/search/Dialog.astro +14 -0
- package/src/components/search/Empty.astro +10 -0
- package/src/components/search/Error.astro +10 -0
- package/src/components/search/Found.astro +10 -0
- package/src/components/search/Idle.astro +10 -0
- package/src/components/search/Input.astro +26 -0
- package/src/components/search/Loading.astro +10 -0
- package/src/components/search/Query.astro +10 -0
- package/src/components/search/Results.astro +20 -0
- package/src/components/search/Root.astro +15 -0
- package/src/components/search/Shortcut.astro +14 -0
- package/src/components/search/Trigger.astro +28 -0
- package/src/components/search/index.ts +13 -0
- package/src/components/sidebar/Group.astro +45 -0
- package/src/components/sidebar/Item.astro +9 -0
- package/src/components/sidebar/Label.astro +9 -0
- package/src/components/sidebar/Link.astro +23 -0
- package/src/components/sidebar/List.astro +11 -0
- package/src/components/sidebar/Root.astro +24 -0
- package/src/components/sidebar/Trigger.astro +29 -0
- package/src/components/sidebar/index.ts +7 -0
- package/src/components/toc/Item.astro +9 -0
- package/src/components/toc/Link.astro +12 -0
- package/src/components/toc/List.astro +11 -0
- package/src/components/toc/Root.astro +20 -0
- package/src/components/toc/index.ts +4 -0
- package/src/styles/base.css +41 -0
- package/src/styles/callout.css +58 -0
- package/src/styles/layout.css +406 -0
- package/src/styles/pager.css +51 -0
- package/src/styles/prose.css +218 -0
- package/src/styles/search.css +202 -0
- package/src/styles/sidebar.css +162 -0
- package/src/styles/toc.css +79 -0
- package/src/styles.css +9 -0
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
/* Page layout: where the header, sidebar, content and aside go, and how that changes with the screen width. */
|
|
2
|
+
@layer minidocs {
|
|
3
|
+
/* The page itself takes the minidocs look only when it uses Layout.Root */
|
|
4
|
+
:root:has(.md-layout) {
|
|
5
|
+
color-scheme: light dark;
|
|
6
|
+
background: var(--md-color-bg);
|
|
7
|
+
color: var(--md-color-text);
|
|
8
|
+
font-family: var(--md-font-sans);
|
|
9
|
+
-webkit-font-smoothing: antialiased;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
:root:has(.md-layout) body {
|
|
13
|
+
margin: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* The outer columns center the content and let the header background span the whole width */
|
|
17
|
+
/* Biome's noInvalidGridAreas reports these area templates as inconsistent although they are not, so biome.json turns it off for this file */
|
|
18
|
+
/* The aside column stays on pages without a table of contents, so the sidebar and the content never move between pages */
|
|
19
|
+
.md-layout {
|
|
20
|
+
--md-layout-gap: 3.5rem;
|
|
21
|
+
display: grid;
|
|
22
|
+
grid-template-columns:
|
|
23
|
+
[full-start] minmax(0, 1fr)
|
|
24
|
+
[content-start] var(--md-layout-sidebar-width) minmax(0, var(--md-layout-main-width)) var(--md-layout-aside-width)
|
|
25
|
+
[content-end] minmax(0, 1fr) [full-end];
|
|
26
|
+
grid-template-rows: auto 1fr;
|
|
27
|
+
grid-template-areas:
|
|
28
|
+
"header header header header header"
|
|
29
|
+
". sidebar main aside .";
|
|
30
|
+
column-gap: var(--md-layout-gap);
|
|
31
|
+
min-height: 100dvh;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.md-layout-header {
|
|
35
|
+
position: sticky;
|
|
36
|
+
top: 0;
|
|
37
|
+
z-index: 40;
|
|
38
|
+
grid-area: header;
|
|
39
|
+
display: grid;
|
|
40
|
+
grid-template-columns: subgrid;
|
|
41
|
+
height: var(--md-header-height);
|
|
42
|
+
border-block-end: 1px solid var(--md-color-border);
|
|
43
|
+
background: color-mix(in srgb, var(--md-color-bg) 88%, transparent);
|
|
44
|
+
backdrop-filter: blur(12px);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.md-layout-header-inner {
|
|
48
|
+
grid-column: content-start / content-end;
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
gap: 0.75rem;
|
|
52
|
+
min-width: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.md-layout-title {
|
|
56
|
+
display: inline-flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
gap: 0.5rem;
|
|
59
|
+
color: var(--md-color-heading);
|
|
60
|
+
font-size: 1.0625rem;
|
|
61
|
+
font-weight: 650;
|
|
62
|
+
letter-spacing: -0.02em;
|
|
63
|
+
text-decoration: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.md-layout-title:focus-visible {
|
|
67
|
+
border-radius: 2px;
|
|
68
|
+
outline: var(--md-focus-ring);
|
|
69
|
+
outline-offset: 4px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.md-layout-header-end {
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
gap: 0.5rem;
|
|
76
|
+
margin-inline-start: auto;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* The trigger is only needed where the sidebar is a drawer */
|
|
80
|
+
.md-layout .md-sidebar-trigger {
|
|
81
|
+
display: none;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.md-layout-sidebar,
|
|
85
|
+
.md-layout-aside {
|
|
86
|
+
position: sticky;
|
|
87
|
+
top: var(--md-header-height);
|
|
88
|
+
align-self: start;
|
|
89
|
+
box-sizing: border-box;
|
|
90
|
+
max-height: calc(100dvh - var(--md-header-height));
|
|
91
|
+
padding-block: 2rem;
|
|
92
|
+
overflow-y: auto;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* Pulls sidebar items out by their own padding, so their text lines up with the header */
|
|
96
|
+
.md-layout-sidebar {
|
|
97
|
+
grid-area: sidebar;
|
|
98
|
+
margin-inline: calc(-1 * var(--md-sidebar-item-padding-inline));
|
|
99
|
+
padding-inline: 0.125rem;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.md-layout-main {
|
|
103
|
+
grid-area: main;
|
|
104
|
+
min-width: 0;
|
|
105
|
+
padding-block: 2.5rem 5rem;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* Lowest specificity, so the spacing of the parts inside always wins */
|
|
109
|
+
:where(.md-layout-main) > :where(* + *) {
|
|
110
|
+
margin-block-start: 2rem;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.md-layout .md-prose :is(h1, h2, h3, h4, h5, h6) {
|
|
114
|
+
scroll-margin-top: calc(var(--md-header-height) + 1.5rem);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* attachAside reads this to tell whether the aside can collapse, so widths are only defined here */
|
|
118
|
+
.md-layout-aside {
|
|
119
|
+
--md-layout-aside-collapsible: 0;
|
|
120
|
+
grid-area: aside;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.md-layout-aside-title {
|
|
124
|
+
display: block;
|
|
125
|
+
margin-block-end: 0.75rem;
|
|
126
|
+
color: var(--md-color-heading);
|
|
127
|
+
font-size: 0.8125rem;
|
|
128
|
+
font-weight: 600;
|
|
129
|
+
list-style: none;
|
|
130
|
+
pointer-events: none;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.md-layout-aside-title::-webkit-details-marker {
|
|
134
|
+
display: none;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.md-layout-aside-current {
|
|
138
|
+
display: none;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/*
|
|
142
|
+
* Without room beside the content, the aside becomes a floating pill on the end side, stuck under the header and showing the section being read.
|
|
143
|
+
* Sticky items only stick within their grid area, so the pill shares the content's area and the content leaves room for it.
|
|
144
|
+
*/
|
|
145
|
+
@media (width <= 75rem) {
|
|
146
|
+
.md-layout {
|
|
147
|
+
--md-layout-gap: 2.5rem;
|
|
148
|
+
/* One offset for where the pill sits and where it sticks, so it never shifts before sticking. Set here so the content can leave room for it too. */
|
|
149
|
+
--md-layout-aside-offset: 1rem;
|
|
150
|
+
grid-template-columns:
|
|
151
|
+
[full-start] minmax(0, 1fr)
|
|
152
|
+
[content-start] var(--md-layout-sidebar-width) minmax(0, var(--md-layout-main-width))
|
|
153
|
+
[content-end] minmax(0, 1fr) [full-end];
|
|
154
|
+
grid-template-areas:
|
|
155
|
+
"header header header header"
|
|
156
|
+
". sidebar main .";
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.md-layout-aside {
|
|
160
|
+
--md-layout-aside-collapsible: 1;
|
|
161
|
+
position: sticky;
|
|
162
|
+
top: calc(var(--md-header-height) + var(--md-layout-aside-offset));
|
|
163
|
+
z-index: 30;
|
|
164
|
+
grid-area: main;
|
|
165
|
+
justify-self: end;
|
|
166
|
+
max-width: 100%;
|
|
167
|
+
max-height: none;
|
|
168
|
+
margin-block-start: var(--md-layout-aside-offset);
|
|
169
|
+
padding: 0;
|
|
170
|
+
overflow: visible;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.md-layout:has(> .md-layout-aside) .md-layout-main {
|
|
174
|
+
padding-block-start: calc(var(--md-layout-aside-offset) + var(--md-layout-aside-button-height) + 1.75rem);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* Headings land below the pill too, and the table of contents reads this as its reading line */
|
|
178
|
+
.md-layout:has(> .md-layout-aside) .md-prose :is(h1, h2, h3, h4, h5, h6) {
|
|
179
|
+
scroll-margin-top: calc(var(--md-header-height) + var(--md-layout-aside-button-height) + 2rem);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.md-layout-aside-title {
|
|
183
|
+
display: flex;
|
|
184
|
+
align-items: center;
|
|
185
|
+
gap: 0.5rem;
|
|
186
|
+
box-sizing: border-box;
|
|
187
|
+
max-width: 100%;
|
|
188
|
+
height: var(--md-layout-aside-button-height);
|
|
189
|
+
margin: 0;
|
|
190
|
+
padding-inline: 0.75rem 0.875rem;
|
|
191
|
+
border: 1px solid var(--md-color-border);
|
|
192
|
+
border-radius: 999px;
|
|
193
|
+
background: var(--md-color-bg);
|
|
194
|
+
box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
|
|
195
|
+
color: var(--md-color-heading);
|
|
196
|
+
font-size: 0.8125rem;
|
|
197
|
+
font-weight: 500;
|
|
198
|
+
cursor: pointer;
|
|
199
|
+
pointer-events: auto;
|
|
200
|
+
transition: box-shadow 0.2s;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.md-layout-aside-title:hover,
|
|
204
|
+
.md-layout-aside[open] > .md-layout-aside-title {
|
|
205
|
+
box-shadow: 0 4px 14px -4px rgb(0 0 0 / 0.14);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.md-layout-aside-title:focus-visible {
|
|
209
|
+
outline: var(--md-focus-ring);
|
|
210
|
+
outline-offset: 2px;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/* Reading progress as a ring, from --md-reading-progress set by attachAside */
|
|
214
|
+
.md-layout-aside-title::before {
|
|
215
|
+
content: "";
|
|
216
|
+
flex: none;
|
|
217
|
+
width: 0.875rem;
|
|
218
|
+
height: 0.875rem;
|
|
219
|
+
border-radius: 50%;
|
|
220
|
+
background: conic-gradient(
|
|
221
|
+
var(--md-color-accent) calc(var(--md-reading-progress, 0) * 1turn),
|
|
222
|
+
var(--md-color-border) 0
|
|
223
|
+
);
|
|
224
|
+
mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.md-layout-aside-label,
|
|
228
|
+
.md-layout-aside-current {
|
|
229
|
+
overflow: hidden;
|
|
230
|
+
text-overflow: ellipsis;
|
|
231
|
+
white-space: nowrap;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.md-layout-aside-current {
|
|
235
|
+
display: block;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/* Once the section being read is known it takes the label's place, which stays for screen readers */
|
|
239
|
+
.md-layout-aside-title:has(.md-layout-aside-current:not(:empty)) .md-layout-aside-label {
|
|
240
|
+
position: absolute;
|
|
241
|
+
width: 1px;
|
|
242
|
+
height: 1px;
|
|
243
|
+
overflow: hidden;
|
|
244
|
+
clip-path: inset(50%);
|
|
245
|
+
white-space: nowrap;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/* Same chevron as sidebar groups */
|
|
249
|
+
.md-layout-aside-title::after {
|
|
250
|
+
content: "";
|
|
251
|
+
flex: none;
|
|
252
|
+
width: 0.3125rem;
|
|
253
|
+
height: 0.3125rem;
|
|
254
|
+
margin-inline-start: 0.125rem;
|
|
255
|
+
border-block-end: 1.5px solid currentColor;
|
|
256
|
+
border-inline-end: 1.5px solid currentColor;
|
|
257
|
+
opacity: 0.45;
|
|
258
|
+
transform: translateY(-0.125rem) rotate(45deg);
|
|
259
|
+
transition: transform 0.2s;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.md-layout-aside[open] > .md-layout-aside-title::after {
|
|
263
|
+
transform: translateY(0.125rem) rotate(-135deg);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/* The open table of contents drops down from the pill like a menu, over the content */
|
|
267
|
+
.md-layout-aside > :not(summary) {
|
|
268
|
+
position: absolute;
|
|
269
|
+
inset-block-start: 100%;
|
|
270
|
+
inset-inline-end: 0;
|
|
271
|
+
box-sizing: border-box;
|
|
272
|
+
width: min(20rem, calc(100vw - 2 * var(--md-layout-gap)));
|
|
273
|
+
max-height: calc(100dvh - var(--md-header-height) - var(--md-layout-aside-button-height) - 3rem);
|
|
274
|
+
margin-block-start: 0.5rem;
|
|
275
|
+
padding: 1rem 1.125rem;
|
|
276
|
+
overflow-y: auto;
|
|
277
|
+
overscroll-behavior: contain;
|
|
278
|
+
border: 1px solid var(--md-color-border);
|
|
279
|
+
border-radius: 0.75rem;
|
|
280
|
+
background: var(--md-color-bg);
|
|
281
|
+
box-shadow:
|
|
282
|
+
0 16px 40px -12px rgb(0 0 0 / 0.2),
|
|
283
|
+
0 2px 6px -2px rgb(0 0 0 / 0.06);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/* Narrow screens: one column, and the sidebar becomes a drawer opened by Sidebar.Trigger */
|
|
288
|
+
@media (width <= 50rem) {
|
|
289
|
+
.md-layout {
|
|
290
|
+
--md-layout-gap: 1.25rem;
|
|
291
|
+
grid-template-columns:
|
|
292
|
+
[full-start] minmax(0, 1fr)
|
|
293
|
+
[content-start] minmax(0, var(--md-layout-main-width))
|
|
294
|
+
[content-end] minmax(0, 1fr) [full-end];
|
|
295
|
+
grid-template-areas:
|
|
296
|
+
"header header header"
|
|
297
|
+
". main .";
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.md-layout .md-sidebar-trigger {
|
|
301
|
+
display: inline-flex;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/* A trigger placed directly in Layout.Root becomes a pill on the start side, mirroring the sidebar's place */
|
|
305
|
+
.md-layout > .md-sidebar-trigger {
|
|
306
|
+
position: sticky;
|
|
307
|
+
top: calc(var(--md-header-height) + var(--md-layout-aside-offset));
|
|
308
|
+
z-index: 30;
|
|
309
|
+
grid-area: main;
|
|
310
|
+
justify-self: start;
|
|
311
|
+
align-self: start;
|
|
312
|
+
justify-content: center;
|
|
313
|
+
box-sizing: border-box;
|
|
314
|
+
width: var(--md-layout-aside-button-height);
|
|
315
|
+
height: var(--md-layout-aside-button-height);
|
|
316
|
+
margin-block-start: var(--md-layout-aside-offset);
|
|
317
|
+
padding: 0;
|
|
318
|
+
border-radius: 999px;
|
|
319
|
+
background: var(--md-color-bg);
|
|
320
|
+
box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
|
|
321
|
+
transition: box-shadow 0.2s;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.md-layout > .md-sidebar-trigger:hover {
|
|
325
|
+
box-shadow: 0 4px 14px -4px rgb(0 0 0 / 0.14);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/* Room for the menu pill beside the table of contents pill */
|
|
329
|
+
.md-layout:has(> .md-sidebar-trigger) > .md-layout-aside {
|
|
330
|
+
max-width: calc(100% - var(--md-layout-aside-button-height) - 0.75rem);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/* Pages without a table of contents still leave room for the menu pill */
|
|
334
|
+
.md-layout:has(> .md-sidebar-trigger) .md-layout-main {
|
|
335
|
+
padding-block-start: calc(var(--md-layout-aside-offset) + var(--md-layout-aside-button-height) + 1.75rem);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.md-layout:has(> .md-sidebar-trigger) .md-prose :is(h1, h2, h3, h4, h5, h6) {
|
|
339
|
+
scroll-margin-top: calc(var(--md-header-height) + var(--md-layout-aside-button-height) + 2rem);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.md-layout-sidebar {
|
|
343
|
+
position: fixed;
|
|
344
|
+
inset-block: 0;
|
|
345
|
+
inset-inline-start: 0;
|
|
346
|
+
z-index: 50;
|
|
347
|
+
grid-area: auto;
|
|
348
|
+
/* Positioned grid items still follow align-self, which would shrink the drawer to its content */
|
|
349
|
+
align-self: stretch;
|
|
350
|
+
width: var(--md-layout-drawer-width);
|
|
351
|
+
max-height: none;
|
|
352
|
+
margin: 0;
|
|
353
|
+
padding: 0;
|
|
354
|
+
overflow-y: auto;
|
|
355
|
+
overscroll-behavior: contain;
|
|
356
|
+
border-inline-end: 1px solid var(--md-color-border);
|
|
357
|
+
background: var(--md-color-bg);
|
|
358
|
+
/* The backdrop is one huge shadow; both states must have the same number of shadows to transition cleanly */
|
|
359
|
+
box-shadow: 0 0 0 100vmax transparent;
|
|
360
|
+
transform: translateX(-100%);
|
|
361
|
+
visibility: hidden;
|
|
362
|
+
transition:
|
|
363
|
+
transform 0.25s cubic-bezier(0.32, 0.72, 0, 1),
|
|
364
|
+
box-shadow 0.25s,
|
|
365
|
+
visibility 0s 0.25s;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/* The sidebar fills the drawer, so a click anywhere in the drawer counts as inside it */
|
|
369
|
+
.md-layout-sidebar > * {
|
|
370
|
+
box-sizing: border-box;
|
|
371
|
+
min-height: 100%;
|
|
372
|
+
padding: 1rem 0.75rem;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/* Only the sidebar's own state counts; open groups inside it carry data-state too */
|
|
376
|
+
.md-layout-sidebar:has(> [data-state="open"]) {
|
|
377
|
+
box-shadow: 0 0 0 100vmax rgb(0 0 0 / 0.36);
|
|
378
|
+
transform: none;
|
|
379
|
+
visibility: visible;
|
|
380
|
+
transition:
|
|
381
|
+
transform 0.25s cubic-bezier(0.32, 0.72, 0, 1),
|
|
382
|
+
box-shadow 0.25s;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
:root:has(.md-layout-sidebar > [data-state="open"]) {
|
|
386
|
+
overflow: hidden;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/* attachLayout sets this while the viewport is resized: a breakpoint changes the layout, not the state, so nothing slides */
|
|
391
|
+
.md-layout[data-md-resizing] :is(.md-layout-sidebar, .md-layout-aside-title),
|
|
392
|
+
.md-layout[data-md-resizing] .md-layout-aside-title::after,
|
|
393
|
+
.md-layout[data-md-resizing] > .md-sidebar-trigger {
|
|
394
|
+
transition: none;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
@media (prefers-reduced-motion: reduce) {
|
|
398
|
+
.md-layout-sidebar,
|
|
399
|
+
.md-layout-sidebar:has(> [data-state="open"]),
|
|
400
|
+
.md-layout-aside-title,
|
|
401
|
+
.md-layout-aside-title::after,
|
|
402
|
+
.md-layout > .md-sidebar-trigger {
|
|
403
|
+
transition: none;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/* Previous and next page links. */
|
|
2
|
+
@layer minidocs {
|
|
3
|
+
.md-pager {
|
|
4
|
+
display: grid;
|
|
5
|
+
grid-template-columns: 1fr 1fr;
|
|
6
|
+
gap: 1rem;
|
|
7
|
+
margin-block-start: 4rem;
|
|
8
|
+
padding-block-start: 1.5rem;
|
|
9
|
+
border-block-start: 1px solid var(--md-color-border);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.md-pager-link {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
gap: 0.125rem;
|
|
16
|
+
color: var(--md-color-heading);
|
|
17
|
+
text-decoration: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* The next page stays on the end side even when there is no previous one */
|
|
21
|
+
.md-pager-link[rel="next"] {
|
|
22
|
+
grid-column: 2;
|
|
23
|
+
text-align: end;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.md-pager-link:focus-visible {
|
|
27
|
+
border-radius: 2px;
|
|
28
|
+
outline: var(--md-focus-ring);
|
|
29
|
+
outline-offset: 4px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.md-pager-label {
|
|
33
|
+
color: var(--md-color-muted);
|
|
34
|
+
font-size: 0.8125rem;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.md-pager-title {
|
|
38
|
+
font-weight: 500;
|
|
39
|
+
transition: color 0.15s;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.md-pager-link:hover .md-pager-title {
|
|
43
|
+
color: var(--md-color-accent);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@media (prefers-reduced-motion: reduce) {
|
|
47
|
+
.md-pager-title {
|
|
48
|
+
transition: none;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/* Rendered Markdown content, from the Prose component or the md-prose class. */
|
|
2
|
+
@layer minidocs {
|
|
3
|
+
.md-prose {
|
|
4
|
+
color: var(--md-color-text);
|
|
5
|
+
font-size: var(--md-prose-font-size);
|
|
6
|
+
line-height: var(--md-prose-line-height);
|
|
7
|
+
overflow-wrap: break-word;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.md-prose > :first-child {
|
|
11
|
+
margin-block-start: 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.md-prose > :last-child {
|
|
15
|
+
margin-block-end: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.md-prose :is(h1, h2, h3, h4, h5, h6) {
|
|
19
|
+
color: var(--md-color-heading);
|
|
20
|
+
font-weight: 600;
|
|
21
|
+
line-height: 1.35;
|
|
22
|
+
text-wrap: balance;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.md-prose h1 {
|
|
26
|
+
margin-block: 0 1rem;
|
|
27
|
+
font-size: 1.875em;
|
|
28
|
+
font-weight: 700;
|
|
29
|
+
letter-spacing: -0.015em;
|
|
30
|
+
line-height: 1.25;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.md-prose h2 {
|
|
34
|
+
margin-block: 2.5em 0.75em;
|
|
35
|
+
font-size: 1.5em;
|
|
36
|
+
letter-spacing: -0.01em;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.md-prose h3 {
|
|
40
|
+
margin-block: 2em 0.5em;
|
|
41
|
+
font-size: 1.125em;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.md-prose :is(h4, h5, h6) {
|
|
45
|
+
margin-block: 1.75em 0.5em;
|
|
46
|
+
font-size: 1em;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* A heading right after another one already has enough space above it */
|
|
50
|
+
.md-prose :is(h1, h2, h3, h4, h5, h6) + :is(h2, h3, h4, h5, h6) {
|
|
51
|
+
margin-block-start: 0.75em;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* Except under the page title, which needs a clear gap before the first section */
|
|
55
|
+
.md-prose h1 + :is(h2, h3, h4, h5, h6) {
|
|
56
|
+
margin-block-start: 1.75em;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.md-prose :is(p, ul, ol, blockquote, pre, table, figure) {
|
|
60
|
+
margin-block: 1.125em;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.md-prose a {
|
|
64
|
+
color: var(--md-color-accent);
|
|
65
|
+
text-decoration: underline;
|
|
66
|
+
text-decoration-color: color-mix(in srgb, var(--md-color-accent) 35%, transparent);
|
|
67
|
+
text-decoration-thickness: 1px;
|
|
68
|
+
text-underline-offset: 0.22em;
|
|
69
|
+
transition: text-decoration-color 0.15s;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.md-prose a:hover {
|
|
73
|
+
text-decoration-color: currentColor;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.md-prose strong {
|
|
77
|
+
color: var(--md-color-heading);
|
|
78
|
+
font-weight: 600;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* Set explicitly, since resets like Tailwind's Preflight remove the browser defaults */
|
|
82
|
+
.md-prose :is(ul, ol) {
|
|
83
|
+
padding-inline-start: 1.375em;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.md-prose ul {
|
|
87
|
+
list-style-type: disc;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.md-prose ol {
|
|
91
|
+
list-style-type: decimal;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.md-prose :is(ul, ol) ul {
|
|
95
|
+
list-style-type: circle;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.md-prose li {
|
|
99
|
+
margin-block: 0.375em;
|
|
100
|
+
padding-inline-start: 0.125em;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.md-prose li > :is(ul, ol) {
|
|
104
|
+
margin-block: 0.375em;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.md-prose li::marker {
|
|
108
|
+
color: var(--md-color-muted);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.md-prose ol > li::marker {
|
|
112
|
+
font-variant-numeric: tabular-nums;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.md-prose blockquote {
|
|
116
|
+
margin-inline: 0;
|
|
117
|
+
padding-inline-start: 1em;
|
|
118
|
+
border-inline-start: 2px solid var(--md-color-border);
|
|
119
|
+
color: var(--md-color-muted);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.md-prose hr {
|
|
123
|
+
margin-block: 3em;
|
|
124
|
+
border: 0;
|
|
125
|
+
border-block-start: 1px solid var(--md-color-border);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.md-prose img {
|
|
129
|
+
max-width: 100%;
|
|
130
|
+
height: auto;
|
|
131
|
+
border-radius: var(--md-radius);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.md-prose code,
|
|
135
|
+
.md-prose kbd {
|
|
136
|
+
font-family: var(--md-font-mono);
|
|
137
|
+
font-size: 0.875em;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.md-prose :not(pre) > code {
|
|
141
|
+
padding: 0.125em 0.375em;
|
|
142
|
+
border-radius: 0.3125rem;
|
|
143
|
+
background: color-mix(in srgb, var(--md-color-heading) 6%, transparent);
|
|
144
|
+
color: var(--md-color-heading);
|
|
145
|
+
overflow-wrap: anywhere;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.md-prose a code {
|
|
149
|
+
color: inherit;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.md-prose kbd {
|
|
153
|
+
padding: 0.0625em 0.375em;
|
|
154
|
+
border: 1px solid var(--md-color-border);
|
|
155
|
+
border-block-end-width: 2px;
|
|
156
|
+
border-radius: 0.3125rem;
|
|
157
|
+
color: var(--md-color-heading);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.md-prose pre {
|
|
161
|
+
padding: 0.875rem 1rem;
|
|
162
|
+
border: 1px solid var(--md-color-border);
|
|
163
|
+
border-radius: 0.5rem;
|
|
164
|
+
background-color: var(--md-color-code-bg);
|
|
165
|
+
font-size: 0.8125rem;
|
|
166
|
+
line-height: 1.7;
|
|
167
|
+
overflow-x: auto;
|
|
168
|
+
tab-size: 2;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.md-prose pre > code {
|
|
172
|
+
font-size: inherit;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/* Shiki dual themes with defaultColor: false leave colors to CSS; single themes set them inline and win */
|
|
176
|
+
.md-prose :is(pre, pre span) {
|
|
177
|
+
color: light-dark(var(--shiki-light), var(--shiki-dark));
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.md-prose pre:focus-visible {
|
|
181
|
+
outline: var(--md-focus-ring);
|
|
182
|
+
outline-offset: 2px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/* Wide tables scroll inside themselves instead of widening the page */
|
|
186
|
+
.md-prose table {
|
|
187
|
+
display: block;
|
|
188
|
+
width: max-content;
|
|
189
|
+
max-width: 100%;
|
|
190
|
+
overflow-x: auto;
|
|
191
|
+
border-collapse: collapse;
|
|
192
|
+
font-size: 0.9375em;
|
|
193
|
+
line-height: 1.6;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.md-prose :is(th, td) {
|
|
197
|
+
padding: 0.625em 1.25em 0.625em 0;
|
|
198
|
+
border-block-end: 1px solid var(--md-color-border);
|
|
199
|
+
text-align: start;
|
|
200
|
+
vertical-align: top;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.md-prose :is(th, td):last-child {
|
|
204
|
+
padding-inline-end: 0;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/* Tables scroll sideways, so code in them stays whole instead of breaking mid-word */
|
|
208
|
+
.md-prose :is(th, td) code {
|
|
209
|
+
overflow-wrap: normal;
|
|
210
|
+
white-space: nowrap;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.md-prose th {
|
|
214
|
+
border-block-end-color: color-mix(in srgb, var(--md-color-heading) 25%, transparent);
|
|
215
|
+
color: var(--md-color-heading);
|
|
216
|
+
font-weight: 600;
|
|
217
|
+
}
|
|
218
|
+
}
|