@dontfeedmachines/fieldkit 0.0.0-stage → 0.4.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.
Files changed (50) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/LICENSE +203 -0
  3. package/NOTICE +131 -0
  4. package/README.md +12 -2
  5. package/css/base.css +150 -0
  6. package/package.json +43 -3
  7. package/pouches/sutures/astro/AnsiLogo.astro +51 -0
  8. package/pouches/sutures/astro/Barcode.astro +19 -0
  9. package/pouches/sutures/astro/BomTable.astro +44 -0
  10. package/pouches/sutures/astro/Breadcrumb.astro +56 -0
  11. package/pouches/sutures/astro/BuildStep.astro +42 -0
  12. package/pouches/sutures/astro/BuildSteps.astro +63 -0
  13. package/pouches/sutures/astro/Button.astro +5 -0
  14. package/pouches/sutures/astro/CTA.astro +58 -0
  15. package/pouches/sutures/astro/Difficulty.astro +27 -0
  16. package/pouches/sutures/astro/Footer.astro +80 -0
  17. package/pouches/sutures/astro/Glossary.astro +64 -0
  18. package/pouches/sutures/astro/Grid.astro +54 -0
  19. package/pouches/sutures/astro/Header.astro +270 -0
  20. package/pouches/sutures/astro/Hero.astro +38 -0
  21. package/pouches/sutures/astro/ImageMod.astro +66 -0
  22. package/pouches/sutures/astro/InteractiveCircuit.astro +192 -0
  23. package/pouches/sutures/astro/LegalWarning.astro +18 -0
  24. package/pouches/sutures/astro/MobileMenuToggle.astro +105 -0
  25. package/pouches/sutures/astro/PageFrame.astro +166 -0
  26. package/pouches/sutures/astro/Search.astro +541 -0
  27. package/pouches/sutures/astro/Section.astro +14 -0
  28. package/pouches/sutures/astro/SidebarNav.astro +106 -0
  29. package/pouches/sutures/astro/SidebarRestorePoint.astro +10 -0
  30. package/pouches/sutures/astro/SidebarSublist.astro +257 -0
  31. package/pouches/sutures/astro/SiteTitle.astro +65 -0
  32. package/pouches/sutures/astro/SpecTable.astro +64 -0
  33. package/pouches/sutures/astro/TeletextChar.astro +51 -0
  34. package/pouches/sutures/astro/ThemeSwitch.astro +93 -0
  35. package/pouches/sutures/astro/ThreatLevel.astro +77 -0
  36. package/pouches/sutures/astro/ThreatModel.astro +32 -0
  37. package/pouches/sutures/astro/TwoColumnContent.astro +84 -0
  38. package/pouches/sutures/astro/Win.astro +13 -0
  39. package/pouches/sutures/astro/index.ts +21 -0
  40. package/src/elements.ts +404 -0
  41. package/src/lib/scrapeview.ts +61 -0
  42. package/src/lib/seal.ts +157 -0
  43. package/src/lib/teletext-chars.ts +723 -0
  44. package/src/node/astro.ts +121 -0
  45. package/src/node/registry.ts +221 -0
  46. package/src/node/seal.ts +7 -0
  47. package/src/wiki/ansi.ts +15 -0
  48. package/src/wiki/config.ts +5 -0
  49. package/src/wiki/teletext.ts +21 -0
  50. package/src/wiki/textConverter.ts +16 -0
