astro-accelerator 0.0.78 → 0.0.80

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.78",
2
+ "version": "0.0.80",
3
3
  "author": "Steve Fenton",
4
4
  "name": "astro-accelerator",
5
5
  "description": "A super-lightweight, accessible, SEO-friendly starter project for Astro",
@@ -26,7 +26,7 @@
26
26
  "dependencies": {
27
27
  "@astrojs/mdx": "^0.18.2",
28
28
  "astro": "^2.2.1",
29
- "astro-accelerator-utils": "^0.2.25",
29
+ "astro-accelerator-utils": "^0.2.26",
30
30
  "hast-util-from-selector": "^2.0.1",
31
31
  "remark-directive": "^2.0.1",
32
32
  "sharp": "^0.31.3"
@@ -363,6 +363,11 @@ nav.site-nav h2 {
363
363
  text-indent: calc(var(--marker-size) * 2);
364
364
  }
365
365
 
366
+ .site-nav li.has-children ul details {
367
+ width: calc(100% - var(--marker-size));
368
+ margin-inline-start: var(--marker-size);
369
+ }
370
+
366
371
  .site-nav a[aria-current] {
367
372
  font-weight: bold;
368
373
  }
@@ -9,18 +9,19 @@ type Props = {
9
9
  lang: string;
10
10
  frontmatter: Frontmatter;
11
11
  headings: { depth: number; slug: string; text: string; }[];
12
+ expanded?: boolean;
12
13
  };
13
- const { lang, frontmatter, headings } = Astro.props satisfies Props;
14
+ const { lang, frontmatter, headings, expanded } = Astro.props satisfies Props;
14
15
 
15
16
  // Language
16
17
  const _ = Lang(lang);
17
18
 
18
19
  // Logic
19
- // ...
20
+ const openAttribute = expanded ? 'open' : null;
20
21
  ---
21
22
  {headings?.length > 0 &&
22
23
  <nav class="page-toc" aria-label={ _(Translations.aria.toc) }>
23
- <details>
24
+ <details open={ openAttribute }>
24
25
  <summary>{ _(Translations.toc.title) }</summary>
25
26
  <ol>
26
27
  {headings.map((heading) =>(