@minidocs/astro 0.0.0-stage → 0.2.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 +40 -2
- package/dist/behaviors.d.mts +114 -0
- package/dist/behaviors.mjs +635 -0
- package/dist/index.d.mts +23 -0
- package/dist/index.mjs +275 -0
- package/dist/links-Dp7d5R-O.mjs +242 -0
- package/dist/loaders.d.mts +25 -0
- package/dist/loaders.mjs +88 -0
- package/dist/routing-D28b92w8.mjs +60 -0
- package/dist/runtime.d.mts +202 -0
- package/dist/runtime.mjs +327 -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 +42 -0
- package/src/styles/callout.css +58 -0
- package/src/styles/layout.css +406 -0
- package/src/styles/pager.css +56 -0
- package/src/styles/prose.css +218 -0
- package/src/styles/search.css +207 -0
- package/src/styles/sidebar.css +162 -0
- package/src/styles/toc.css +79 -0
- package/src/styles.css +9 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/* Variables shared by every minidocs style file. Import it before any of the others. */
|
|
2
|
+
@layer minidocs {
|
|
3
|
+
/* Colors follow the page's color-scheme, not the system: pages without a dark style stay light */
|
|
4
|
+
:root {
|
|
5
|
+
--md-color-bg: light-dark(#ffffff, #18181b);
|
|
6
|
+
--md-color-heading: light-dark(#18181b, #fafafa);
|
|
7
|
+
--md-color-text: light-dark(#3f3f46, #d4d4d8);
|
|
8
|
+
--md-color-muted: light-dark(#71717a, #a1a1aa);
|
|
9
|
+
--md-color-border: light-dark(#e4e4e7, #2e2e33);
|
|
10
|
+
/* Neutral by default, so a site brings its own color by setting this one variable */
|
|
11
|
+
--md-color-accent: var(--md-color-heading);
|
|
12
|
+
--md-color-hover: color-mix(in srgb, var(--md-color-heading) 5%, transparent);
|
|
13
|
+
--md-color-current: color-mix(in srgb, var(--md-color-accent) 9%, transparent);
|
|
14
|
+
--md-color-code-bg: light-dark(#f6f6f7, #202024);
|
|
15
|
+
--md-color-note: light-dark(#2563eb, #60a5fa);
|
|
16
|
+
--md-color-tip: light-dark(#15803d, #4ade80);
|
|
17
|
+
--md-color-important: light-dark(#7c3aed, #a78bfa);
|
|
18
|
+
--md-color-warning: light-dark(#b45309, #fbbf24);
|
|
19
|
+
--md-color-caution: light-dark(#dc2626, #f87171);
|
|
20
|
+
--md-font-sans:
|
|
21
|
+
-apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
|
|
22
|
+
"Noto Sans CJK SC", sans-serif;
|
|
23
|
+
--md-font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
|
|
24
|
+
--md-radius: 0.375rem;
|
|
25
|
+
--md-focus-ring: 2px solid var(--md-color-accent);
|
|
26
|
+
--md-sidebar-font-size: 0.875rem;
|
|
27
|
+
--md-sidebar-item-padding-block: 0.375rem;
|
|
28
|
+
--md-sidebar-item-padding-inline: 0.625rem;
|
|
29
|
+
--md-sidebar-indent: 0.625rem;
|
|
30
|
+
--md-sidebar-rail-gap: 0.375rem;
|
|
31
|
+
--md-toc-font-size: 0.8125rem;
|
|
32
|
+
--md-toc-indent: 0.75rem;
|
|
33
|
+
--md-prose-font-size: 1rem;
|
|
34
|
+
--md-prose-line-height: 1.75;
|
|
35
|
+
--md-header-height: 3.5rem;
|
|
36
|
+
--md-layout-aside-button-height: 2.25rem;
|
|
37
|
+
--md-layout-sidebar-width: 15rem;
|
|
38
|
+
--md-layout-main-width: 46rem;
|
|
39
|
+
--md-layout-aside-width: 13rem;
|
|
40
|
+
--md-layout-drawer-width: min(20rem, 85vw);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/* Callouts, from the Callout component or the :::type and > [!TYPE] syntax. */
|
|
2
|
+
@layer minidocs {
|
|
3
|
+
.md-callout {
|
|
4
|
+
--md-callout-color: var(--md-color-note);
|
|
5
|
+
padding: 0.75rem 1rem;
|
|
6
|
+
border-inline-start: 2px solid var(--md-callout-color);
|
|
7
|
+
border-start-end-radius: var(--md-radius);
|
|
8
|
+
border-end-end-radius: var(--md-radius);
|
|
9
|
+
background: color-mix(in srgb, var(--md-callout-color) 7%, transparent);
|
|
10
|
+
color: var(--md-color-text);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.md-callout[data-type="tip"] {
|
|
14
|
+
--md-callout-color: var(--md-color-tip);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.md-callout[data-type="important"] {
|
|
18
|
+
--md-callout-color: var(--md-color-important);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.md-callout[data-type="warning"] {
|
|
22
|
+
--md-callout-color: var(--md-color-warning);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.md-callout[data-type="caution"] {
|
|
26
|
+
--md-callout-color: var(--md-color-caution);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* :nth-child(n) only raises specificity, so these win over the spacing of prose paragraphs and lists */
|
|
30
|
+
.md-callout > :nth-child(n) {
|
|
31
|
+
margin-block: 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.md-callout > :nth-child(n + 2) {
|
|
35
|
+
margin-block-start: 0.5em;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.md-callout > .md-callout-title + * {
|
|
39
|
+
margin-block-start: 0.125em;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.md-callout-title {
|
|
43
|
+
color: var(--md-callout-color);
|
|
44
|
+
font-weight: 600;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* Inside prose, links already follow .md-prose; this covers callouts used elsewhere */
|
|
48
|
+
.md-callout a {
|
|
49
|
+
color: inherit;
|
|
50
|
+
text-decoration: underline;
|
|
51
|
+
text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
|
|
52
|
+
text-underline-offset: 0.22em;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.md-prose .md-callout {
|
|
56
|
+
margin-block: 1.25em;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -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,56 @@
|
|
|
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
|
+
/* Padding gives hover a background like the sidebar's, and margins on the outer side keep text aligned */
|
|
13
|
+
.md-pager-link {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
gap: 0.125rem;
|
|
17
|
+
margin-block: -0.5rem;
|
|
18
|
+
margin-inline: -0.75rem 0;
|
|
19
|
+
padding: 0.5rem 0.75rem;
|
|
20
|
+
border-radius: var(--md-radius);
|
|
21
|
+
color: var(--md-color-heading);
|
|
22
|
+
text-decoration: none;
|
|
23
|
+
transition: background-color 0.15s;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.md-pager-link:hover {
|
|
27
|
+
background: var(--md-color-hover);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* The next page stays on the end side even when there is no previous one */
|
|
31
|
+
.md-pager-link[rel="next"] {
|
|
32
|
+
grid-column: 2;
|
|
33
|
+
margin-inline: 0 -0.75rem;
|
|
34
|
+
text-align: end;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.md-pager-link:focus-visible {
|
|
38
|
+
outline: var(--md-focus-ring);
|
|
39
|
+
outline-offset: -2px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.md-pager-label {
|
|
43
|
+
color: var(--md-color-muted);
|
|
44
|
+
font-size: 0.8125rem;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.md-pager-title {
|
|
48
|
+
font-weight: 500;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@media (prefers-reduced-motion: reduce) {
|
|
52
|
+
.md-pager-link {
|
|
53
|
+
transition: none;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|