starlight-versions 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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-present, HiDeoo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,27 @@
1
+ <div align="center">
2
+ <h1>starlight-versions 🕒</h1>
3
+ <p>Starlight plugin to version documentation pages.</p>
4
+ </div>
5
+
6
+ <div align="center">
7
+ <a href="https://github.com/HiDeoo/starlight-versions/actions/workflows/integration.yml">
8
+ <img alt="Integration Status" src="https://github.com/HiDeoo/starlight-versions/actions/workflows/integration.yml/badge.svg" />
9
+ </a>
10
+ <a href="https://github.com/HiDeoo/starlight-versions/blob/main/LICENSE">
11
+ <img alt="License" src="https://badgen.net/github/license/HiDeoo/starlight-versions" />
12
+ </a>
13
+ <br />
14
+ </div>
15
+
16
+ ## Getting Started
17
+
18
+ Want to get started immediately? Check out the [getting started guide](https://starlight-versions.vercel.app/getting-started/).
19
+
20
+ > [!IMPORTANT]
21
+ > Starlight Versions is an [opinionated](https://starlight-versions.vercel.app/guides/about-versioning/#versioning-strategies) plugin that is still in early development. Expect frequent updates and changes to the plugin as development continues.
22
+
23
+ ## License
24
+
25
+ Licensed under the MIT License, Copyright © HiDeoo.
26
+
27
+ See [LICENSE](https://github.com/HiDeoo/starlight-versions/blob/main/LICENSE) for more information.
@@ -0,0 +1,38 @@
1
+ ---
2
+ import type { Props } from '@astrojs/starlight/props'
3
+ import starlightConfig from 'virtual:starlight/user-config'
4
+ import starlightVersionsConfig from 'virtual:starlight-versions-config'
5
+
6
+ import { getVersionFromSlug, getVersionURL } from '../libs/versions'
7
+
8
+ const { template } = Astro.props.entry['data']
9
+
10
+ const pageVersion = getVersionFromSlug(starlightVersionsConfig, starlightConfig, Astro.props.entry.slug)
11
+ ---
12
+
13
+ {
14
+ pageVersion && template === 'splash' && (
15
+ <div>
16
+ This content is for {pageVersion.label ?? `the ${pageVersion.slug} version`}. Switch to the
17
+ {/* prettier-ignore */}
18
+ <a href={getVersionURL(starlightVersionsConfig, starlightConfig, Astro.url, undefined).pathname}>latest version</a>
19
+ for up-to-date documentation.
20
+ </div>
21
+ )
22
+ }
23
+
24
+ <style>
25
+ div {
26
+ background-color: var(--sl-color-orange-low);
27
+ box-shadow: var(--sl-shadow-sm);
28
+ color: var(--sl-color-orange-high);
29
+ line-height: var(--sl-line-height-headings);
30
+ padding: var(--sl-nav-pad-y) var(--sl-nav-pad-x);
31
+ text-align: center;
32
+ text-wrap: balance;
33
+ }
34
+
35
+ div a {
36
+ color: var(--sl-color-orange-high);
37
+ }
38
+ </style>
@@ -0,0 +1,48 @@
1
+ ---
2
+ import { Icon } from '@astrojs/starlight/components'
3
+ import type { Props } from '@astrojs/starlight/props'
4
+ import starlightConfig from 'virtual:starlight/user-config'
5
+ import starlightVersionsConfig from 'virtual:starlight-versions-config'
6
+
7
+ import { getVersionFromSlug, getVersionURL } from '../libs/versions'
8
+
9
+ const pageVersion = getVersionFromSlug(starlightVersionsConfig, starlightConfig, Astro.props.entry.slug)
10
+ ---
11
+
12
+ {
13
+ pageVersion && (
14
+ <p>
15
+ <Icon name="seti:clock" size="1em" color="var(--sl-color-orange-high)" />
16
+ <span>
17
+ This content is for {pageVersion.label ?? `the ${pageVersion.slug} version`}. Switch to the
18
+ {/* prettier-ignore */}
19
+ <a href={getVersionURL(starlightVersionsConfig, starlightConfig, Astro.url, undefined).pathname}>latest version</a>
20
+ for up-to-date documentation.
21
+ </span>
22
+ </p>
23
+ )
24
+ }
25
+
26
+ <style>
27
+ p {
28
+ display: flex;
29
+ border: 1px solid var(--sl-color-orange);
30
+ padding: 0.75em 1em;
31
+ background-color: var(--sl-color-orange-low);
32
+ color: var(--sl-color-orange-high);
33
+ width: max-content;
34
+ max-width: 100%;
35
+ align-items: center;
36
+ gap: 0.75em;
37
+ font-size: var(--sl-text-sm);
38
+ line-height: var(--sl-line-height-headings);
39
+ }
40
+
41
+ p a {
42
+ color: var(--sl-color-orange-high);
43
+ }
44
+
45
+ p :global(svg) {
46
+ flex-shrink: 0;
47
+ }
48
+ </style>
@@ -0,0 +1,34 @@
1
+ ---
2
+ import Default from '@astrojs/starlight/components/Pagination.astro'
3
+ import type { Props } from '@astrojs/starlight/props'
4
+ import starlightConfig from 'virtual:starlight/user-config'
5
+ import starlightVersionsConfig from 'virtual:starlight-versions-config'
6
+
7
+ import { getVersionFromPaginationLink, getVersionFromSlug } from '../libs/versions'
8
+ import type { Version } from '../libs/versions'
9
+
10
+ const { entry, locale, pagination } = Astro.props
11
+
12
+ type PaginationLink = typeof Astro.props.pagination.next
13
+
14
+ function getPaginationLink(currentVersion: Version | undefined, link: PaginationLink) {
15
+ if (!link) return undefined
16
+
17
+ const linkVersion = getVersionFromPaginationLink(starlightVersionsConfig, link.href, locale)
18
+
19
+ // If the current version is not the same as the link version, remove the link.
20
+ return (currentVersion === undefined && linkVersion === undefined) || currentVersion?.slug === linkVersion?.slug
21
+ ? link
22
+ : undefined
23
+ }
24
+
25
+ const pageVersion = getVersionFromSlug(starlightVersionsConfig, starlightConfig, entry.slug)
26
+ ---
27
+
28
+ <Default
29
+ {...Astro.props}
30
+ pagination={{
31
+ prev: getPaginationLink(pageVersion, pagination.prev),
32
+ next: getPaginationLink(pageVersion, pagination.next),
33
+ }}><slot /></Default
34
+ >
@@ -0,0 +1,486 @@
1
+ ---
2
+ /**
3
+ * A copy of the Starlight `<Search>` component with some modifications to handle versioning.
4
+ * @see https://github.com/withastro/starlight/blob/64288fb0051310f7148afd13f65c578664f04eb2/packages/starlight/components/Search.astro
5
+ */
6
+
7
+ import { Icon } from '@astrojs/starlight/components'
8
+ import type { Props } from '@astrojs/starlight/props'
9
+ import '@pagefind/default-ui/css/ui.css'
10
+ import project from 'virtual:starlight/project-context'
11
+ import starlightConfig from 'virtual:starlight/user-config'
12
+ import starlightVersionsConfig from 'virtual:starlight-versions-config'
13
+
14
+ import { getVersionFromSlug, getVersionIdentifier, getVersionURL } from '../libs/versions'
15
+
16
+ const { entry, labels } = Astro.props
17
+
18
+ const pagefindTranslations = {
19
+ placeholder: labels['search.label'],
20
+ ...Object.fromEntries(
21
+ Object.entries(labels)
22
+ .filter(([key]) => key.startsWith('pagefind.'))
23
+ .map(([key, value]) => [key.replace('pagefind.', ''), value]),
24
+ ),
25
+ }
26
+
27
+ const pageVersion = getVersionFromSlug(starlightVersionsConfig, starlightConfig, entry.slug)
28
+ const pageVersionIdentifier = getVersionIdentifier(pageVersion)
29
+ ---
30
+
31
+ <site-search
32
+ data-translations={JSON.stringify(pagefindTranslations)}
33
+ data-strip-trailing-slash={project.trailingSlash === 'never'}
34
+ data-version={pageVersionIdentifier}
35
+ data-pagefind-filter={`version:${pageVersionIdentifier}`}
36
+ >
37
+ <button data-open-modal disabled>
38
+ <Icon name="magnifier" label={labels['search.label']} />
39
+ <span class="sl-hidden md:sl-block" aria-hidden="true">{labels['search.label']}</span>
40
+ <Icon name="forward-slash" class="sl-hidden md:sl-block" label={labels['search.shortcutLabel']} />
41
+ </button>
42
+
43
+ <dialog style="padding:0" aria-label={labels['search.label']}>
44
+ <div class="dialog-frame sl-flex">
45
+ <button data-close-modal class="sl-flex md:sl-hidden">
46
+ {labels['search.cancelLabel']}
47
+ </button>
48
+ {
49
+ import.meta.env.DEV ? (
50
+ <div style="margin: auto; text-align: center; white-space: pre-line;" dir="ltr">
51
+ <p>{labels['search.devWarning']}</p>
52
+ </div>
53
+ ) : (
54
+ <div class="search-container">
55
+ <div id="starlight__search">
56
+ {pageVersion && (
57
+ <div class="starlight-versions-pagefind-notice">
58
+ <Icon name="seti:clock" size="1em" color="var(--sl-color-orange-high)" />
59
+ <span>
60
+ Search limited to {pageVersion.label ?? `the ${pageVersion.slug} version`}. Switch to the
61
+ {/* prettier-ignore */}
62
+ <a href={getVersionURL(starlightVersionsConfig, starlightConfig, Astro.url, undefined).pathname}>latest version</a>
63
+ for up-to-date results.
64
+ </span>
65
+ </div>
66
+ )}
67
+ </div>
68
+ </div>
69
+ )
70
+ }
71
+ </div>
72
+ </dialog>
73
+ </site-search>
74
+
75
+ <script>
76
+ class SiteSearch extends HTMLElement {
77
+ constructor() {
78
+ super()
79
+ const openBtn = this.querySelector<HTMLButtonElement>('button[data-open-modal]')
80
+ const closeBtn = this.querySelector<HTMLButtonElement>('button[data-close-modal]')
81
+ const dialog = this.querySelector('dialog')
82
+ const dialogFrame = this.querySelector('.dialog-frame')
83
+ if (!openBtn || !closeBtn || !dialog || !dialogFrame) return
84
+
85
+ /** Close the modal if a user clicks on a link or outside of the modal. */
86
+ const onClick = (event: MouseEvent) => {
87
+ const isLink = 'href' in (event.target || {})
88
+ if (isLink || (document.body.contains(event.target as Node) && !dialogFrame.contains(event.target as Node))) {
89
+ closeModal()
90
+ }
91
+ }
92
+
93
+ const openModal = (event?: MouseEvent) => {
94
+ dialog.showModal()
95
+ document.body.toggleAttribute('data-search-modal-open', true)
96
+ this.querySelector('input')?.focus()
97
+ event?.stopPropagation()
98
+ window.addEventListener('click', onClick)
99
+ }
100
+
101
+ const closeModal = () => dialog.close()
102
+
103
+ openBtn.addEventListener('click', openModal)
104
+ openBtn.disabled = false
105
+ closeBtn.addEventListener('click', closeModal)
106
+
107
+ dialog.addEventListener('close', () => {
108
+ document.body.toggleAttribute('data-search-modal-open', false)
109
+ window.removeEventListener('click', onClick)
110
+ })
111
+
112
+ // Listen for `/`, `ctrl + k`, and `cmd + k` keyboard shortcuts.
113
+ window.addEventListener('keydown', (e) => {
114
+ const isInput =
115
+ document.activeElement instanceof HTMLElement &&
116
+ (['input', 'select', 'textarea'].includes(document.activeElement.tagName.toLowerCase()) ||
117
+ document.activeElement.isContentEditable)
118
+ if ((e.metaKey === true || e.ctrlKey === true) && e.key === 'k') {
119
+ dialog.open ? closeModal() : openModal()
120
+ e.preventDefault()
121
+ } else if (e.key === '/' && !dialog.open && !isInput) {
122
+ openModal()
123
+ e.preventDefault()
124
+ }
125
+ })
126
+
127
+ let translations = {}
128
+ try {
129
+ translations = JSON.parse(this.dataset['translations'] || '{}')
130
+ } catch {
131
+ // Ignore translation parsing errors.
132
+ }
133
+
134
+ const shouldStrip = this.dataset['stripTrailingSlash'] !== undefined
135
+ const formatURL = shouldStrip ? this.stripTrailingSlash : (path: string) => path
136
+ const version = this.dataset['version'] ?? 'current'
137
+
138
+ window.addEventListener('DOMContentLoaded', () => {
139
+ if (import.meta.env.DEV) return
140
+ const onIdle = window.requestIdleCallback || ((cb) => setTimeout(cb, 1))
141
+ onIdle(async () => {
142
+ // @ts-expect-error — Missing types for @pagefind/default-ui package.
143
+ const { PagefindUI } = await import('@pagefind/default-ui')
144
+ const search = new PagefindUI({
145
+ element: '#starlight__search',
146
+ baseUrl: import.meta.env.BASE_URL,
147
+ bundlePath: `${import.meta.env.BASE_URL.replace(/\/$/, '')}/pagefind/`,
148
+ showImages: false,
149
+ translations,
150
+ showSubResults: true,
151
+ processResult: (result: { url: string; sub_results: { url: string }[] }) => {
152
+ result.url = formatURL(result.url)
153
+ result.sub_results = result.sub_results.map((sub_result) => {
154
+ sub_result.url = formatURL(sub_result.url)
155
+ return sub_result
156
+ })
157
+ },
158
+ })
159
+ search.triggerFilters({ version: [version] })
160
+ })
161
+ })
162
+ }
163
+
164
+ private stripTrailingSlash(path: string) {
165
+ return path.replace(/(.)\/(#.*)?$/, '$1$2')
166
+ }
167
+ }
168
+ customElements.define('site-search', SiteSearch)
169
+ </script>
170
+
171
+ <style>
172
+ site-search {
173
+ display: contents;
174
+ }
175
+ button[data-open-modal] {
176
+ display: flex;
177
+ align-items: center;
178
+ gap: 0.5rem;
179
+ border: 0;
180
+ background-color: transparent;
181
+ color: var(--sl-color-gray-1);
182
+ cursor: pointer;
183
+ height: 2.5rem;
184
+ font-size: var(--sl-text-xl);
185
+ }
186
+
187
+ @media (min-width: 50rem) {
188
+ button[data-open-modal] {
189
+ border: 1px solid var(--sl-color-gray-5);
190
+ border-radius: 0.5rem;
191
+ padding-inline-start: 0.75rem;
192
+ padding-inline-end: 1rem;
193
+ background-color: var(--sl-color-black);
194
+ color: var(--sl-color-gray-2);
195
+ font-size: var(--sl-text-sm);
196
+ width: 100%;
197
+ max-width: 22rem;
198
+ }
199
+ button[data-open-modal]:hover {
200
+ border-color: var(--sl-color-gray-2);
201
+ color: var(--sl-color-white);
202
+ }
203
+
204
+ button[data-open-modal] > :last-child {
205
+ margin-inline-start: auto;
206
+ }
207
+ }
208
+
209
+ dialog {
210
+ margin: 0;
211
+ background-color: var(--sl-color-gray-6);
212
+ border: 1px solid var(--sl-color-gray-5);
213
+ width: 100%;
214
+ max-width: 100%;
215
+ height: 100%;
216
+ max-height: 100%;
217
+ box-shadow: var(--sl-shadow-lg);
218
+ }
219
+ dialog[open] {
220
+ display: grid;
221
+ }
222
+
223
+ dialog::backdrop {
224
+ background-color: var(--sl-color-backdrop-overlay);
225
+ -webkit-backdrop-filter: blur(0.25rem);
226
+ backdrop-filter: blur(0.25rem);
227
+ }
228
+
229
+ .dialog-frame {
230
+ flex-direction: column;
231
+ gap: 1rem;
232
+ padding: 1rem;
233
+ }
234
+
235
+ button[data-close-modal] {
236
+ position: absolute;
237
+ z-index: 1;
238
+ align-items: center;
239
+ align-self: flex-end;
240
+ height: calc(64px * var(--pagefind-ui-scale));
241
+ padding: 0.25rem;
242
+ border: 0;
243
+ background: transparent;
244
+ cursor: pointer;
245
+ color: var(--sl-color-text-accent);
246
+ }
247
+
248
+ #starlight__search {
249
+ --pagefind-ui-primary: var(--sl-color-accent-light);
250
+ --pagefind-ui-text: var(--sl-color-gray-2);
251
+ --pagefind-ui-font: var(--__sl-font);
252
+ --pagefind-ui-background: var(--sl-color-black);
253
+ --pagefind-ui-border: var(--sl-color-gray-5);
254
+ --pagefind-ui-border-width: 1px;
255
+ --sl-search-cancel-space: 5rem;
256
+
257
+ display: flex;
258
+ flex-direction: column-reverse;
259
+ gap: calc(24px * var(--pagefind-ui-scale));
260
+ }
261
+
262
+ @media (min-width: 50rem) {
263
+ #starlight__search {
264
+ --sl-search-cancel-space: 0px;
265
+ }
266
+
267
+ dialog {
268
+ margin: 4rem auto auto;
269
+ border-radius: 0.5rem;
270
+ width: 90%;
271
+ max-width: 40rem;
272
+ height: max-content;
273
+ min-height: 15rem;
274
+ max-height: calc(100% - 8rem);
275
+ }
276
+
277
+ .dialog-frame {
278
+ padding: 1.5rem;
279
+ }
280
+ }
281
+ </style>
282
+
283
+ <style is:global>
284
+ [data-search-modal-open] {
285
+ overflow: hidden;
286
+ }
287
+
288
+ #starlight__search {
289
+ --sl-search-result-spacing: calc(1.25rem * var(--pagefind-ui-scale));
290
+ --sl-search-result-pad-inline-start: calc(3.75rem * var(--pagefind-ui-scale));
291
+ --sl-search-result-pad-inline-end: calc(1.25rem * var(--pagefind-ui-scale));
292
+ --sl-search-result-pad-block: calc(0.9375rem * var(--pagefind-ui-scale));
293
+ --sl-search-result-nested-pad-block: calc(0.625rem * var(--pagefind-ui-scale));
294
+ --sl-search-corners: calc(0.3125rem * var(--pagefind-ui-scale));
295
+ --sl-search-page-icon-size: calc(1.875rem * var(--pagefind-ui-scale));
296
+ --sl-search-page-icon-inline-start: calc(
297
+ (var(--sl-search-result-pad-inline-start) - var(--sl-search-page-icon-size)) / 2
298
+ );
299
+ --sl-search-tree-diagram-size: calc(2.5rem * var(--pagefind-ui-scale));
300
+ --sl-search-tree-diagram-inline-start: calc(
301
+ (var(--sl-search-result-pad-inline-start) - var(--sl-search-tree-diagram-size)) / 2
302
+ );
303
+ }
304
+
305
+ #starlight__search .pagefind-ui__form::before {
306
+ --pagefind-ui-text: var(--sl-color-gray-1);
307
+ opacity: 1;
308
+ }
309
+
310
+ #starlight__search .pagefind-ui__search-input {
311
+ color: var(--sl-color-white);
312
+ font-weight: 400;
313
+ width: calc(100% - var(--sl-search-cancel-space));
314
+ }
315
+
316
+ #starlight__search input:focus {
317
+ --pagefind-ui-border: var(--sl-color-accent);
318
+ }
319
+
320
+ #starlight__search .pagefind-ui__search-clear {
321
+ inset-inline-end: var(--sl-search-cancel-space);
322
+ width: calc(60px * var(--pagefind-ui-scale));
323
+ padding: 0;
324
+ background-color: transparent;
325
+ overflow: hidden;
326
+ }
327
+ #starlight__search .pagefind-ui__search-clear:focus {
328
+ outline: 1px solid var(--sl-color-accent);
329
+ }
330
+ #starlight__search .pagefind-ui__search-clear::before {
331
+ content: '';
332
+ -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")
333
+ center / 50% no-repeat;
334
+ 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")
335
+ center / 50% no-repeat;
336
+ background-color: var(--sl-color-text-accent);
337
+ display: block;
338
+ width: 100%;
339
+ height: 100%;
340
+ }
341
+
342
+ #starlight__search .pagefind-ui__results > * + * {
343
+ margin-top: var(--sl-search-result-spacing);
344
+ }
345
+ #starlight__search .pagefind-ui__result {
346
+ border: 0;
347
+ padding: 0;
348
+ }
349
+
350
+ #starlight__search .pagefind-ui__result-nested {
351
+ position: relative;
352
+ padding: var(--sl-search-result-nested-pad-block) var(--sl-search-result-pad-inline-end);
353
+ padding-inline-start: var(--sl-search-result-pad-inline-start);
354
+ }
355
+
356
+ #starlight__search .pagefind-ui__result-title:not(:where(.pagefind-ui__result-nested *)),
357
+ #starlight__search .pagefind-ui__result-nested {
358
+ position: relative;
359
+ background-color: var(--sl-color-black);
360
+ }
361
+
362
+ #starlight__search .pagefind-ui__result-title:not(:where(.pagefind-ui__result-nested *)):hover,
363
+ #starlight__search .pagefind-ui__result-title:not(:where(.pagefind-ui__result-nested *)):focus-within,
364
+ #starlight__search .pagefind-ui__result-nested:hover,
365
+ #starlight__search .pagefind-ui__result-nested:focus-within {
366
+ outline: 1px solid var(--sl-color-accent-high);
367
+ }
368
+
369
+ #starlight__search .pagefind-ui__result-title:not(:where(.pagefind-ui__result-nested *)):focus-within,
370
+ #starlight__search .pagefind-ui__result-nested:focus-within {
371
+ background-color: var(--sl-color-accent-low);
372
+ }
373
+
374
+ #starlight__search .pagefind-ui__result-thumb,
375
+ #starlight__search .pagefind-ui__result-inner {
376
+ margin-top: 0;
377
+ }
378
+
379
+ #starlight__search .pagefind-ui__result-inner > :first-child {
380
+ border-radius: var(--sl-search-corners) var(--sl-search-corners) 0 0;
381
+ }
382
+ #starlight__search .pagefind-ui__result-inner > :last-child {
383
+ border-radius: 0 0 var(--sl-search-corners) var(--sl-search-corners);
384
+ }
385
+
386
+ #starlight__search .pagefind-ui__result-inner > .pagefind-ui__result-title {
387
+ padding: var(--sl-search-result-pad-block) var(--sl-search-result-pad-inline-end);
388
+ padding-inline-start: var(--sl-search-result-pad-inline-start);
389
+ }
390
+ #starlight__search .pagefind-ui__result-inner > .pagefind-ui__result-title::before {
391
+ content: '';
392
+ position: absolute;
393
+ inset-block: 0;
394
+ inset-inline-start: var(--sl-search-page-icon-inline-start);
395
+ width: var(--sl-search-page-icon-size);
396
+ background: var(--sl-color-gray-3);
397
+ -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")
398
+ center no-repeat;
399
+ 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")
400
+ center no-repeat;
401
+ }
402
+
403
+ #starlight__search .pagefind-ui__result-inner {
404
+ align-items: stretch;
405
+ gap: 1px;
406
+ }
407
+
408
+ #starlight__search .pagefind-ui__result-link {
409
+ position: unset;
410
+ --pagefind-ui-text: var(--sl-color-white);
411
+ font-weight: 600;
412
+ }
413
+
414
+ #starlight__search .pagefind-ui__result-link:hover {
415
+ text-decoration: none;
416
+ }
417
+
418
+ #starlight__search .pagefind-ui__result-nested .pagefind-ui__result-link::before {
419
+ content: unset;
420
+ }
421
+
422
+ #starlight__search .pagefind-ui__result-nested::before {
423
+ content: '';
424
+ position: absolute;
425
+ inset-block: 0;
426
+ inset-inline-start: var(--sl-search-tree-diagram-inline-start);
427
+ width: var(--sl-search-tree-diagram-size);
428
+ background: var(--sl-color-gray-4);
429
+ -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")
430
+ 0% 0% / 100% no-repeat;
431
+ 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")
432
+ 0% 0% / 100% no-repeat;
433
+ }
434
+ #starlight__search .pagefind-ui__result-nested:last-child::before {
435
+ -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");
436
+ 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");
437
+ }
438
+
439
+ /* Flip page and tree icons around the vertical axis when in an RTL layout. */
440
+ [dir='rtl'] .pagefind-ui__result-title::before,
441
+ [dir='rtl'] .pagefind-ui__result-nested::before {
442
+ transform: matrix(-1, 0, 0, 1, 0, 0);
443
+ }
444
+
445
+ #starlight__search .pagefind-ui__result-link::after {
446
+ content: '';
447
+ position: absolute;
448
+ inset: 0;
449
+ }
450
+
451
+ #starlight__search .pagefind-ui__result-excerpt {
452
+ font-size: calc(1rem * var(--pagefind-ui-scale));
453
+ overflow-wrap: anywhere;
454
+ }
455
+
456
+ #starlight__search mark {
457
+ color: var(--sl-color-gray-2);
458
+ background-color: transparent;
459
+ font-weight: 600;
460
+ }
461
+
462
+ #starlight__search .pagefind-ui__filter-panel {
463
+ display: none;
464
+ }
465
+
466
+ .starlight-versions-pagefind-notice {
467
+ align-items: center;
468
+ background-color: var(--sl-color-orange-low);
469
+ border-radius: var(--sl-search-corners);
470
+ border: 1px solid var(--sl-color-orange);
471
+ color: var(--sl-color-orange-high);
472
+ display: flex;
473
+ font-size: calc(18px * var(--pagefind-ui-scale));
474
+ gap: 0.75em;
475
+ line-height: var(--sl-line-height-headings);
476
+ padding: 0.75em 1em;
477
+ }
478
+
479
+ .starlight-versions-pagefind-notice a {
480
+ color: var(--sl-color-orange-high);
481
+ }
482
+
483
+ .starlight-versions-pagefind-notice svg {
484
+ flex-shrink: 0;
485
+ }
486
+ </style>