@grove-dev/starlight 0.5.0-next.0 → 0.5.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.
@@ -16,9 +16,9 @@ import { Icon } from '@astrojs/starlight/components';
16
16
  import type { StarlightIcon } from '@astrojs/starlight/components-internals/Icons';
17
17
 
18
18
  interface Props {
19
- icon?: StarlightIcon;
20
- title: string;
21
- href?: string;
19
+ icon?: StarlightIcon;
20
+ title: string;
21
+ href?: string;
22
22
  }
23
23
 
24
24
  const { icon, title, href } = Astro.props;
@@ -27,7 +27,7 @@ const { icon, title, href } = Astro.props;
27
27
  <article class="card sl-flex">
28
28
  <p class="title sl-flex">
29
29
  {icon && <Icon name={icon} class="icon" size="1.333em" />}
30
- <span set:html={title} />
30
+ <span>{title}</span>
31
31
  </p>
32
32
  <div class="body">
33
33
  {href ? <a {href} class="sl-card-link"><slot /></a> : <slot />}
@@ -107,5 +107,12 @@ const { icon, title, href } = Astro.props;
107
107
  inset: 0;
108
108
  border-radius: inherit;
109
109
  }
110
+ /* Focus-visible ring anchored to the card surface so keyboard
111
+ * users see a clear focus indicator (otherwise the transparent
112
+ * overlay hides the default link outline). */
113
+ .card:has(.sl-card-link:focus-visible) {
114
+ outline: 2px solid var(--sl-color-accent);
115
+ outline-offset: 2px;
116
+ }
110
117
  }
111
118
  </style>
@@ -10,14 +10,14 @@ const { data } = Astro.locals.starlightRoute.entry;
10
10
  const { title = data.title, tagline: heroTagline, image, actions = [] } = data.hero || {};
11
11
  const heroLayout = ((data.hero as any)?.layout as HeroLayout) ?? 'centered';
12
12
  const announcement =
13
- ((data.hero as any)?.announcement as { text: string; link: string }) ?? undefined;
13
+ ((data.hero as any)?.announcement as { text: string; link: string }) ?? undefined;
14
14
  const hasImage = !!image;
15
15
  const tagline = heroTagline || data.description;
16
16
 
17
17
  const imageAttrs = {
18
- loading: 'eager' as const,
19
- decoding: 'async' as const,
20
- alt: image?.alt || '',
18
+ loading: 'eager' as const,
19
+ decoding: 'async' as const,
20
+ alt: image?.alt || '',
21
21
  };
22
22
 
23
23
  let darkImage: ImageMetadata | undefined;
@@ -25,14 +25,14 @@ let lightImage: ImageMetadata | undefined;
25
25
  let rawHtml: string | undefined;
26
26
 
27
27
  if (image) {
28
- if ('file' in image) {
29
- darkImage = image.file;
30
- } else if ('dark' in image) {
31
- darkImage = image.dark;
32
- lightImage = image.light;
33
- } else {
34
- rawHtml = image.html;
35
- }
28
+ if ('file' in image) {
29
+ darkImage = image.file;
30
+ } else if ('dark' in image) {
31
+ darkImage = image.dark;
32
+ lightImage = image.light;
33
+ } else {
34
+ rawHtml = image.html;
35
+ }
36
36
  }
37
37
  ---
38
38
 
@@ -67,11 +67,11 @@ if (image) {
67
67
  )
68
68
  }
69
69
 
70
- <h1 id={PAGE_TITLE_ID} data-page-title set:html={title} />
70
+ <h1 id={PAGE_TITLE_ID} data-page-title>{title}</h1>
71
71
  </div>
72
72
 
73
73
  <div class="hero-content-container">
74
- {tagline && <div class="tagline" set:html={tagline} />}
74
+ {tagline && <div class="tagline">{tagline}</div>}
75
75
 
76
76
  {
77
77
  actions.length > 0 && (
@@ -1,9 +1,14 @@
1
1
  ---
2
- import { marked } from 'marked';
3
2
  import userConfig from 'virtual:lucode-starlight-config';
4
3
  import Drawer from './parts/Drawer.astro';
5
4
 
6
5
  const { hasSidebar } = Astro.locals.starlightRoute;
6
+
7
+ // `footerText` is a plain string from the consumer's `astro.config.mjs`.
8
+ // Astro auto-escapes interpolated text, so emitting it directly is safe
9
+ // and avoids the XSS sink that `marked.parseInline` + `set:html` would
10
+ // create. Consumers who want rich formatting should render Markdown in
11
+ // their own component instead of leaning on this slot.
7
12
  ---
8
13
 
9
14
  <div data-slot="layout">
@@ -34,7 +39,7 @@ const { hasSidebar } = Astro.locals.starlightRoute;
34
39
  </main>
35
40
 
36
41
  <footer>
37
- <div data-slot="footer-text" set:html={marked.parseInline(userConfig.footerText)} />
42
+ <div data-slot="footer-text">{userConfig.footerText}</div>
38
43
  </footer>
39
44
  </div>
40
45
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grove-dev/starlight",
3
- "version": "0.5.0-next.0",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "description": "Grove's theme for Starlight (the Astro native documentation site generator)",
6
6
  "author": "grove-dev",
package/styles/theme.css CHANGED
@@ -16,7 +16,7 @@
16
16
  --orange: oklch(83.7% 0.128 66.29);
17
17
  --orange-high: oklch(90.1% 0.076 70.697);
18
18
  --green-low: oklch(26.6% 0.065 152.934);
19
- --green: oklch(79.2% 0.209 151.711);
19
+ --green: oklch(78% 0.19 152);
20
20
  --green-high: oklch(87.1% 0.15 154.449);
21
21
  --blue-low: oklch(29.3% 0.066 243.157);
22
22
  --blue: oklch(70.7% 0.165 254.624);