@astrojs/starlight 0.33.1 → 0.34.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/CHANGELOG.md +106 -0
- package/components/AnchorHeading.astro +53 -0
- package/components/Banner.astro +14 -12
- package/components/ContentNotice.astro +13 -11
- package/components/ContentPanel.astro +17 -15
- package/components/EditLink.astro +10 -8
- package/components/Footer.astro +30 -28
- package/components/Header.astro +54 -51
- package/components/Hero.astro +60 -58
- package/components/MobileMenuFooter.astro +19 -16
- package/components/MobileMenuToggle.astro +41 -37
- package/components/MobileTableOfContents.astro +71 -69
- package/components/Page.astro +8 -8
- package/components/PageFrame.astro +61 -57
- package/components/PageSidebar.astro +33 -31
- package/components/PageTitle.astro +8 -6
- package/components/Pagination.astro +38 -36
- package/components/Search.astro +277 -272
- package/components/Select.astro +50 -46
- package/components/SidebarPersister.astro +4 -2
- package/components/SidebarSublist.astro +78 -76
- package/components/SiteTitle.astro +17 -15
- package/components/SkipLink.astro +17 -15
- package/components/SocialIcons.astro +9 -7
- package/components/TableOfContents/TableOfContentsList.astro +49 -47
- package/components/TwoColumnContent.astro +32 -30
- package/index.ts +11 -4
- package/integrations/expressive-code/index.ts +2 -0
- package/integrations/heading-links.ts +104 -0
- package/integrations/virtual-user-config.ts +9 -0
- package/package.json +12 -7
- package/schemas/head.ts +2 -2
- package/schemas/i18n.ts +2 -0
- package/style/anchor-links.css +125 -0
- package/style/asides.css +46 -44
- package/style/layers.css +1 -0
- package/style/markdown.css +195 -189
- package/style/print.css +30 -35
- package/style/props.css +180 -178
- package/style/reset.css +42 -40
- package/style/util.css +51 -49
- package/translations/ar.json +2 -1
- package/translations/ca.json +2 -1
- package/translations/cs.json +2 -1
- package/translations/da.json +2 -1
- package/translations/de.json +2 -1
- package/translations/en.json +2 -1
- package/translations/es.json +2 -1
- package/translations/fa.json +2 -1
- package/translations/fr.json +2 -1
- package/translations/gl.json +2 -1
- package/translations/he.json +2 -1
- package/translations/hi.json +2 -1
- package/translations/id.json +2 -1
- package/translations/it.json +2 -1
- package/translations/ja.json +2 -1
- package/translations/ko.json +2 -1
- package/translations/lv.json +2 -1
- package/translations/nb.json +2 -1
- package/translations/nl.json +2 -1
- package/translations/pl.json +2 -1
- package/translations/pt.json +2 -1
- package/translations/ro.json +2 -1
- package/translations/ru.json +2 -1
- package/translations/sk.json +2 -1
- package/translations/sv.json +2 -1
- package/translations/tr.json +2 -1
- package/translations/uk.json +2 -1
- package/translations/vi.json +2 -1
- package/translations/zh-CN.json +2 -1
- package/translations/zh-TW.json +2 -1
- package/user-components/Badge.astro +118 -116
- package/user-components/Card.astro +44 -42
- package/user-components/CardGrid.astro +20 -18
- package/user-components/FileTree.astro +105 -103
- package/user-components/Icon.astro +7 -5
- package/user-components/LinkButton.astro +43 -41
- package/user-components/LinkCard.astro +45 -43
- package/user-components/Steps.astro +65 -61
- package/user-components/Tabs.astro +35 -33
- package/utils/head.ts +12 -4
- package/utils/starlight-page.ts +16 -19
- package/utils/user-config.ts +14 -0
- package/virtual-internal.d.ts +2 -0
- package/style/shiki.css +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,111 @@
|
|
|
1
1
|
# @astrojs/starlight
|
|
2
2
|
|
|
3
|
+
## 0.34.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#2322](https://github.com/withastro/starlight/pull/2322) [`f14eb0c`](https://github.com/withastro/starlight/commit/f14eb0cd7baa0391d6124379f6c5df4b9ab7cc44) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Groups all of Starlight's CSS declarations into a single `starlight` [cascade layer](https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Styling_basics/Cascade_layers).
|
|
8
|
+
|
|
9
|
+
This change allows for easier customization of Starlight's CSS as any custom unlayered CSS will override the default styles. If you are using cascade layers in your custom CSS, you can use the [`@layer`](https://developer.mozilla.org/en-US/docs/Web/CSS/@layer) CSS at-rule to define the order of precedence for different layers including the ones used by Starlight.
|
|
10
|
+
|
|
11
|
+
We recommend checking your site’s appearance when upgrading to make sure there are no style regressions caused by this change.
|
|
12
|
+
|
|
13
|
+
- [#3122](https://github.com/withastro/starlight/pull/3122) [`3a087d8`](https://github.com/withastro/starlight/commit/3a087d8fbcd946336f8a0423203967e53e5678fe) Thanks [@delucis](https://github.com/delucis)! - Removes default `attrs` and `content` values from head entries parsed using Starlight’s schema.
|
|
14
|
+
|
|
15
|
+
Previously when adding `head` metadata via frontmatter or user config, Starlight would automatically add values for `attrs` and `content` if not provided. Now, these properties are left `undefined`.
|
|
16
|
+
|
|
17
|
+
This makes it simpler to add tags in route middleware for example as you no longer need to provide empty values for `attrs` and `content`:
|
|
18
|
+
|
|
19
|
+
```diff
|
|
20
|
+
head.push({
|
|
21
|
+
tag: 'style',
|
|
22
|
+
content: 'div { color: red }'
|
|
23
|
+
- attrs: {},
|
|
24
|
+
});
|
|
25
|
+
head.push({
|
|
26
|
+
tag: 'link',
|
|
27
|
+
- content: ''
|
|
28
|
+
attrs: { rel: 'me', href: 'https://example.com' },
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
This is mostly an internal API but if you are overriding Starlight’s `Head` component or processing head entries in some way, you may wish to double check your handling of `Astro.locals.starlightRoute.head` is compatible with `attrs` and `content` potentially being `undefined`.
|
|
33
|
+
|
|
34
|
+
- [#3033](https://github.com/withastro/starlight/pull/3033) [`8c19678`](https://github.com/withastro/starlight/commit/8c19678e57c0270d3d80d4678f23a6fc287ebf12) Thanks [@delucis](https://github.com/delucis)! - Adds support for generating clickable anchor links for headings.
|
|
35
|
+
|
|
36
|
+
By default, Starlight now renders an anchor link beside headings in Markdown and MDX content. A new `<AnchorHeading>` component is available to achieve the same thing in custom pages built using `<StarlightPage>`.
|
|
37
|
+
|
|
38
|
+
If you want to disable this new Markdown processing set the `markdown.headingLinks` option in your Starlight config to `false`:
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
starlight({
|
|
42
|
+
title: 'My docs',
|
|
43
|
+
markdown: {
|
|
44
|
+
headingLinks: false,
|
|
45
|
+
},
|
|
46
|
+
}),
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
⚠️ **BREAKING CHANGE:** The minimum supported version of Astro is now v5.5.0.
|
|
50
|
+
|
|
51
|
+
Please update Starlight and Astro together:
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
npx @astrojs/upgrade
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
- [#2322](https://github.com/withastro/starlight/pull/2322) [`f14eb0c`](https://github.com/withastro/starlight/commit/f14eb0cd7baa0391d6124379f6c5df4b9ab7cc44) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Removes Shiki `css-variables` theme fallback.
|
|
58
|
+
|
|
59
|
+
⚠️ **BREAKING CHANGE:**
|
|
60
|
+
|
|
61
|
+
Previously, Starlight used to automatically provide a fallback theme for Shiki, the default syntax highlighter built into Astro if the configured Shiki theme was not `github-dark`.
|
|
62
|
+
|
|
63
|
+
This fallback was only relevant when the default Starlight code block renderer, Expressive Code, was disabled and Shiki was used. Starlight no longer provides this fallback.
|
|
64
|
+
|
|
65
|
+
If you were relying on this behavior, you now manually need to update your Astro configuration to use the Shiki `css-variables` theme to match the previous behavior.
|
|
66
|
+
|
|
67
|
+
```diff
|
|
68
|
+
import { defineConfig } from 'astro/config';
|
|
69
|
+
|
|
70
|
+
export default defineConfig({
|
|
71
|
+
+ markdown: {
|
|
72
|
+
+ shikiConfig: {
|
|
73
|
+
+ theme: 'css-variables',
|
|
74
|
+
+ },
|
|
75
|
+
+ },
|
|
76
|
+
});
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Additionally, you can use [custom CSS](https://starlight.astro.build/guides/css-and-tailwind/#custom-css-styles) to control the appearance of the code blocks. Here are the previously used CSS variables for the fallback theme:
|
|
80
|
+
|
|
81
|
+
```css
|
|
82
|
+
:root {
|
|
83
|
+
--astro-code-foreground: var(--sl-color-white);
|
|
84
|
+
--astro-code-background: var(--sl-color-gray-6);
|
|
85
|
+
--astro-code-token-constant: var(--sl-color-blue-high);
|
|
86
|
+
--astro-code-token-string: var(--sl-color-green-high);
|
|
87
|
+
--astro-code-token-comment: var(--sl-color-gray-2);
|
|
88
|
+
--astro-code-token-keyword: var(--sl-color-purple-high);
|
|
89
|
+
--astro-code-token-parameter: var(--sl-color-red-high);
|
|
90
|
+
--astro-code-token-function: var(--sl-color-red-high);
|
|
91
|
+
--astro-code-token-string-expression: var(--sl-color-green-high);
|
|
92
|
+
--astro-code-token-punctuation: var(--sl-color-gray-2);
|
|
93
|
+
--astro-code-token-link: var(--sl-color-blue-high);
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Patch Changes
|
|
98
|
+
|
|
99
|
+
- [#3118](https://github.com/withastro/starlight/pull/3118) [`77a1104`](https://github.com/withastro/starlight/commit/77a110461dffacd1d3ee3b8934fd48b20111f3c4) Thanks [@delucis](https://github.com/delucis)! - Fixes passing imported SVGs to the `frontmatter` prop of the `<StarlightPage>` component in Astro ≥5.7.0
|
|
100
|
+
|
|
101
|
+
## 0.33.2
|
|
102
|
+
|
|
103
|
+
### Patch Changes
|
|
104
|
+
|
|
105
|
+
- [#3090](https://github.com/withastro/starlight/pull/3090) [`fc3ffa8`](https://github.com/withastro/starlight/commit/fc3ffa8e27a3113a8eb70a3d8e7bf69c2bb214e5) Thanks [@delucis](https://github.com/delucis)! - Updates internal `@astrojs/mdx`, `@astrojs/sitemap`, and `astro-expressive-code` dependencies
|
|
106
|
+
|
|
107
|
+
- [#3109](https://github.com/withastro/starlight/pull/3109) [`b5cc1b4`](https://github.com/withastro/starlight/commit/b5cc1b4d4ee7dc737616c6ada893369b13ddb9c6) Thanks [@dhruvkb](https://github.com/dhruvkb)! - Updates Expressive Code to v0.41.1
|
|
108
|
+
|
|
3
109
|
## 0.33.1
|
|
4
110
|
|
|
5
111
|
### Patch Changes
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types';
|
|
3
|
+
import { transform } from 'ultrahtml';
|
|
4
|
+
import sanitize from 'ultrahtml/transformers/sanitize';
|
|
5
|
+
// These styles are included globally by default, but can be removed when `markdown.headingLinks` is
|
|
6
|
+
// set to `false`. We import them here to ensure they are included if the component is used with the
|
|
7
|
+
// global Markdown option disabled.
|
|
8
|
+
import '../style/anchor-links.css';
|
|
9
|
+
import { AstroError } from 'astro/errors';
|
|
10
|
+
|
|
11
|
+
const headingLevels = [1, 2, 3, 4, 5, 6, '1', '2', '3', '4', '5', '6'] as const;
|
|
12
|
+
interface Props extends HTMLAttributes<'h1'> {
|
|
13
|
+
level: 1 | 2 | 3 | 4 | 5 | 6 | `${1 | 2 | 3 | 4 | 5 | 6}`;
|
|
14
|
+
id: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const { level, id, ...attrs } = Astro.props;
|
|
18
|
+
|
|
19
|
+
if (!id) {
|
|
20
|
+
throw new AstroError(
|
|
21
|
+
'Missing `id` attribute passed to `<AnchorHeading>` component',
|
|
22
|
+
`The \`<AnchorHeading>\` component requires an \`id\` attribute, but received \`${typeof id === 'string' ? '""' : id}\`.`
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
if (!headingLevels.includes(level)) {
|
|
26
|
+
throw new AstroError(
|
|
27
|
+
'Invalid `level` attribute passed to `<AnchorHeading>` component',
|
|
28
|
+
`The \`<AnchorHeading>\` component expects a \`level\` attribute of \`1 | 2 | 3 | 4 | 5 | 6\`, but received \`${level}\`.`
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const HeadingElement = `h${level}` as const;
|
|
33
|
+
const headingHTML = await Astro.slots.render('default');
|
|
34
|
+
const headingString = await transform(headingHTML, [sanitize({ unblockElements: [] })]);
|
|
35
|
+
const accessibleLabel = Astro.locals.t('heading.anchorLabel', {
|
|
36
|
+
title: headingString,
|
|
37
|
+
interpolation: { escapeValue: false },
|
|
38
|
+
})
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
{/* The spacing in this component is a little awkward to ensure whitespace matches what the rehype plugin produces. */}
|
|
42
|
+
<div class={`sl-heading-wrapper level-h${level}`}
|
|
43
|
+
><HeadingElement {id} {...attrs} set:html={headingHTML} /><a class="sl-anchor-link" href={`#${id}`}
|
|
44
|
+
><span aria-hidden="true" class="sl-anchor-icon"
|
|
45
|
+
><svg width="16" height="16" viewBox="0 0 24 24"
|
|
46
|
+
><path
|
|
47
|
+
fill="currentcolor"
|
|
48
|
+
d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z"
|
|
49
|
+
></path></svg
|
|
50
|
+
></span
|
|
51
|
+
><span class="sr-only" set:text={accessibleLabel} /></a
|
|
52
|
+
></div
|
|
53
|
+
>
|
package/components/Banner.astro
CHANGED
|
@@ -5,17 +5,19 @@ const { banner } = Astro.locals.starlightRoute.entry.data;
|
|
|
5
5
|
{banner && <div class="sl-banner" set:html={banner.content} />}
|
|
6
6
|
|
|
7
7
|
<style>
|
|
8
|
-
.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
@layer starlight.core {
|
|
9
|
+
.sl-banner {
|
|
10
|
+
--__sl-banner-text: var(--sl-color-banner-text, var(--sl-color-text-invert));
|
|
11
|
+
padding: var(--sl-nav-pad-y) var(--sl-nav-pad-x);
|
|
12
|
+
background-color: var(--sl-color-banner-bg, var(--sl-color-bg-accent));
|
|
13
|
+
color: var(--__sl-banner-text);
|
|
14
|
+
line-height: var(--sl-line-height-headings);
|
|
15
|
+
text-align: center;
|
|
16
|
+
text-wrap: balance;
|
|
17
|
+
box-shadow: var(--sl-shadow-sm);
|
|
18
|
+
}
|
|
19
|
+
.sl-banner :global(a) {
|
|
20
|
+
color: var(--__sl-banner-text);
|
|
21
|
+
}
|
|
20
22
|
}
|
|
21
23
|
</style>
|
|
@@ -16,16 +16,18 @@ const { icon, label } = Astro.props;
|
|
|
16
16
|
</p>
|
|
17
17
|
|
|
18
18
|
<style>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
@layer starlight.core {
|
|
20
|
+
p {
|
|
21
|
+
border: 1px solid var(--sl-color-orange);
|
|
22
|
+
padding: 0.75em 1em;
|
|
23
|
+
background-color: var(--sl-color-orange-low);
|
|
24
|
+
color: var(--sl-color-orange-high);
|
|
25
|
+
width: max-content;
|
|
26
|
+
max-width: 100%;
|
|
27
|
+
align-items: center;
|
|
28
|
+
gap: 0.75em;
|
|
29
|
+
font-size: var(--sl-text-body-sm);
|
|
30
|
+
line-height: var(--sl-line-height-headings);
|
|
31
|
+
}
|
|
30
32
|
}
|
|
31
33
|
</style>
|
|
@@ -3,23 +3,25 @@
|
|
|
3
3
|
</div>
|
|
4
4
|
|
|
5
5
|
<style>
|
|
6
|
-
.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
@layer starlight.core {
|
|
7
|
+
.content-panel {
|
|
8
|
+
padding: 1.5rem var(--sl-content-pad-x);
|
|
9
|
+
}
|
|
10
|
+
.content-panel + .content-panel {
|
|
11
|
+
border-top: 1px solid var(--sl-color-hairline);
|
|
12
|
+
}
|
|
13
|
+
.sl-container {
|
|
14
|
+
max-width: var(--sl-content-width);
|
|
15
|
+
}
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
.sl-container > :global(* + *) {
|
|
18
|
+
margin-top: 1.5rem;
|
|
19
|
+
}
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
@media (min-width: 72rem) {
|
|
22
|
+
.sl-container {
|
|
23
|
+
margin-inline: var(--sl-content-margin-inline, auto);
|
|
24
|
+
}
|
|
23
25
|
}
|
|
24
26
|
}
|
|
25
27
|
</style>
|
|
@@ -14,13 +14,15 @@ const { editUrl } = Astro.locals.starlightRoute;
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
<style>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
@layer starlight.core {
|
|
18
|
+
a {
|
|
19
|
+
gap: 0.5rem;
|
|
20
|
+
align-items: center;
|
|
21
|
+
text-decoration: none;
|
|
22
|
+
color: var(--sl-color-gray-3);
|
|
23
|
+
}
|
|
24
|
+
a:hover {
|
|
25
|
+
color: var(--sl-color-white);
|
|
26
|
+
}
|
|
25
27
|
}
|
|
26
28
|
</style>
|
package/components/Footer.astro
CHANGED
|
@@ -23,34 +23,36 @@ import { Icon } from '../components';
|
|
|
23
23
|
</footer>
|
|
24
24
|
|
|
25
25
|
<style>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
26
|
+
@layer starlight.core {
|
|
27
|
+
footer {
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
gap: 1.5rem;
|
|
30
|
+
}
|
|
31
|
+
.meta {
|
|
32
|
+
gap: 0.75rem 3rem;
|
|
33
|
+
justify-content: space-between;
|
|
34
|
+
flex-wrap: wrap;
|
|
35
|
+
margin-top: 3rem;
|
|
36
|
+
font-size: var(--sl-text-sm);
|
|
37
|
+
color: var(--sl-color-gray-3);
|
|
38
|
+
}
|
|
39
|
+
.meta > :global(p:only-child) {
|
|
40
|
+
margin-inline-start: auto;
|
|
41
|
+
}
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
43
|
+
.kudos {
|
|
44
|
+
align-items: center;
|
|
45
|
+
gap: 0.5em;
|
|
46
|
+
margin: 1.5rem auto;
|
|
47
|
+
font-size: var(--sl-text-xs);
|
|
48
|
+
text-decoration: none;
|
|
49
|
+
color: var(--sl-color-gray-3);
|
|
50
|
+
}
|
|
51
|
+
.kudos :global(svg) {
|
|
52
|
+
color: var(--sl-color-orange);
|
|
53
|
+
}
|
|
54
|
+
.kudos:hover {
|
|
55
|
+
color: var(--sl-color-white);
|
|
56
|
+
}
|
|
55
57
|
}
|
|
56
58
|
</style>
|
package/components/Header.astro
CHANGED
|
@@ -14,7 +14,7 @@ const shouldRenderSearch =
|
|
|
14
14
|
config.pagefind || config.components.Search !== '@astrojs/starlight/components/Search.astro';
|
|
15
15
|
---
|
|
16
16
|
|
|
17
|
-
<div class="header
|
|
17
|
+
<div class="header">
|
|
18
18
|
<div class="title-wrapper sl-flex">
|
|
19
19
|
<SiteTitle />
|
|
20
20
|
</div>
|
|
@@ -31,61 +31,64 @@ const shouldRenderSearch =
|
|
|
31
31
|
</div>
|
|
32
32
|
|
|
33
33
|
<style>
|
|
34
|
-
.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
/* Prevent long titles overflowing and covering the search and menu buttons on narrow viewports. */
|
|
43
|
-
overflow: clip;
|
|
44
|
-
/* Avoid clipping focus ring around link inside title wrapper. */
|
|
45
|
-
padding: 0.25rem;
|
|
46
|
-
margin: -0.25rem;
|
|
47
|
-
min-width: 0;
|
|
48
|
-
}
|
|
34
|
+
@layer starlight.core {
|
|
35
|
+
.header {
|
|
36
|
+
display: flex;
|
|
37
|
+
gap: var(--sl-nav-gap);
|
|
38
|
+
justify-content: space-between;
|
|
39
|
+
align-items: center;
|
|
40
|
+
height: 100%;
|
|
41
|
+
}
|
|
49
42
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
border-inline-end: 1px solid var(--sl-color-gray-5);
|
|
59
|
-
}
|
|
43
|
+
.title-wrapper {
|
|
44
|
+
/* Prevent long titles overflowing and covering the search and menu buttons on narrow viewports. */
|
|
45
|
+
overflow: clip;
|
|
46
|
+
/* Avoid clipping focus ring around link inside title wrapper. */
|
|
47
|
+
padding: 0.25rem;
|
|
48
|
+
margin: -0.25rem;
|
|
49
|
+
min-width: 0;
|
|
50
|
+
}
|
|
60
51
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
52
|
+
.right-group,
|
|
53
|
+
.social-icons {
|
|
54
|
+
gap: 1rem;
|
|
55
|
+
align-items: center;
|
|
64
56
|
}
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
.social-icons::after {
|
|
58
|
+
content: '';
|
|
59
|
+
height: 2rem;
|
|
60
|
+
border-inline-end: 1px solid var(--sl-color-gray-5);
|
|
67
61
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
62
|
+
|
|
63
|
+
@media (min-width: 50rem) {
|
|
64
|
+
:global(:root[data-has-sidebar]) {
|
|
65
|
+
--__sidebar-pad: calc(2 * var(--sl-nav-pad-x));
|
|
66
|
+
}
|
|
67
|
+
:global(:root:not([data-has-toc])) {
|
|
68
|
+
--__toc-width: 0rem;
|
|
69
|
+
}
|
|
70
|
+
.header {
|
|
71
|
+
--__sidebar-width: max(0rem, var(--sl-content-inline-start, 0rem) - var(--sl-nav-pad-x));
|
|
72
|
+
--__main-column-fr: calc(
|
|
73
|
+
(
|
|
74
|
+
100% + var(--__sidebar-pad, 0rem) - var(--__toc-width, var(--sl-sidebar-width)) -
|
|
75
|
+
(2 * var(--__toc-width, var(--sl-nav-pad-x))) - var(--sl-content-inline-start, 0rem) -
|
|
76
|
+
var(--sl-content-width)
|
|
77
|
+
) / 2
|
|
78
|
+
);
|
|
79
|
+
display: grid;
|
|
80
|
+
grid-template-columns:
|
|
79
81
|
/* 1 (site title): runs up until the main content column’s left edge or the width of the title, whichever is the largest */
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
82
|
+
minmax(
|
|
83
|
+
calc(var(--__sidebar-width) + max(0rem, var(--__main-column-fr) - var(--sl-nav-gap))),
|
|
84
|
+
auto
|
|
85
|
+
)
|
|
86
|
+
/* 2 (search box): all free space that is available. */
|
|
87
|
+
1fr
|
|
88
|
+
/* 3 (right items): use the space that these need. */
|
|
89
|
+
auto;
|
|
90
|
+
align-content: center;
|
|
91
|
+
}
|
|
89
92
|
}
|
|
90
93
|
}
|
|
91
94
|
</style>
|
package/components/Hero.astro
CHANGED
|
@@ -64,78 +64,80 @@ if (image) {
|
|
|
64
64
|
</div>
|
|
65
65
|
|
|
66
66
|
<style>
|
|
67
|
-
.
|
|
68
|
-
display: grid;
|
|
69
|
-
align-items: center;
|
|
70
|
-
gap: 1rem;
|
|
71
|
-
padding-bottom: 1rem;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.hero > img,
|
|
75
|
-
.hero > .hero-html {
|
|
76
|
-
object-fit: contain;
|
|
77
|
-
width: min(70%, 20rem);
|
|
78
|
-
height: auto;
|
|
79
|
-
margin-inline: auto;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.stack {
|
|
83
|
-
flex-direction: column;
|
|
84
|
-
gap: clamp(1.5rem, calc(1.5rem + 1vw), 2rem);
|
|
85
|
-
text-align: center;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.copy {
|
|
89
|
-
flex-direction: column;
|
|
90
|
-
gap: 1rem;
|
|
91
|
-
align-items: center;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.copy > * {
|
|
95
|
-
max-width: 50ch;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
h1 {
|
|
99
|
-
font-size: clamp(var(--sl-text-3xl), calc(0.25rem + 5vw), var(--sl-text-6xl));
|
|
100
|
-
line-height: var(--sl-line-height-headings);
|
|
101
|
-
font-weight: 600;
|
|
102
|
-
color: var(--sl-color-white);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.tagline {
|
|
106
|
-
font-size: clamp(var(--sl-text-base), calc(0.0625rem + 2vw), var(--sl-text-xl));
|
|
107
|
-
color: var(--sl-color-gray-2);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.actions {
|
|
111
|
-
gap: 1rem 2rem;
|
|
112
|
-
flex-wrap: wrap;
|
|
113
|
-
justify-content: center;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
@media (min-width: 50rem) {
|
|
67
|
+
@layer starlight.core {
|
|
117
68
|
.hero {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
69
|
+
display: grid;
|
|
70
|
+
align-items: center;
|
|
71
|
+
gap: 1rem;
|
|
72
|
+
padding-bottom: 1rem;
|
|
121
73
|
}
|
|
122
74
|
|
|
123
75
|
.hero > img,
|
|
124
76
|
.hero > .hero-html {
|
|
125
|
-
|
|
126
|
-
width: min(
|
|
77
|
+
object-fit: contain;
|
|
78
|
+
width: min(70%, 20rem);
|
|
79
|
+
height: auto;
|
|
80
|
+
margin-inline: auto;
|
|
127
81
|
}
|
|
128
82
|
|
|
129
83
|
.stack {
|
|
130
|
-
|
|
84
|
+
flex-direction: column;
|
|
85
|
+
gap: clamp(1.5rem, calc(1.5rem + 1vw), 2rem);
|
|
86
|
+
text-align: center;
|
|
131
87
|
}
|
|
132
88
|
|
|
133
89
|
.copy {
|
|
134
|
-
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
gap: 1rem;
|
|
92
|
+
align-items: center;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.copy > * {
|
|
96
|
+
max-width: 50ch;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
h1 {
|
|
100
|
+
font-size: clamp(var(--sl-text-3xl), calc(0.25rem + 5vw), var(--sl-text-6xl));
|
|
101
|
+
line-height: var(--sl-line-height-headings);
|
|
102
|
+
font-weight: 600;
|
|
103
|
+
color: var(--sl-color-white);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.tagline {
|
|
107
|
+
font-size: clamp(var(--sl-text-base), calc(0.0625rem + 2vw), var(--sl-text-xl));
|
|
108
|
+
color: var(--sl-color-gray-2);
|
|
135
109
|
}
|
|
136
110
|
|
|
137
111
|
.actions {
|
|
138
|
-
|
|
112
|
+
gap: 1rem 2rem;
|
|
113
|
+
flex-wrap: wrap;
|
|
114
|
+
justify-content: center;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@media (min-width: 50rem) {
|
|
118
|
+
.hero {
|
|
119
|
+
grid-template-columns: 7fr 4fr;
|
|
120
|
+
gap: 3%;
|
|
121
|
+
padding-block: clamp(2.5rem, calc(1rem + 10vmin), 10rem);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.hero > img,
|
|
125
|
+
.hero > .hero-html {
|
|
126
|
+
order: 2;
|
|
127
|
+
width: min(100%, 25rem);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.stack {
|
|
131
|
+
text-align: start;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.copy {
|
|
135
|
+
align-items: flex-start;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.actions {
|
|
139
|
+
justify-content: flex-start;
|
|
140
|
+
}
|
|
139
141
|
}
|
|
140
142
|
}
|
|
141
143
|
</style>
|
|
@@ -5,7 +5,7 @@ import ThemeSelect from 'virtual:starlight/components/ThemeSelect';
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<div class="mobile-preferences sl-flex">
|
|
8
|
-
<div class="
|
|
8
|
+
<div class="social-icons">
|
|
9
9
|
<SocialIcons />
|
|
10
10
|
</div>
|
|
11
11
|
<ThemeSelect />
|
|
@@ -13,20 +13,23 @@ import ThemeSelect from 'virtual:starlight/components/ThemeSelect';
|
|
|
13
13
|
</div>
|
|
14
14
|
|
|
15
15
|
<style>
|
|
16
|
-
.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
@layer starlight.core {
|
|
17
|
+
.social-icons {
|
|
18
|
+
display: flex;
|
|
19
|
+
margin-inline-end: auto;
|
|
20
|
+
gap: 1rem;
|
|
21
|
+
align-items: center;
|
|
22
|
+
padding-block: 1rem;
|
|
23
|
+
}
|
|
24
|
+
.social-icons:empty {
|
|
25
|
+
display: none;
|
|
26
|
+
}
|
|
27
|
+
.mobile-preferences {
|
|
28
|
+
justify-content: space-between;
|
|
29
|
+
flex-wrap: wrap;
|
|
30
|
+
border-top: 1px solid var(--sl-color-gray-6);
|
|
31
|
+
column-gap: 1rem;
|
|
32
|
+
padding: 0.5rem 0;
|
|
33
|
+
}
|
|
31
34
|
}
|
|
32
35
|
</style>
|