@astrojs/starlight 0.41.1 → 0.41.2

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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @astrojs/starlight
2
2
 
3
+ ## 0.41.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#4008](https://github.com/withastro/starlight/pull/4008) [`58a3520`](https://github.com/withastro/starlight/commit/58a352097016ffbd98716688e4f2dfb97e5a6f44) Thanks [@FrancoKaddour](https://github.com/FrancoKaddour)! - Fixes the table of contents overflowing the right edge of the viewport when a custom `--sl-content-width` value exceeds available space
8
+
9
+ - [#4015](https://github.com/withastro/starlight/pull/4015) [`bdbfffc`](https://github.com/withastro/starlight/commit/bdbfffc044dbf119e5085c3e67722494ae3c85c6) Thanks [@delucis](https://github.com/delucis)! - Fixes an issue where aside icons were rendered incorrectly in projects where Astro’s MDX integration had optimization disabled
10
+
3
11
  ## 0.41.1
4
12
 
5
13
  ### Patch Changes
@@ -21,8 +21,11 @@
21
21
  .right-sidebar-container {
22
22
  order: 2;
23
23
  position: relative;
24
- width: calc(
25
- var(--sl-sidebar-width) + (100% - var(--sl-content-width) - var(--sl-sidebar-width)) / 2
24
+ width: max(
25
+ var(--sl-sidebar-width),
26
+ calc(
27
+ var(--sl-sidebar-width) + (100% - var(--sl-content-width) - var(--sl-sidebar-width)) / 2
28
+ )
26
29
  );
27
30
  }
28
31
 
@@ -45,8 +48,11 @@
45
48
  --sl-content-margin-inline: auto 0;
46
49
 
47
50
  order: 1;
48
- width: calc(
49
- var(--sl-content-width) + (100% - var(--sl-content-width) - var(--sl-sidebar-width)) / 2
51
+ width: min(
52
+ calc(100% - var(--sl-sidebar-width)),
53
+ calc(
54
+ var(--sl-content-width) + (100% - var(--sl-content-width) - var(--sl-sidebar-width)) / 2
55
+ )
50
56
  );
51
57
  }
52
58
  }
@@ -103,6 +103,15 @@ function satteriAsidesPlugin(
103
103
 
104
104
  const icon = getAsideIcon(variant, node.attributes?.['icon']);
105
105
  const iconSvg = `<svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor" class="starlight-aside__icon">${icon}</svg>`;
106
+ // Markdown and MDX require different AST shapes for raw HTML content.
107
+ // TODO: replace endsWith check with an official Sätteri API once available.
108
+ const iconNode = ctx.fileURL?.pathname.endsWith('.mdx')
109
+ ? {
110
+ type: 'mdxJsxTextElement',
111
+ name: 'Fragment',
112
+ attributes: [{ type: 'mdxJsxAttribute', name: 'set:html', value: iconSvg }],
113
+ }
114
+ : { type: 'html', value: iconSvg };
106
115
 
107
116
  return paragraphElement(
108
117
  'aside',
@@ -112,7 +121,7 @@ function satteriAsidesPlugin(
112
121
  },
113
122
  [
114
123
  paragraphElement('p', { class: 'starlight-aside__title', 'aria-hidden': 'true' }, [
115
- { type: 'html', value: iconSvg },
124
+ iconNode,
116
125
  ...titleNode,
117
126
  ]),
118
127
  paragraphElement('div', { class: 'starlight-aside__content' }, children),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrojs/starlight",
3
- "version": "0.41.1",
3
+ "version": "0.41.2",
4
4
  "description": "Build beautiful, high-performance documentation websites with Astro",
5
5
  "keywords": [
6
6
  "docs",
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "devDependencies": {
54
54
  "@astrojs/markdown-remark": "^7.2.0",
55
- "@playwright/test": "^1.59.1",
55
+ "@playwright/test": "^1.61.1",
56
56
  "@types/node": "^22.19.17",
57
57
  "@vitest/coverage-v8": "^4.1.5",
58
58
  "astro": "^7.0.2",