@tenphi/starlight 0.5.0 → 0.6.1
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/dist/components/Card.astro +5 -3
- package/dist/components/GlobalStyles.js +761 -0
- package/dist/components/LayoutComponents.js +404 -0
- package/dist/components/Logo.astro +39 -0
- package/dist/components/MobileNavigationTabs.astro +7 -2
- package/dist/components/PackageVersion.astro +22 -0
- package/dist/components/Preview.astro +21 -10
- package/dist/components/Steps.astro +5 -1
- package/dist/components/Tabs.astro +9 -2
- package/dist/components/TastyComponents.js +156 -0
- package/dist/components/component-styles.test.ts +75 -0
- package/dist/components/component-styles.ts +79 -0
- package/dist/components/customize-component.js +10 -0
- package/dist/components/svg-icon.test.ts +11 -0
- package/dist/components/svg-icon.ts +11 -0
- package/dist/components/tasty-states.d.ts +2 -0
- package/dist/components/tasty-states.js +21 -0
- package/dist/components-public.d.ts +1 -0
- package/dist/components.d.ts +2 -1
- package/dist/components.js +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +297 -163
- package/dist/index.js.map +1 -1
- package/dist/{navigation-CC0dlAL8.js → navigation-CkQXI2Zb.js} +41 -2
- package/dist/navigation-CkQXI2Zb.js.map +1 -0
- package/dist/navigation.d.ts +11 -2
- package/dist/navigation.d.ts.map +1 -1
- package/dist/navigation.js +2 -2
- package/dist/overrides/Header.astro +28 -5
- package/dist/overrides/MobileMenuFooter.astro +15 -0
- package/dist/overrides/ThemeSelect.astro +69 -0
- package/dist/routes/DocsPage.astro +43 -145
- package/package.json +5 -9
- package/dist/components/NavigationTree.astro +0 -98
- package/dist/navigation-CC0dlAL8.js.map +0 -1
- package/dist/styles.css +0 -1346
- package/dist/styles.d.ts +0 -1
|
@@ -0,0 +1,761 @@
|
|
|
1
|
+
import { useGlobalStyles } from "@tenphi/tasty";
|
|
2
|
+
import arrowLeftIcon from "../icons/arrow-left.svg?raw";
|
|
3
|
+
import arrowRightIcon from "../icons/arrow-right.svg?raw";
|
|
4
|
+
import chevronRightIcon from "../icons/chevron-right.svg?raw";
|
|
5
|
+
import closeIcon from "../icons/close.svg?raw";
|
|
6
|
+
import searchIcon from "../icons/search.svg?raw";
|
|
7
|
+
import { svgIconUrl } from "./svg-icon.js";
|
|
8
|
+
import { configureCookbookStates } from "./tasty-states.js";
|
|
9
|
+
|
|
10
|
+
configureCookbookStates();
|
|
11
|
+
|
|
12
|
+
// These global rules bridge Cookbook tokens into markup owned by Astro,
|
|
13
|
+
// Starlight, Expressive Code, and Pagefind. Cookbook-owned components use
|
|
14
|
+
// tasty() wrappers; every style object remains visible to the Tasty linter.
|
|
15
|
+
export default function GlobalStyles() {
|
|
16
|
+
useGlobalStyles(":root", {
|
|
17
|
+
colorScheme: "dark",
|
|
18
|
+
"$sl-font": "$body-font-family",
|
|
19
|
+
"$sl-font-mono": "$code-font-family",
|
|
20
|
+
"$sl-line-height": "$body-line-height",
|
|
21
|
+
"$sl-line-height-headings": "$heading-line-height",
|
|
22
|
+
"$sl-text-body": "$body-font-size",
|
|
23
|
+
"$sl-text-body-sm": "$small-font-size",
|
|
24
|
+
"$sl-text-code": "$code-font-size",
|
|
25
|
+
"$sl-text-code-sm": "$small-font-size",
|
|
26
|
+
"$sl-text-h1": "$h1-font-size",
|
|
27
|
+
"$sl-text-h2": "$h2-font-size",
|
|
28
|
+
"$sl-text-h3": "$h3-font-size",
|
|
29
|
+
"$sl-text-h4": "$h4-font-size",
|
|
30
|
+
"$sl-text-h5": "$h5-font-size",
|
|
31
|
+
"$sl-content-width": "$content-width",
|
|
32
|
+
"$sl-sidebar-width": "$sidebar-width",
|
|
33
|
+
"$sl-color-white": "#text",
|
|
34
|
+
"$sl-color-gray-1": "#text",
|
|
35
|
+
"$sl-color-gray-2": "#text-soft",
|
|
36
|
+
"$sl-color-gray-3": "color-mix( in oklab, #text 66%, #surface )",
|
|
37
|
+
"$sl-color-gray-4": "#border-strong",
|
|
38
|
+
"$sl-color-gray-5": "#border",
|
|
39
|
+
"$sl-color-gray-6": "#surface-2",
|
|
40
|
+
"$sl-color-gray-7": "#surface-3",
|
|
41
|
+
"$sl-color-black": "#surface",
|
|
42
|
+
"$sl-color-text": "#text-soft",
|
|
43
|
+
"$sl-color-text-accent": "#accent-text",
|
|
44
|
+
"$sl-color-text-invert": "#accent-surface-text",
|
|
45
|
+
"$sl-color-bg": "#surface",
|
|
46
|
+
"$sl-color-bg-nav": "#surface",
|
|
47
|
+
"$sl-color-bg-sidebar": "#surface",
|
|
48
|
+
"$sl-color-bg-inline-code": "#surface-2",
|
|
49
|
+
"$sl-color-bg-accent": "#accent-surface",
|
|
50
|
+
"$sl-color-hairline-light": "#border",
|
|
51
|
+
"$sl-color-hairline": "#border",
|
|
52
|
+
"$sl-color-hairline-shade": "#border",
|
|
53
|
+
"$sl-color-backdrop-overlay": "#overlay",
|
|
54
|
+
"$sl-color-accent-low":
|
|
55
|
+
"color-mix( in oklab, #accent-surface 12%, #surface )",
|
|
56
|
+
"$sl-color-accent": "#accent-text",
|
|
57
|
+
"$sl-color-accent-high": "#accent-text",
|
|
58
|
+
"$sl-shadow-sm": "none",
|
|
59
|
+
"$sl-shadow-md": "0 0.5rem 1.5rem #shadow",
|
|
60
|
+
"$sl-shadow-lg": "0 1rem 3rem #shadow",
|
|
61
|
+
"$sl-nav-height": "4.5rem",
|
|
62
|
+
"$sl-nav-pad-x": "clamp(1.25rem, 2.5vw, 2rem)",
|
|
63
|
+
"$sl-sidebar-pad-x": "1.5rem",
|
|
64
|
+
"$sl-content-pad-x": "clamp(1.5rem, 4vw, 4rem)",
|
|
65
|
+
"$sl-main-pad": "0 0 5rem",
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
useGlobalStyles(":root:has(.td-top-tabs)", {
|
|
69
|
+
"$sl-nav-height": "7rem",
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
useGlobalStyles(':root[data-theme="light"]', {
|
|
73
|
+
colorScheme: "light",
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
useGlobalStyles(":root:not([data-theme])", {
|
|
77
|
+
colorScheme: {
|
|
78
|
+
"@media(prefers-color-scheme: light)": "light",
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
useGlobalStyles("html, body, button, input, select, textarea", {
|
|
83
|
+
fontFamily: "$body-font-family",
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
useGlobalStyles("body", {
|
|
87
|
+
color: "#text",
|
|
88
|
+
fill: "#surface",
|
|
89
|
+
fontSize: "$body-font-size",
|
|
90
|
+
fontWeight: "$body-font-weight",
|
|
91
|
+
lineHeight: "$body-line-height",
|
|
92
|
+
letterSpacing: "$body-letter-spacing",
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
useGlobalStyles(":where(h1, h2, h3, h4, h5, h6), .site-title", {
|
|
96
|
+
color: "#text",
|
|
97
|
+
fontFamily: "$heading-font-family",
|
|
98
|
+
fontWeight: "$heading-font-weight",
|
|
99
|
+
letterSpacing: "$heading-letter-spacing",
|
|
100
|
+
textWrap: "balance",
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
useGlobalStyles("h1", {
|
|
104
|
+
fontSize: "$h1-font-size",
|
|
105
|
+
lineHeight: "$h1-line-height",
|
|
106
|
+
letterSpacing: "$h1-letter-spacing",
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
useGlobalStyles("h2", {
|
|
110
|
+
fontSize: "$h2-font-size",
|
|
111
|
+
lineHeight: "$h2-line-height",
|
|
112
|
+
letterSpacing: "$h2-letter-spacing",
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
useGlobalStyles("h3", {
|
|
116
|
+
fontSize: "$h3-font-size",
|
|
117
|
+
lineHeight: "$h3-line-height",
|
|
118
|
+
letterSpacing: "$h3-letter-spacing",
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
useGlobalStyles("h4", {
|
|
122
|
+
fontSize: "$h4-font-size",
|
|
123
|
+
lineHeight: "$h4-line-height",
|
|
124
|
+
letterSpacing: "$h4-letter-spacing",
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
useGlobalStyles("h5", {
|
|
128
|
+
fontSize: "$h5-font-size",
|
|
129
|
+
lineHeight: "$h5-line-height",
|
|
130
|
+
letterSpacing: "$h5-letter-spacing",
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
useGlobalStyles("h6", {
|
|
134
|
+
fontSize: "$h6-font-size",
|
|
135
|
+
lineHeight: "$h6-line-height",
|
|
136
|
+
letterSpacing: "$h6-letter-spacing",
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
useGlobalStyles(":where(code, kbd, samp, pre)", {
|
|
140
|
+
fontFamily: "$code-font-family",
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
useGlobalStyles(
|
|
144
|
+
":where(a, button, input, select, textarea, summary):focus-visible",
|
|
145
|
+
{
|
|
146
|
+
outline: "$outline-width solid #focus",
|
|
147
|
+
outlineOffset: "$outline-offset",
|
|
148
|
+
},
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
useGlobalStyles(
|
|
152
|
+
":where(button, input, select, textarea):not(:where(.expressive-code *))",
|
|
153
|
+
{
|
|
154
|
+
minBlockSize: "$control-height",
|
|
155
|
+
radius: "$radius",
|
|
156
|
+
boxShadow: "none",
|
|
157
|
+
},
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
useGlobalStyles(".expressive-code", {
|
|
161
|
+
"$ec-brdRad": "calc($card-radius - $border-width)",
|
|
162
|
+
"$ec-brdWd": "$border-width",
|
|
163
|
+
"$ec-brdCol": "#border",
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
useGlobalStyles(".expressive-code .copy button", {
|
|
167
|
+
radius: "$radius",
|
|
168
|
+
fill: "#surface-3",
|
|
169
|
+
boxShadow: "none",
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
useGlobalStyles(".expressive-code .copy button::before", {
|
|
173
|
+
borderColor: "#border",
|
|
174
|
+
opacity: "1",
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
useGlobalStyles(".expressive-code .copy button div", {
|
|
178
|
+
hide: true,
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
useGlobalStyles(
|
|
182
|
+
".expressive-code .copy button:hover, .expressive-code .copy button:focus-visible",
|
|
183
|
+
{
|
|
184
|
+
fill: "#surface-3-hover",
|
|
185
|
+
},
|
|
186
|
+
);
|
|
187
|
+
|
|
188
|
+
useGlobalStyles(".expressive-code .copy button:active", {
|
|
189
|
+
fill: "#surface-3-pressed",
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
useGlobalStyles(
|
|
193
|
+
'site-search button[data-open-modal], site-search dialog, .pagination-links a, a[aria-current="page"]',
|
|
194
|
+
{ radius: "$radius" },
|
|
195
|
+
);
|
|
196
|
+
|
|
197
|
+
useGlobalStyles(
|
|
198
|
+
'#starlight__sidebar a[aria-current="page"], #starlight__sidebar a[aria-current="page"]:hover, #starlight__sidebar a[aria-current="page"]:focus',
|
|
199
|
+
{
|
|
200
|
+
color: "#accent-text",
|
|
201
|
+
fill: "color-mix( in oklab, #accent-surface 12%, #surface )",
|
|
202
|
+
},
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
useGlobalStyles(
|
|
206
|
+
"body > .page > .header, .sidebar-pane, .right-sidebar, .content-panel + .content-panel, mobile-starlight-toc :where(nav, summary)",
|
|
207
|
+
{
|
|
208
|
+
border: "0",
|
|
209
|
+
},
|
|
210
|
+
);
|
|
211
|
+
|
|
212
|
+
useGlobalStyles("body > .page > .header, .sidebar-pane", {
|
|
213
|
+
fill: "#surface",
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
useGlobalStyles("#starlight__sidebar .sidebar-content", {
|
|
217
|
+
gap: "($gap * 3)",
|
|
218
|
+
paddingBlockStart: "($gap * 4)",
|
|
219
|
+
paddingBlockEnd: "($gap * 6)",
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
useGlobalStyles("#starlight__sidebar .top-level > li + li", {
|
|
223
|
+
marginBlockStart: "($gap * 3)",
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
useGlobalStyles("#starlight__sidebar ul ul li", {
|
|
227
|
+
marginInlineStart: "($gap * 0.75)",
|
|
228
|
+
paddingInlineStart: "($gap * 0.75)",
|
|
229
|
+
borderInlineStart: "0",
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
useGlobalStyles("#starlight__sidebar :where(summary, a)", {
|
|
233
|
+
padding: "($gap * 0.8) ($gap * 1.25)",
|
|
234
|
+
lineHeight: "1.45",
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
useGlobalStyles("#starlight__sidebar a", {
|
|
238
|
+
fontSize: "0.9375rem",
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
useGlobalStyles("#starlight__sidebar .large", {
|
|
242
|
+
fontSize: "0.9375rem",
|
|
243
|
+
fontWeight: "$body-bold-font-weight",
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
useGlobalStyles(".right-sidebar-panel", {
|
|
247
|
+
paddingBlockStart: "($gap * 5)",
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
useGlobalStyles(".right-sidebar-panel h2", {
|
|
251
|
+
fontSize: "0.9375rem",
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
useGlobalStyles(".right-sidebar-panel a", {
|
|
255
|
+
paddingBlockStart: "($gap * 0.5)",
|
|
256
|
+
paddingBlockEnd: "($gap * 0.5)",
|
|
257
|
+
fontSize: "$small-font-size",
|
|
258
|
+
lineHeight: "1.45",
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
useGlobalStyles("main > .content-panel:first-of-type", {
|
|
262
|
+
paddingBlockStart: "($gap * 3)",
|
|
263
|
+
paddingBlockEnd: "($gap * 2)",
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
useGlobalStyles("main > .content-panel:nth-of-type(2)", {
|
|
267
|
+
paddingBlockStart: "($gap * 2)",
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
useGlobalStyles(".sl-markdown-content", {
|
|
271
|
+
fontSize: "1.025rem",
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
useGlobalStyles("site-search button[data-open-modal]", {
|
|
275
|
+
border: true,
|
|
276
|
+
fill: "#surface",
|
|
277
|
+
boxShadow: "none",
|
|
278
|
+
transition: "color 120ms ease, background-color 120ms ease",
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
useGlobalStyles("site-search button[data-open-modal]:hover", {
|
|
282
|
+
borderColor: "#border",
|
|
283
|
+
fill: "#surface-2-hover",
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
useGlobalStyles("site-search button[data-open-modal]:active", {
|
|
287
|
+
fill: "#surface-2-pressed",
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
useGlobalStyles(".pagination-links a", {
|
|
291
|
+
borderWidth: "$border-width",
|
|
292
|
+
borderColor: "#border",
|
|
293
|
+
fill: "#surface-2",
|
|
294
|
+
boxShadow: "none",
|
|
295
|
+
transition: "color 120ms ease, background-color 120ms ease",
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
useGlobalStyles(".pagination-links a:hover", {
|
|
299
|
+
borderColor: "#border",
|
|
300
|
+
fill: "#surface-2-hover",
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
useGlobalStyles(".pagination-links a:active", {
|
|
304
|
+
fill: "#surface-2-pressed",
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
useGlobalStyles("main .pagination-links", {
|
|
308
|
+
gridTemplateColumns: {
|
|
309
|
+
"": "repeat(2, minmax(0, 1fr))",
|
|
310
|
+
"@small": "1fr",
|
|
311
|
+
},
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
useGlobalStyles('main .pagination-links a[rel="next"]:first-child', {
|
|
315
|
+
gridColumn: {
|
|
316
|
+
"": "2",
|
|
317
|
+
"@small": "1",
|
|
318
|
+
},
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
useGlobalStyles(
|
|
322
|
+
"site-search button[data-open-modal] > svg, .pagination-links a > svg, mobile-starlight-toc .toggle > svg, #starlight__sidebar summary > svg.caret",
|
|
323
|
+
{
|
|
324
|
+
hide: true,
|
|
325
|
+
},
|
|
326
|
+
);
|
|
327
|
+
|
|
328
|
+
useGlobalStyles(
|
|
329
|
+
"site-search button[data-open-modal]::before, site-search button[data-close-modal]::before, .pagination-links a::before, mobile-starlight-toc .toggle::after, #starlight__sidebar summary::after",
|
|
330
|
+
{
|
|
331
|
+
content: '""',
|
|
332
|
+
display: "block",
|
|
333
|
+
flexGrow: "0",
|
|
334
|
+
flexShrink: "0",
|
|
335
|
+
flexBasis: "auto",
|
|
336
|
+
inlineSize: "1rem",
|
|
337
|
+
blockSize: "1rem",
|
|
338
|
+
fill: "#current",
|
|
339
|
+
},
|
|
340
|
+
);
|
|
341
|
+
|
|
342
|
+
useGlobalStyles("site-search button[data-open-modal]::before", {
|
|
343
|
+
mask: `url("${svgIconUrl(searchIcon)}") center / contain no-repeat`,
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
useGlobalStyles("site-search button[data-close-modal]::before", {
|
|
347
|
+
mask: `url("${svgIconUrl(closeIcon)}") center / contain no-repeat`,
|
|
348
|
+
});
|
|
349
|
+
|
|
350
|
+
useGlobalStyles(".pagination-links a::before", {
|
|
351
|
+
mask: `url("${svgIconUrl(arrowLeftIcon)}") center / contain no-repeat`,
|
|
352
|
+
inlineSize: "1.25rem",
|
|
353
|
+
blockSize: "1.25rem",
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
useGlobalStyles('.pagination-links a[rel="next"]::before', {
|
|
357
|
+
mask: `url("${svgIconUrl(arrowRightIcon)}") center / contain no-repeat`,
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
useGlobalStyles('[dir="rtl"] .pagination-links a[rel="prev"]::before', {
|
|
361
|
+
mask: `url("${svgIconUrl(arrowRightIcon)}") center / contain no-repeat`,
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
useGlobalStyles('[dir="rtl"] .pagination-links a[rel="next"]::before', {
|
|
365
|
+
mask: `url("${svgIconUrl(arrowLeftIcon)}") center / contain no-repeat`,
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
useGlobalStyles(
|
|
369
|
+
"mobile-starlight-toc .toggle::after, #starlight__sidebar summary::after",
|
|
370
|
+
{
|
|
371
|
+
mask: `url("${svgIconUrl(chevronRightIcon)}") center / contain no-repeat`,
|
|
372
|
+
transition: "rotate 120ms ease",
|
|
373
|
+
},
|
|
374
|
+
);
|
|
375
|
+
|
|
376
|
+
useGlobalStyles(
|
|
377
|
+
"mobile-starlight-toc details[open] .toggle::after, #starlight__sidebar details[open] > summary::after",
|
|
378
|
+
{
|
|
379
|
+
rotate: "90deg",
|
|
380
|
+
},
|
|
381
|
+
);
|
|
382
|
+
|
|
383
|
+
useGlobalStyles("site-search dialog", {
|
|
384
|
+
fill: "#surface",
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
useGlobalStyles("site-search button[data-close-modal]", {
|
|
388
|
+
gap: "0.375rem",
|
|
389
|
+
paddingInlineStart: "0.625rem",
|
|
390
|
+
paddingInlineEnd: "0.625rem",
|
|
391
|
+
color: "#text",
|
|
392
|
+
border: true,
|
|
393
|
+
radius: "$radius",
|
|
394
|
+
});
|
|
395
|
+
|
|
396
|
+
useGlobalStyles("#starlight__search", {
|
|
397
|
+
"$pagefind-ui-background": "#surface",
|
|
398
|
+
"$pagefind-ui-border": "#border",
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
useGlobalStyles("#starlight__search .pagefind-ui__search-input", {
|
|
402
|
+
borderColor: "#border",
|
|
403
|
+
fill: "#surface",
|
|
404
|
+
boxShadow: "none",
|
|
405
|
+
});
|
|
406
|
+
|
|
407
|
+
useGlobalStyles("#starlight__search .pagefind-ui__form::before", {
|
|
408
|
+
inlineSize: "1rem",
|
|
409
|
+
blockSize: "1rem",
|
|
410
|
+
mask: `url("${svgIconUrl(searchIcon)}") center / contain no-repeat`,
|
|
411
|
+
});
|
|
412
|
+
|
|
413
|
+
useGlobalStyles("#starlight__search .pagefind-ui__search-clear::before", {
|
|
414
|
+
mask: `url("${svgIconUrl(closeIcon)}") center / 1rem no-repeat`,
|
|
415
|
+
});
|
|
416
|
+
|
|
417
|
+
useGlobalStyles(
|
|
418
|
+
"starlight-menu-button button, mobile-starlight-toc .toggle",
|
|
419
|
+
{
|
|
420
|
+
color: "#text",
|
|
421
|
+
border: true,
|
|
422
|
+
radius: "$radius",
|
|
423
|
+
fill: "#surface-3",
|
|
424
|
+
transition: "color 120ms ease, background-color 120ms ease",
|
|
425
|
+
},
|
|
426
|
+
);
|
|
427
|
+
|
|
428
|
+
useGlobalStyles("starlight-menu-button button", {
|
|
429
|
+
alignItems: "center",
|
|
430
|
+
justifyContent: "center",
|
|
431
|
+
inlineSize: "$sl-menu-button-size",
|
|
432
|
+
blockSize: "$sl-menu-button-size",
|
|
433
|
+
minBlockSize: "0",
|
|
434
|
+
padding: "0",
|
|
435
|
+
color: "#text-soft",
|
|
436
|
+
boxShadow: "none",
|
|
437
|
+
});
|
|
438
|
+
|
|
439
|
+
useGlobalStyles("starlight-menu-button button > svg", {
|
|
440
|
+
inlineSize: "1.125rem",
|
|
441
|
+
blockSize: "1.125rem",
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
useGlobalStyles(
|
|
445
|
+
"starlight-menu-button button:hover, mobile-starlight-toc .toggle:hover, mobile-starlight-toc details[open] .toggle",
|
|
446
|
+
{
|
|
447
|
+
color: "#text",
|
|
448
|
+
borderColor: "#border",
|
|
449
|
+
fill: "#surface-3-hover",
|
|
450
|
+
},
|
|
451
|
+
);
|
|
452
|
+
|
|
453
|
+
useGlobalStyles(
|
|
454
|
+
'starlight-menu-button[aria-expanded="true"] button, starlight-menu-button[aria-expanded="true"] button:hover, starlight-menu-button button:active, mobile-starlight-toc .toggle:active',
|
|
455
|
+
{
|
|
456
|
+
color: "#text",
|
|
457
|
+
borderColor: "#border",
|
|
458
|
+
fill: "#surface-3-pressed",
|
|
459
|
+
boxShadow: "none",
|
|
460
|
+
},
|
|
461
|
+
);
|
|
462
|
+
|
|
463
|
+
useGlobalStyles("mobile-starlight-toc summary", {
|
|
464
|
+
position: "relative",
|
|
465
|
+
alignItems: "center",
|
|
466
|
+
gap: "$gap",
|
|
467
|
+
paddingInlineStart: "$sl-content-pad-x",
|
|
468
|
+
paddingInlineEnd: "$sl-content-pad-x",
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
useGlobalStyles(
|
|
472
|
+
"mobile-starlight-toc .toggle, mobile-starlight-toc .toggle:hover, mobile-starlight-toc details[open] .toggle, mobile-starlight-toc .toggle:active",
|
|
473
|
+
{
|
|
474
|
+
gap: "$gap",
|
|
475
|
+
margin: "0",
|
|
476
|
+
padding: "0",
|
|
477
|
+
color: "#text-soft",
|
|
478
|
+
fontSize: "$small-font-size",
|
|
479
|
+
fontWeight: "$body-bold-font-weight",
|
|
480
|
+
lineHeight: "$small-line-height",
|
|
481
|
+
border: "0",
|
|
482
|
+
radius: "0",
|
|
483
|
+
fill: "#clear",
|
|
484
|
+
boxShadow: "none",
|
|
485
|
+
},
|
|
486
|
+
);
|
|
487
|
+
|
|
488
|
+
useGlobalStyles(
|
|
489
|
+
"mobile-starlight-toc .toggle:hover, mobile-starlight-toc details[open] .toggle, mobile-starlight-toc .toggle:active",
|
|
490
|
+
{
|
|
491
|
+
color: "#text",
|
|
492
|
+
},
|
|
493
|
+
);
|
|
494
|
+
|
|
495
|
+
useGlobalStyles("mobile-starlight-toc summary .toggle", {
|
|
496
|
+
gap: "$gap",
|
|
497
|
+
margin: "0",
|
|
498
|
+
});
|
|
499
|
+
|
|
500
|
+
useGlobalStyles("mobile-starlight-toc .dropdown", {
|
|
501
|
+
position: "absolute",
|
|
502
|
+
inset: "100% top",
|
|
503
|
+
insetInlineStart: "$sl-content-pad-x",
|
|
504
|
+
zIndex: "1",
|
|
505
|
+
display: "block",
|
|
506
|
+
inlineSize: "min(22rem, (100% - ($sl-content-pad-x * 2)))",
|
|
507
|
+
maxBlockSize: "min(24rem, (100vh - ($sl-mobile-toc-height + ($gap * 4))))",
|
|
508
|
+
margin: "$gap 0 0",
|
|
509
|
+
padding: "4px",
|
|
510
|
+
overflow: "auto",
|
|
511
|
+
color: "#text",
|
|
512
|
+
border: true,
|
|
513
|
+
radius: "$card-radius",
|
|
514
|
+
fill: "#surface-2",
|
|
515
|
+
shadow: "0 0.75rem 2rem #shadow",
|
|
516
|
+
});
|
|
517
|
+
|
|
518
|
+
useGlobalStyles("mobile-starlight-toc .dropdown .isMobile", {
|
|
519
|
+
display: "grid",
|
|
520
|
+
gap: "1px",
|
|
521
|
+
});
|
|
522
|
+
|
|
523
|
+
useGlobalStyles("mobile-starlight-toc .dropdown .isMobile a", {
|
|
524
|
+
display: "flex",
|
|
525
|
+
alignItems: "center",
|
|
526
|
+
minBlockSize: "2.5rem",
|
|
527
|
+
padding: "0.625rem 0.75rem",
|
|
528
|
+
color: "#text-soft",
|
|
529
|
+
radius: "$radius",
|
|
530
|
+
fill: "#surface-2",
|
|
531
|
+
textDecoration: "none",
|
|
532
|
+
});
|
|
533
|
+
|
|
534
|
+
useGlobalStyles("mobile-starlight-toc .dropdown .isMobile a:hover", {
|
|
535
|
+
color: "#text",
|
|
536
|
+
fill: "#surface-2-hover",
|
|
537
|
+
});
|
|
538
|
+
|
|
539
|
+
useGlobalStyles(
|
|
540
|
+
'mobile-starlight-toc .dropdown .isMobile a[aria-current="true"]',
|
|
541
|
+
{
|
|
542
|
+
color: "#accent-text",
|
|
543
|
+
fill: "color-mix(in oklab, #accent-surface 12%, #surface-2)",
|
|
544
|
+
},
|
|
545
|
+
);
|
|
546
|
+
|
|
547
|
+
useGlobalStyles(
|
|
548
|
+
'mobile-starlight-toc .dropdown .isMobile a[aria-current="true"]::after',
|
|
549
|
+
{
|
|
550
|
+
blockSize: "1rem",
|
|
551
|
+
},
|
|
552
|
+
);
|
|
553
|
+
|
|
554
|
+
useGlobalStyles(
|
|
555
|
+
".sl-markdown-content :where(code):not(:where(.not-content *))",
|
|
556
|
+
{
|
|
557
|
+
radius: "($radius * 0.65)",
|
|
558
|
+
},
|
|
559
|
+
);
|
|
560
|
+
|
|
561
|
+
useGlobalStyles(".sl-markdown-content :where(table, blockquote, details)", {
|
|
562
|
+
borderColor: "#border",
|
|
563
|
+
});
|
|
564
|
+
|
|
565
|
+
useGlobalStyles(".sl-markdown-content table", {
|
|
566
|
+
inlineSize: "100%",
|
|
567
|
+
borderCollapse: "separate",
|
|
568
|
+
borderSpacing: "0",
|
|
569
|
+
overflow: "auto",
|
|
570
|
+
color: "#text-soft",
|
|
571
|
+
fontSize: "$small-font-size",
|
|
572
|
+
lineHeight: "$small-line-height",
|
|
573
|
+
border: true,
|
|
574
|
+
radius: "$card-radius",
|
|
575
|
+
scrollbarWidth: "thin",
|
|
576
|
+
});
|
|
577
|
+
|
|
578
|
+
useGlobalStyles(".sl-markdown-content :where(th, td)", {
|
|
579
|
+
padding: "($gap * 1.5) ($gap * 2)",
|
|
580
|
+
verticalAlign: "top",
|
|
581
|
+
borderColor: "#border",
|
|
582
|
+
});
|
|
583
|
+
|
|
584
|
+
useGlobalStyles(".sl-markdown-content :where(th, td):first-child", {
|
|
585
|
+
paddingInlineStart: "($gap * 2)",
|
|
586
|
+
});
|
|
587
|
+
|
|
588
|
+
useGlobalStyles(".sl-markdown-content :where(th, td):last-child", {
|
|
589
|
+
paddingInlineEnd: "($gap * 2)",
|
|
590
|
+
});
|
|
591
|
+
|
|
592
|
+
useGlobalStyles(".sl-markdown-content tbody tr:last-child td", {
|
|
593
|
+
borderBlockEnd: "0",
|
|
594
|
+
});
|
|
595
|
+
|
|
596
|
+
useGlobalStyles(".sl-markdown-content th", {
|
|
597
|
+
color: "#text",
|
|
598
|
+
fill: "#surface-2",
|
|
599
|
+
});
|
|
600
|
+
|
|
601
|
+
useGlobalStyles(":root, :root:has(.td-top-tabs)", {
|
|
602
|
+
"$sl-nav-height": {
|
|
603
|
+
"@mobile": "3.5rem",
|
|
604
|
+
},
|
|
605
|
+
"$sl-nav-pad-x": {
|
|
606
|
+
"@mobile": "1rem",
|
|
607
|
+
},
|
|
608
|
+
"$sl-nav-gap": {
|
|
609
|
+
"@mobile": "0.5rem",
|
|
610
|
+
},
|
|
611
|
+
"$sl-menu-button-size": {
|
|
612
|
+
"@mobile": "2.25rem",
|
|
613
|
+
},
|
|
614
|
+
});
|
|
615
|
+
|
|
616
|
+
useGlobalStyles(
|
|
617
|
+
"site-search button[data-open-modal], site-search button[data-open-modal]",
|
|
618
|
+
{
|
|
619
|
+
justifyContent: {
|
|
620
|
+
"@mobile": "center",
|
|
621
|
+
},
|
|
622
|
+
inlineSize: {
|
|
623
|
+
"@mobile": "$sl-menu-button-size",
|
|
624
|
+
},
|
|
625
|
+
blockSize: {
|
|
626
|
+
"@mobile": "$sl-menu-button-size",
|
|
627
|
+
},
|
|
628
|
+
minBlockSize: {
|
|
629
|
+
"@mobile": "0",
|
|
630
|
+
},
|
|
631
|
+
padding: {
|
|
632
|
+
"@mobile": "0",
|
|
633
|
+
},
|
|
634
|
+
color: {
|
|
635
|
+
"@mobile": "#text-soft",
|
|
636
|
+
},
|
|
637
|
+
fill: {
|
|
638
|
+
"@mobile": "#surface-3",
|
|
639
|
+
},
|
|
640
|
+
},
|
|
641
|
+
);
|
|
642
|
+
|
|
643
|
+
useGlobalStyles(
|
|
644
|
+
"site-search button[data-open-modal]:hover, site-search button[data-open-modal]:hover",
|
|
645
|
+
{
|
|
646
|
+
color: {
|
|
647
|
+
"@mobile": "#text",
|
|
648
|
+
},
|
|
649
|
+
fill: {
|
|
650
|
+
"@mobile": "#surface-3-hover",
|
|
651
|
+
},
|
|
652
|
+
},
|
|
653
|
+
);
|
|
654
|
+
|
|
655
|
+
useGlobalStyles(
|
|
656
|
+
"site-search button[data-open-modal]:active, site-search button[data-open-modal]:active",
|
|
657
|
+
{
|
|
658
|
+
color: {
|
|
659
|
+
"@mobile": "#text",
|
|
660
|
+
},
|
|
661
|
+
fill: {
|
|
662
|
+
"@mobile": "#surface-3-pressed",
|
|
663
|
+
},
|
|
664
|
+
},
|
|
665
|
+
);
|
|
666
|
+
|
|
667
|
+
useGlobalStyles("site-search button[data-open-modal]::before", {
|
|
668
|
+
inlineSize: {
|
|
669
|
+
"@mobile": "1.125rem",
|
|
670
|
+
},
|
|
671
|
+
blockSize: {
|
|
672
|
+
"@mobile": "1.125rem",
|
|
673
|
+
},
|
|
674
|
+
});
|
|
675
|
+
|
|
676
|
+
useGlobalStyles(":root[data-has-toc]", {
|
|
677
|
+
"$sl-mobile-toc-height": {
|
|
678
|
+
"@narrow-layout": "2.5rem",
|
|
679
|
+
},
|
|
680
|
+
});
|
|
681
|
+
|
|
682
|
+
useGlobalStyles("mobile-starlight-toc nav", {
|
|
683
|
+
borderBlockEnd: {
|
|
684
|
+
"@narrow-layout": "$border-width solid #border",
|
|
685
|
+
},
|
|
686
|
+
});
|
|
687
|
+
|
|
688
|
+
useGlobalStyles(
|
|
689
|
+
"mobile-starlight-toc summary, mobile-starlight-toc summary",
|
|
690
|
+
{
|
|
691
|
+
blockSize: {
|
|
692
|
+
"@narrow-layout": "2.5rem",
|
|
693
|
+
},
|
|
694
|
+
},
|
|
695
|
+
);
|
|
696
|
+
|
|
697
|
+
useGlobalStyles(":root[data-has-toc] main > .content-panel:first-of-type", {
|
|
698
|
+
paddingBlockStart: {
|
|
699
|
+
"@narrow-layout": "0",
|
|
700
|
+
},
|
|
701
|
+
});
|
|
702
|
+
|
|
703
|
+
useGlobalStyles(":root[data-has-toc], :root[data-has-toc]", {
|
|
704
|
+
"$sl-mobile-toc-height": {
|
|
705
|
+
"@medium-layout": "calc(2.5rem + ($gap * 3))",
|
|
706
|
+
},
|
|
707
|
+
});
|
|
708
|
+
|
|
709
|
+
useGlobalStyles("mobile-starlight-toc nav, mobile-starlight-toc nav", {
|
|
710
|
+
paddingBlockStart: {
|
|
711
|
+
"@medium-layout": "($gap * 3)",
|
|
712
|
+
},
|
|
713
|
+
borderBlockEnd: {
|
|
714
|
+
"@medium-layout": "0",
|
|
715
|
+
},
|
|
716
|
+
});
|
|
717
|
+
|
|
718
|
+
useGlobalStyles(":root:has(.td-top-tabs) body > .page > .header", {
|
|
719
|
+
paddingBlockStart: {
|
|
720
|
+
"@desktop": "0",
|
|
721
|
+
},
|
|
722
|
+
paddingBlockEnd: {
|
|
723
|
+
"@desktop": "0",
|
|
724
|
+
},
|
|
725
|
+
});
|
|
726
|
+
|
|
727
|
+
useGlobalStyles("body > .page > .header", {
|
|
728
|
+
borderBottom: {
|
|
729
|
+
"@desktop": "$border-width solid #border",
|
|
730
|
+
},
|
|
731
|
+
});
|
|
732
|
+
|
|
733
|
+
useGlobalStyles(".main-frame", {
|
|
734
|
+
inlineSize: {
|
|
735
|
+
"@desktop": "min(100%, $layout-width)",
|
|
736
|
+
},
|
|
737
|
+
marginInlineStart: {
|
|
738
|
+
"@desktop": "auto",
|
|
739
|
+
},
|
|
740
|
+
marginInlineEnd: {
|
|
741
|
+
"@desktop": "auto",
|
|
742
|
+
},
|
|
743
|
+
});
|
|
744
|
+
|
|
745
|
+
useGlobalStyles(".sidebar-pane", {
|
|
746
|
+
insetInlineStart: {
|
|
747
|
+
"@desktop": "max(0px, calc((100% - $layout-width) / 2))",
|
|
748
|
+
},
|
|
749
|
+
});
|
|
750
|
+
|
|
751
|
+
useGlobalStyles("*, *::before, *::after", {
|
|
752
|
+
scrollBehavior: {
|
|
753
|
+
"@reduced-motion": "auto",
|
|
754
|
+
},
|
|
755
|
+
transitionDuration: {
|
|
756
|
+
"@reduced-motion": "0.01ms",
|
|
757
|
+
},
|
|
758
|
+
});
|
|
759
|
+
|
|
760
|
+
return null;
|
|
761
|
+
}
|