@@ -0,0 +1,166 @@
1
+ ---
2
+ import MobileMenuToggle from "./MobileMenuToggle.astro";
3
+ import Footer from "./Footer.astro";
4
+ import CTA from "./CTA.astro";
5
+ import SidebarNav from "./SidebarNav.astro";
6
+
7
+ const { hasSidebar } = Astro.locals.starlightRoute;
8
+ ---
9
+
10
+ <div class="page sl-flex">
11
+ <header class={"header" + (hasSidebar ? " has-sidebar" : " no-sidebar")}>
12
+ <slot name="header" />
13
+ </header>
14
+ {hasSidebar && <SidebarNav />}
15
+ <div class="main-frame">
16
+ <div class="container flex relative">
17
+ {
18
+ hasSidebar && (
19
+ <nav
20
+ class="sidebar print:hidden"
21
+ aria-label={Astro.locals.t("sidebarNav.accessibleLabel")}
22
+ >
23
+ <MobileMenuToggle />
24
+
25
+ <div id="starlight__sidebar" class="sidebar-pane">
26
+ <div class="sidebar-content sl-flex">
27
+ <slot name="sidebar" />
28
+ </div>
29
+ </div>
30
+ </nav>
31
+ )
32
+ }
33
+ <slot />
34
+ </div>
35
+ </div>
36
+ {!hasSidebar && <CTA />}
37
+ {!hasSidebar && <Footer />}
38
+ </div>
39
+
40
+ <style>
41
+ @layer starlight.core {
42
+ .page {
43
+ flex-direction: column;
44
+ min-height: 100vh;
45
+ }
46
+ .header {
47
+ z-index: var(--sl-z-index-navbar);
48
+ position: sticky;
49
+ inset-inline-start: 0;
50
+ inset-block-start: 0;
51
+ width: 100%;
52
+ border-bottom: 1px solid
53
+ color-mix(in srgb, var(--sl-color-white) 10%, transparent);
54
+ padding: var(--sl-nav-pad-y) 0px;
55
+ }
56
+ .sidebar {
57
+ opacity: 0;
58
+ transition: all 0.3s ease-in-out;
59
+ }
60
+ .sidebar button:where(.astro-jif73yzw) {
61
+ top: 14px !important;
62
+ }
63
+ footer {
64
+ display: none;
65
+ }
66
+ @media (max-width: 800px) {
67
+ .header {
68
+ background-color: var(--sl-color-black);
69
+ padding: 6px var(--sl-nav-pad-x);
70
+ }
71
+ }
72
+
73
+ :global([data-has-sidebar]) .main-frame {
74
+ padding-top: 2rem;
75
+ }
76
+ @media (max-width: 1156px) {
77
+ :global([data-has-sidebar]) .main-frame {
78
+ padding-top: 4rem;
79
+ }
80
+ }
81
+
82
+ .sidebar-pane {
83
+ visibility: var(--sl-sidebar-visibility, hidden);
84
+ position: sticky;
85
+ height: 80vh;
86
+ z-index: var(--sl-z-index-menu);
87
+ scrollbar-width: none;
88
+ background-color: var(--sl-color-black);
89
+ overflow-y: scroll;
90
+ inset-inline-start: 0;
91
+ width: 100%;
92
+ padding-bottom: 2rem;
93
+ }
94
+ @media (max-width: 1024px) {
95
+ .sidebar-pane {
96
+ inset-block: var(--sl-nav-height);
97
+ }
98
+ }
99
+ @media (max-width: 799px) {
100
+ .sidebar-pane {
101
+ position: fixed;
102
+ padding: 0 2rem;
103
+ height: 100vh;
104
+ }
105
+ }
106
+
107
+ :global([aria-expanded="true"]) ~ .sidebar-pane {
108
+ --sl-sidebar-visibility: visible;
109
+ }
110
+ .sidebar-content {
111
+ height: 100%;
112
+ min-height: max-content;
113
+ padding: 1rem var(--sl-sidebar-pad-x) 0;
114
+ flex-direction: column;
115
+ gap: 1rem;
116
+ padding-top: 0px;
117
+ padding-left: 0px;
118
+ content: "";
119
+ padding-bottom: 1px;
120
+ }
121
+
122
+ @media (min-width: 50rem) {
123
+ .sidebar-pane {
124
+ --sl-sidebar-visibility: visible;
125
+ width: var(--sl-sidebar-width);
126
+ background-color: transparent;
127
+ inset-block: calc(var(--sl-nav-height) + 110px) 0;
128
+
129
+ }
130
+ }
131
+ }
132
+ </style>
133
+
134
+ <script>
135
+ const sidebar = document.querySelector(".sidebar") as HTMLElement;
136
+
137
+ function initializeSidebar(): void {
138
+ if (sidebar) {
139
+ sidebar.style.opacity = "1";
140
+ }
141
+ }
142
+
143
+ // reveal sidebar once DOM is ready to avoid unstyled layout flash
144
+ if (document.readyState === "loading") {
145
+ document.addEventListener("DOMContentLoaded", initializeSidebar);
146
+ } else {
147
+ initializeSidebar();
148
+ }
149
+
150
+ // accordion
151
+ const accordions = document.querySelectorAll(
152
+ ".accordion"
153
+ ) as NodeListOf<HTMLElement>;
154
+
155
+ accordions.forEach((accordion) => {
156
+ // close other accordions when one is opened
157
+ accordion.addEventListener("click", () => {
158
+ accordions.forEach((otherAccordion) => {
159
+ if (otherAccordion !== accordion) {
160
+ otherAccordion.classList.remove("active");
161
+ }
162
+ });
163
+ accordion.classList.toggle("active");
164
+ });
165
+ });
166
+ </script>
@@ -0,0 +1,541 @@
1
+ ---
2
+ import { Icon } from "@astrojs/starlight/components";
3
+ import project from "@astrojs/starlight";
4
+
5
+ const pagefindTranslations = {
6
+ placeholder: Astro.locals.t("search.label"),
7
+ ...Object.fromEntries(
8
+ Object.entries(Astro.locals.t.all())
9
+ .filter(([key]) => key.startsWith("pagefind."))
10
+ .map(([key, value]) => [key.replace("pagefind.", ""), value])
11
+ ),
12
+ };
13
+
14
+ const dataAttributes: DOMStringMap = {
15
+ "data-translations": JSON.stringify(pagefindTranslations),
16
+ };
17
+
18
+ // @ts-ignore: starlight trailingSlash
19
+ if ((project as any)?.trailingSlash === "never")
20
+ dataAttributes["data-strip-trailing-slash"] = "";
21
+ ---
22
+
23
+ <site-search class={Astro.props.class} {...dataAttributes}>
24
+ <button
25
+ data-open-modal
26
+ disabled
27
+ aria-label={Astro.locals.t("search.label")}
28
+ aria-keyshortcuts="Control+K /"
29
+ >
30
+ <Icon name="magnifier" size="1.3rem" />
31
+ <span class="sl-block" aria-hidden="true"
32
+ >{Astro.locals.t("search.label")}</span
33
+ >
34
+ <kbd class="sl-flex">
35
+ <kbd>{Astro.locals.t("search.ctrlKey")}</kbd><kbd>K</kbd>
36
+ </kbd>
37
+ </button>
38
+
39
+ <dialog style="padding:0" aria-label={Astro.locals.t("search.label")}>
40
+ <div class="dialog-frame sl-flex">
41
+ <button data-close-modal class="sl-flex md:sl-hidden">
42
+ {Astro.locals.t("search.cancelLabel")}
43
+ </button>
44
+ {
45
+ import.meta.env.DEV ? (
46
+ <div
47
+ style="margin: auto; text-align: center; white-space: pre-line;"
48
+ dir="ltr"
49
+ >
50
+ <p>{Astro.locals.t("search.devWarning")}</p>
51
+ </div>
52
+ ) : (
53
+ <div class="search-container">
54
+ <div id="starlight__search" />
55
+ </div>
56
+ )
57
+ }
58
+ </div>
59
+ </dialog>
60
+ </site-search>
61
+
62
+ <script is:inline>
63
+ // inlined to prevent flash of wrong shortcut key
64
+ (() => {
65
+ const openBtn = document.querySelector("button[data-open-modal]");
66
+ const shortcut = openBtn?.querySelector("kbd");
67
+ if (!openBtn || !(shortcut instanceof HTMLElement)) return;
68
+ const platformKey = shortcut.querySelector("kbd");
69
+ if (platformKey && /(Mac|iPhone|iPod|iPad)/i.test(navigator.userAgentData?.platform ?? navigator.userAgent)) {
70
+ platformKey.textContent = "⌘";
71
+ openBtn.setAttribute("aria-keyshortcuts", "Meta+K");
72
+ }
73
+
74
+ shortcut.style.display = "";
75
+ })();
76
+ </script>
77
+
78
+ <script>
79
+ // @ts-ignore: virtual module
80
+ import { pagefindUserConfig } from "virtual:starlight/pagefind-config";
81
+
82
+ class SiteSearch extends HTMLElement {
83
+ constructor() {
84
+ super();
85
+ const openBtn = this.querySelector<HTMLButtonElement>(
86
+ "button[data-open-modal]"
87
+ )!;
88
+ const closeBtn = this.querySelector<HTMLButtonElement>(
89
+ "button[data-close-modal]"
90
+ )!;
91
+ const dialog = this.querySelector("dialog")!;
92
+ const dialogFrame = this.querySelector(".dialog-frame")!;
93
+
94
+ const onClick = (event: MouseEvent) => {
95
+ const isLink = "href" in (event.target || {});
96
+ if (
97
+ isLink ||
98
+ (document.body.contains(event.target as Node) &&
99
+ !dialogFrame.contains(event.target as Node))
100
+ ) {
101
+ closeModal();
102
+ }
103
+ };
104
+
105
+ const openModal = (event?: MouseEvent) => {
106
+ dialog.showModal();
107
+ document.body.toggleAttribute("data-search-modal-open", true);
108
+ this.querySelector("input")?.focus();
109
+ event?.stopPropagation();
110
+ window.addEventListener("click", onClick);
111
+ };
112
+
113
+ const closeModal = () => dialog.close();
114
+
115
+ openBtn.addEventListener("click", openModal);
116
+ openBtn.disabled = false;
117
+ closeBtn.addEventListener("click", closeModal);
118
+
119
+ dialog.addEventListener("close", () => {
120
+ document.body.toggleAttribute("data-search-modal-open", false);
121
+ window.removeEventListener("click", onClick);
122
+ });
123
+
124
+ window.addEventListener("keydown", (e) => {
125
+ if ((e.metaKey === true || e.ctrlKey === true) && e.key === "k") {
126
+ dialog.open ? closeModal() : openModal();
127
+ e.preventDefault();
128
+ return;
129
+ }
130
+ const t = e.target as HTMLElement;
131
+ const typing = t.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName);
132
+ if (e.key === "/" && !typing && !dialog.open && !e.metaKey && !e.ctrlKey && !e.altKey) {
133
+ openModal();
134
+ e.preventDefault();
135
+ }
136
+ });
137
+
138
+ let translations = {};
139
+ try {
140
+ translations = JSON.parse(this.dataset.translations || "{}");
141
+ } catch {}
142
+
143
+ const shouldStrip = this.dataset.stripTrailingSlash !== undefined;
144
+ const stripTrailingSlash = (path: string) =>
145
+ path.replace(/(.)\/(#.*)?$/, "$1$2");
146
+ const formatURL = shouldStrip
147
+ ? stripTrailingSlash
148
+ : (path: string) => path;
149
+
150
+ window.addEventListener("DOMContentLoaded", () => {
151
+ if (import.meta.env.DEV) return;
152
+ const onIdle =
153
+ window.requestIdleCallback || ((cb) => setTimeout(cb, 1));
154
+ onIdle(async () => {
155
+ // @ts-expect-error: pagefind default-ui package does not ship typescript declarations
156
+ const { PagefindUI } = await import("@pagefind/default-ui");
157
+ new PagefindUI({
158
+ ...pagefindUserConfig,
159
+ element: "#starlight__search",
160
+ baseUrl: import.meta.env.BASE_URL,
161
+ bundlePath:
162
+ import.meta.env.BASE_URL.replace(/\/$/, "") + "/pagefind/",
163
+ showImages: false,
164
+ translations,
165
+ showSubResults: true,
166
+ processResult: (result: {
167
+ url: string;
168
+ sub_results: Array<{ url: string }>;
169
+ }) => {
170
+ result.url = formatURL(result.url);
171
+ result.sub_results = result.sub_results.map((sub_result) => {
172
+ sub_result.url = formatURL(sub_result.url);
173
+ return sub_result;
174
+ });
175
+ },
176
+ });
177
+ });
178
+ });
179
+ }
180
+ }
181
+ customElements.define("site-search", SiteSearch);
182
+ </script>
183
+
184
+ <style>
185
+ @layer starlight.core {
186
+ site-search {
187
+ display: contents;
188
+ }
189
+ button[data-open-modal] {
190
+ display: flex;
191
+ align-items: center;
192
+ gap: 0.5rem;
193
+ background-color: color-mix(
194
+ in srgb,
195
+ var(--sl-color-white) 7%,
196
+ transparent
197
+ );
198
+ border: 1px solid
199
+ color-mix(in srgb, var(--sl-color-white) 10%, transparent);
200
+ border-radius: 0.5rem;
201
+ padding-inline-start: 1rem;
202
+ padding-inline-end: 0.8rem;
203
+ cursor: pointer;
204
+ height: 3rem;
205
+ font-size: var(--sl-text-sm);
206
+ width: 100%;
207
+ }
208
+ button[data-open-modal] kbd {
209
+ margin-inline-start: auto;
210
+ }
211
+
212
+ @media (min-width: 50rem) {
213
+ button[data-open-modal] {
214
+ color: var(--sl-color-gray-2);
215
+ font-size: var(--sl-text-sm);
216
+ width: 100%;
217
+ max-width: 100%;
218
+ }
219
+ button[data-open-modal]:hover {
220
+ border-color: var(--sl-color-gray-2);
221
+ color: var(--sl-color-white);
222
+ }
223
+
224
+ button[data-open-modal] > :last-child {
225
+ margin-inline-start: auto;
226
+ }
227
+ }
228
+
229
+ button > kbd {
230
+ border-radius: 0.25rem;
231
+ font-size: var(--sl-text-sm);
232
+ padding-inline: 0.375rem;
233
+ background-color: var(--sl-color-gray-6);
234
+ }
235
+
236
+ kbd {
237
+ font-family: var(--__sl-font);
238
+ }
239
+
240
+ dialog {
241
+ margin: 0;
242
+ background-color: var(--sl-color-gray-6);
243
+ border: 1px solid var(--sl-color-gray-5);
244
+ width: 100%;
245
+ max-width: 100%;
246
+ height: 100%;
247
+ max-height: 100%;
248
+ box-shadow: var(--sl-shadow-lg);
249
+ }
250
+ dialog[open] {
251
+ display: flex;
252
+ }
253
+
254
+ dialog::backdrop {
255
+ background-color: var(--sl-color-backdrop-overlay);
256
+ -webkit-backdrop-filter: blur(0.25rem);
257
+ backdrop-filter: blur(0.25rem);
258
+ }
259
+
260
+ .dialog-frame {
261
+ position: relative;
262
+ overflow: auto;
263
+ flex-direction: column;
264
+ flex-grow: 1;
265
+ gap: 1rem;
266
+ padding: 1rem;
267
+ }
268
+
269
+ button[data-close-modal] {
270
+ position: absolute;
271
+ z-index: 1;
272
+ align-items: center;
273
+ align-self: flex-end;
274
+ height: calc(64px * var(--pagefind-ui-scale));
275
+ padding: 0.25rem;
276
+ border: 0;
277
+ background: transparent;
278
+ cursor: pointer;
279
+ color: var(--sl-color-text-accent);
280
+ }
281
+
282
+ #starlight__search {
283
+ --pagefind-ui-primary: var(--sl-color-text);
284
+ --pagefind-ui-text: var(--sl-color-gray-2);
285
+ --pagefind-ui-font: var(--__sl-font);
286
+ --pagefind-ui-background: var(--sl-color-black);
287
+ --pagefind-ui-border: var(--sl-color-gray-5);
288
+ --pagefind-ui-border-width: 1px;
289
+ --pagefind-ui-tag: var(--sl-color-gray-5);
290
+ --sl-search-cancel-space: 5rem;
291
+ }
292
+
293
+ :root[data-theme="light"] #starlight__search {
294
+ --pagefind-ui-tag: var(--sl-color-gray-6);
295
+ }
296
+
297
+ @media (min-width: 50rem) {
298
+ #starlight__search {
299
+ --sl-search-cancel-space: 0px;
300
+ }
301
+
302
+ dialog {
303
+ margin: 4rem auto auto;
304
+ border-radius: 0.5rem;
305
+ width: 90%;
306
+ max-width: 40rem;
307
+ height: max-content;
308
+ min-height: 15rem;
309
+ max-height: calc(100% - 8rem);
310
+ }
311
+
312
+ .dialog-frame {
313
+ padding: 1.5rem;
314
+ }
315
+ }
316
+ }
317
+ </style>
318
+
319
+ <style is:global>
320
+ @import url("@pagefind/default-ui/css/ui.css") layer(starlight.core);
321
+
322
+ @layer starlight.core {
323
+ [data-search-modal-open] {
324
+ overflow: hidden;
325
+ }
326
+
327
+ #starlight__search {
328
+ --sl-search-result-spacing: calc(1.25rem * var(--pagefind-ui-scale));
329
+ --sl-search-result-pad-inline-start: calc(
330
+ 3.75rem * var(--pagefind-ui-scale)
331
+ );
332
+ --sl-search-result-pad-inline-end: calc(
333
+ 1.25rem * var(--pagefind-ui-scale)
334
+ );
335
+ --sl-search-result-pad-block: calc(0.9375rem * var(--pagefind-ui-scale));
336
+ --sl-search-result-nested-pad-block: calc(
337
+ 0.625rem * var(--pagefind-ui-scale)
338
+ );
339
+ --sl-search-corners: calc(0.3125rem * var(--pagefind-ui-scale));
340
+ --sl-search-page-icon-size: calc(1.875rem * var(--pagefind-ui-scale));
341
+ --sl-search-page-icon-inline-start: calc(
342
+ (
343
+ var(--sl-search-result-pad-inline-start) -
344
+ var(--sl-search-page-icon-size)
345
+ ) / 2
346
+ );
347
+ --sl-search-tree-diagram-size: calc(2.5rem * var(--pagefind-ui-scale));
348
+ --sl-search-tree-diagram-inline-start: calc(
349
+ (
350
+ var(--sl-search-result-pad-inline-start) -
351
+ var(--sl-search-tree-diagram-size)
352
+ ) / 2
353
+ );
354
+ }
355
+
356
+ #starlight__search .pagefind-ui__form::before {
357
+ --pagefind-ui-text: var(--sl-color-gray-1);
358
+ opacity: 1;
359
+ }
360
+
361
+ #starlight__search .pagefind-ui__search-input {
362
+ color: var(--sl-color-white);
363
+ font-weight: 400;
364
+ width: calc(100% - var(--sl-search-cancel-space));
365
+ }
366
+
367
+ #starlight__search input:focus {
368
+ --pagefind-ui-border: var(--sl-color-accent);
369
+ }
370
+
371
+ #starlight__search .pagefind-ui__search-clear {
372
+ inset-inline-end: var(--sl-search-cancel-space);
373
+ width: calc(60px * var(--pagefind-ui-scale));
374
+ padding: 0;
375
+ background-color: transparent;
376
+ overflow: hidden;
377
+ }
378
+ #starlight__search .pagefind-ui__search-clear:focus {
379
+ outline: 1px solid var(--sl-color-accent);
380
+ }
381
+ #starlight__search .pagefind-ui__search-clear::before {
382
+ content: "";
383
+ -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m13.41 12 6.3-6.29a1 1 0 1 0-1.42-1.42L12 10.59l-6.29-6.3a1 1 0 0 0-1.42 1.42l6.3 6.29-6.3 6.29a1 1 0 0 0 .33 1.64 1 1 0 0 0 1.09-.22l6.29-6.3 6.29 6.3a1 1 0 0 0 1.64-.33 1 1 0 0 0-.22-1.09L13.41 12Z'/%3E%3C/svg%3E")
384
+ center / 50% no-repeat;
385
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m13.41 12 6.3-6.29a1 1 0 1 0-1.42-1.42L12 10.59l-6.29-6.3a1 1 0 0 0-1.42 1.42l6.3 6.29-6.3 6.29a1 1 0 0 0 .33 1.64 1 1 0 0 0 1.09-.22l6.29-6.3 6.29 6.3a1 1 0 0 0 1.64-.33 1 1 0 0 0-.22-1.09L13.41 12Z'/%3E%3C/svg%3E")
386
+ center / 50% no-repeat;
387
+ background-color: var(--sl-color-text-accent);
388
+ display: block;
389
+ width: 100%;
390
+ height: 100%;
391
+ }
392
+
393
+ #starlight__search .pagefind-ui__results > * + * {
394
+ margin-top: var(--sl-search-result-spacing);
395
+ }
396
+ #starlight__search .pagefind-ui__result {
397
+ border: 0;
398
+ padding: 0;
399
+ }
400
+
401
+ #starlight__search .pagefind-ui__result-nested {
402
+ position: relative;
403
+ padding: var(--sl-search-result-nested-pad-block)
404
+ var(--sl-search-result-pad-inline-end);
405
+ padding-inline-start: var(--sl-search-result-pad-inline-start);
406
+ }
407
+
408
+ #starlight__search
409
+ .pagefind-ui__result-title:not(:where(.pagefind-ui__result-nested *)),
410
+ #starlight__search .pagefind-ui__result-nested {
411
+ position: relative;
412
+ background-color: var(--sl-color-black);
413
+ }
414
+
415
+ #starlight__search
416
+ .pagefind-ui__result-title:not(
417
+ :where(.pagefind-ui__result-nested *)
418
+ ):hover,
419
+ #starlight__search
420
+ .pagefind-ui__result-title:not(
421
+ :where(.pagefind-ui__result-nested *)
422
+ ):focus-within,
423
+ #starlight__search .pagefind-ui__result-nested:hover,
424
+ #starlight__search .pagefind-ui__result-nested:focus-within {
425
+ outline: 1px solid var(--sl-color-accent-high);
426
+ }
427
+
428
+ #starlight__search
429
+ .pagefind-ui__result-title:not(
430
+ :where(.pagefind-ui__result-nested *)
431
+ ):focus-within,
432
+ #starlight__search .pagefind-ui__result-nested:focus-within {
433
+ background-color: var(--sl-color-accent-low);
434
+ }
435
+
436
+ #starlight__search .pagefind-ui__result-thumb,
437
+ #starlight__search .pagefind-ui__result-inner {
438
+ margin-top: 0;
439
+ }
440
+
441
+ #starlight__search .pagefind-ui__result-inner > :first-child {
442
+ border-radius: var(--sl-search-corners) var(--sl-search-corners) 0 0;
443
+ }
444
+ #starlight__search .pagefind-ui__result-inner > :last-child {
445
+ border-radius: 0 0 var(--sl-search-corners) var(--sl-search-corners);
446
+ }
447
+
448
+ #starlight__search .pagefind-ui__result-inner > .pagefind-ui__result-title {
449
+ padding: var(--sl-search-result-pad-block)
450
+ var(--sl-search-result-pad-inline-end);
451
+ padding-inline-start: var(--sl-search-result-pad-inline-start);
452
+ }
453
+ #starlight__search
454
+ .pagefind-ui__result-inner
455
+ > .pagefind-ui__result-title::before {
456
+ content: "";
457
+ position: absolute;
458
+ inset-block: 0;
459
+ inset-inline-start: var(--sl-search-page-icon-inline-start);
460
+ width: var(--sl-search-page-icon-size);
461
+ background: var(--sl-color-gray-3);
462
+ -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' viewBox='0 0 24 24'%3E%3Cpath d='M9 10h1a1 1 0 1 0 0-2H9a1 1 0 0 0 0 2Zm0 2a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2H9Zm11-3V8l-6-6a1 1 0 0 0-1 0H7a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3V9Zm-6-4 3 3h-2a1 1 0 0 1-1-1V5Zm4 14a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h5v3a3 3 0 0 0 3 3h3v9Zm-3-3H9a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2Z'/%3E%3C/svg%3E")
463
+ center no-repeat;
464
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' viewBox='0 0 24 24'%3E%3Cpath d='M9 10h1a1 1 0 1 0 0-2H9a1 1 0 0 0 0 2Zm0 2a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2H9Zm11-3V8l-6-6a1 1 0 0 0-1 0H7a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3V9Zm-6-4 3 3h-2a1 1 0 0 1-1-1V5Zm4 14a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h5v3a3 3 0 0 0 3 3h3v9Zm-3-3H9a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2Z'/%3E%3C/svg%3E")
465
+ center no-repeat;
466
+ }
467
+
468
+ #starlight__search .pagefind-ui__result-inner {
469
+ align-items: stretch;
470
+ gap: 1px;
471
+ }
472
+
473
+ #starlight__search .pagefind-ui__result-link {
474
+ position: unset;
475
+ --pagefind-ui-text: var(--sl-color-white);
476
+ font-weight: 600;
477
+ }
478
+
479
+ #starlight__search .pagefind-ui__result-link:hover {
480
+ text-decoration: none;
481
+ }
482
+
483
+ #starlight__search
484
+ .pagefind-ui__result-nested
485
+ .pagefind-ui__result-link::before {
486
+ content: unset;
487
+ }
488
+
489
+ #starlight__search .pagefind-ui__result-nested::before {
490
+ content: "";
491
+ position: absolute;
492
+ inset-block: 0;
493
+ inset-inline-start: var(--sl-search-tree-diagram-inline-start);
494
+ width: var(--sl-search-tree-diagram-size);
495
+ background: var(--sl-color-gray-4);
496
+ -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' viewBox='0 0 16 1000' preserveAspectRatio='xMinYMin slice'%3E%3Cpath d='M8 0v1000m6-988H8'/%3E%3C/svg%3E")
497
+ 0% 0% / 100% no-repeat;
498
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' viewBox='0 0 16 1000' preserveAspectRatio='xMinYMin slice'%3E%3Cpath d='M8 0v1000m6-988H8'/%3E%3C/svg%3E")
499
+ 0% 0% / 100% no-repeat;
500
+ }
501
+ #starlight__search .pagefind-ui__result-nested:last-of-type::before {
502
+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 16 16'%3E%3Cpath d='M8 0v12m6 0H8'/%3E%3C/svg%3E");
503
+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 16 16'%3E%3Cpath d='M8 0v12m6 0H8'/%3E%3C/svg%3E");
504
+ }
505
+
506
+ /* flip icons on rtl */
507
+ [dir="rtl"] .pagefind-ui__result-title::before,
508
+ [dir="rtl"] .pagefind-ui__result-nested::before {
509
+ transform: matrix(-1, 0, 0, 1, 0, 0);
510
+ }
511
+
512
+ #starlight__search .pagefind-ui__result-link::after {
513
+ content: "";
514
+ position: absolute;
515
+ inset: 0;
516
+ }
517
+
518
+ #starlight__search .pagefind-ui__result-excerpt {
519
+ font-size: calc(1rem * var(--pagefind-ui-scale));
520
+ overflow-wrap: anywhere;
521
+ }
522
+
523
+ #starlight__search mark {
524
+ color: var(--sl-color-gray-2);
525
+ background-color: transparent;
526
+ font-weight: 600;
527
+ }
528
+
529
+ #starlight__search .pagefind-ui__filter-value::before {
530
+ border-color: var(--sl-color-text-invert);
531
+ }
532
+
533
+ #starlight__search .pagefind-ui__result-tags {
534
+ background-color: var(--sl-color-black);
535
+ margin-top: 0;
536
+ padding: var(--sl-search-result-nested-pad-block)
537
+ var(--sl-search-result-pad-inline-end);
538
+ }
539
+ }
540
+ </style>
541
+