@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.
Files changed (85) hide show
  1. package/CHANGELOG.md +106 -0
  2. package/components/AnchorHeading.astro +53 -0
  3. package/components/Banner.astro +14 -12
  4. package/components/ContentNotice.astro +13 -11
  5. package/components/ContentPanel.astro +17 -15
  6. package/components/EditLink.astro +10 -8
  7. package/components/Footer.astro +30 -28
  8. package/components/Header.astro +54 -51
  9. package/components/Hero.astro +60 -58
  10. package/components/MobileMenuFooter.astro +19 -16
  11. package/components/MobileMenuToggle.astro +41 -37
  12. package/components/MobileTableOfContents.astro +71 -69
  13. package/components/Page.astro +8 -8
  14. package/components/PageFrame.astro +61 -57
  15. package/components/PageSidebar.astro +33 -31
  16. package/components/PageTitle.astro +8 -6
  17. package/components/Pagination.astro +38 -36
  18. package/components/Search.astro +277 -272
  19. package/components/Select.astro +50 -46
  20. package/components/SidebarPersister.astro +4 -2
  21. package/components/SidebarSublist.astro +78 -76
  22. package/components/SiteTitle.astro +17 -15
  23. package/components/SkipLink.astro +17 -15
  24. package/components/SocialIcons.astro +9 -7
  25. package/components/TableOfContents/TableOfContentsList.astro +49 -47
  26. package/components/TwoColumnContent.astro +32 -30
  27. package/index.ts +11 -4
  28. package/integrations/expressive-code/index.ts +2 -0
  29. package/integrations/heading-links.ts +104 -0
  30. package/integrations/virtual-user-config.ts +9 -0
  31. package/package.json +12 -7
  32. package/schemas/head.ts +2 -2
  33. package/schemas/i18n.ts +2 -0
  34. package/style/anchor-links.css +125 -0
  35. package/style/asides.css +46 -44
  36. package/style/layers.css +1 -0
  37. package/style/markdown.css +195 -189
  38. package/style/print.css +30 -35
  39. package/style/props.css +180 -178
  40. package/style/reset.css +42 -40
  41. package/style/util.css +51 -49
  42. package/translations/ar.json +2 -1
  43. package/translations/ca.json +2 -1
  44. package/translations/cs.json +2 -1
  45. package/translations/da.json +2 -1
  46. package/translations/de.json +2 -1
  47. package/translations/en.json +2 -1
  48. package/translations/es.json +2 -1
  49. package/translations/fa.json +2 -1
  50. package/translations/fr.json +2 -1
  51. package/translations/gl.json +2 -1
  52. package/translations/he.json +2 -1
  53. package/translations/hi.json +2 -1
  54. package/translations/id.json +2 -1
  55. package/translations/it.json +2 -1
  56. package/translations/ja.json +2 -1
  57. package/translations/ko.json +2 -1
  58. package/translations/lv.json +2 -1
  59. package/translations/nb.json +2 -1
  60. package/translations/nl.json +2 -1
  61. package/translations/pl.json +2 -1
  62. package/translations/pt.json +2 -1
  63. package/translations/ro.json +2 -1
  64. package/translations/ru.json +2 -1
  65. package/translations/sk.json +2 -1
  66. package/translations/sv.json +2 -1
  67. package/translations/tr.json +2 -1
  68. package/translations/uk.json +2 -1
  69. package/translations/vi.json +2 -1
  70. package/translations/zh-CN.json +2 -1
  71. package/translations/zh-TW.json +2 -1
  72. package/user-components/Badge.astro +118 -116
  73. package/user-components/Card.astro +44 -42
  74. package/user-components/CardGrid.astro +20 -18
  75. package/user-components/FileTree.astro +105 -103
  76. package/user-components/Icon.astro +7 -5
  77. package/user-components/LinkButton.astro +43 -41
  78. package/user-components/LinkCard.astro +45 -43
  79. package/user-components/Steps.astro +65 -61
  80. package/user-components/Tabs.astro +35 -33
  81. package/utils/head.ts +12 -4
  82. package/utils/starlight-page.ts +16 -19
  83. package/utils/user-config.ts +14 -0
  84. package/virtual-internal.d.ts +2 -0
  85. package/style/shiki.css +0 -13
@@ -37,60 +37,64 @@ interface Props {
37
37
  </label>
38
38
 
39
39
  <style>
40
- label {
41
- --sl-label-icon-size: 0.875rem;
42
- --sl-caret-size: 1.25rem;
43
- --sl-inline-padding: 0.5rem;
44
- position: relative;
45
- display: flex;
46
- align-items: center;
47
- gap: 0.25rem;
48
- color: var(--sl-color-gray-1);
49
- }
40
+ @layer starlight.core {
41
+ label {
42
+ --sl-label-icon-size: 0.875rem;
43
+ --sl-caret-size: 1.25rem;
44
+ --sl-inline-padding: 0.5rem;
45
+ position: relative;
46
+ display: flex;
47
+ align-items: center;
48
+ gap: 0.25rem;
49
+ color: var(--sl-color-gray-1);
50
+ }
50
51
 
51
- label:hover {
52
- color: var(--sl-color-gray-2);
53
- }
52
+ label:hover {
53
+ color: var(--sl-color-gray-2);
54
+ }
54
55
 
55
- .icon {
56
- position: absolute;
57
- top: 50%;
58
- transform: translateY(-50%);
59
- pointer-events: none;
60
- }
56
+ .icon {
57
+ position: absolute;
58
+ top: 50%;
59
+ transform: translateY(-50%);
60
+ pointer-events: none;
61
+ }
61
62
 
62
- .label-icon {
63
- font-size: var(--sl-label-icon-size);
64
- inset-inline-start: 0;
65
- }
63
+ select {
64
+ border: 0;
65
+ padding-block: 0.625rem;
66
+ padding-inline: calc(var(--sl-label-icon-size) + var(--sl-inline-padding) + 0.25rem)
67
+ calc(var(--sl-caret-size) + var(--sl-inline-padding) + 0.25rem);
68
+ margin-inline: calc(var(--sl-inline-padding) * -1);
69
+ width: calc(var(--sl-select-width) + var(--sl-inline-padding) * 2);
70
+ background-color: transparent;
71
+ text-overflow: ellipsis;
72
+ color: inherit;
73
+ cursor: pointer;
74
+ appearance: none;
75
+ }
66
76
 
67
- .caret {
68
- font-size: var(--sl-caret-size);
69
- inset-inline-end: 0;
70
- }
77
+ option {
78
+ background-color: var(--sl-color-bg-nav);
79
+ color: var(--sl-color-gray-1);
80
+ }
71
81
 
72
- select {
73
- border: 0;
74
- padding-block: 0.625rem;
75
- padding-inline: calc(var(--sl-label-icon-size) + var(--sl-inline-padding) + 0.25rem)
76
- calc(var(--sl-caret-size) + var(--sl-inline-padding) + 0.25rem);
77
- margin-inline: calc(var(--sl-inline-padding) * -1);
78
- width: calc(var(--sl-select-width) + var(--sl-inline-padding) * 2);
79
- background-color: transparent;
80
- text-overflow: ellipsis;
81
- color: inherit;
82
- cursor: pointer;
83
- appearance: none;
82
+ @media (min-width: 50rem) {
83
+ select {
84
+ font-size: var(--sl-text-sm);
85
+ }
86
+ }
84
87
  }
85
88
 
86
- option {
87
- background-color: var(--sl-color-bg-nav);
88
- color: var(--sl-color-gray-1);
89
- }
89
+ @layer starlight.components {
90
+ .label-icon {
91
+ font-size: var(--sl-label-icon-size);
92
+ inset-inline-start: 0;
93
+ }
90
94
 
91
- @media (min-width: 50rem) {
92
- select {
93
- font-size: var(--sl-text-sm);
95
+ .caret {
96
+ font-size: var(--sl-caret-size);
97
+ inset-inline-end: 0;
94
98
  }
95
99
  }
96
100
  </style>
@@ -70,7 +70,9 @@ declare global {
70
70
  </sl-sidebar-state-persist>
71
71
 
72
72
  <style>
73
- sl-sidebar-state-persist {
74
- display: contents;
73
+ @layer starlight.core {
74
+ sl-sidebar-state-persist {
75
+ display: contents;
76
+ }
75
77
  }
76
78
  </style>
@@ -60,93 +60,95 @@ const { sublist, nested } = Astro.props;
60
60
  </ul>
61
61
 
62
62
  <style>
63
- ul {
64
- --sl-sidebar-item-padding-inline: 0.5rem;
65
- list-style: none;
66
- padding: 0;
67
- }
68
-
69
- li {
70
- overflow-wrap: anywhere;
71
- }
72
-
73
- ul ul li {
74
- margin-inline-start: var(--sl-sidebar-item-padding-inline);
75
- border-inline-start: 1px solid var(--sl-color-hairline-light);
76
- padding-inline-start: var(--sl-sidebar-item-padding-inline);
77
- }
63
+ @layer starlight.core {
64
+ ul {
65
+ --sl-sidebar-item-padding-inline: 0.5rem;
66
+ list-style: none;
67
+ padding: 0;
68
+ }
78
69
 
79
- .large {
80
- font-size: var(--sl-text-lg);
81
- font-weight: 600;
82
- color: var(--sl-color-white);
83
- }
70
+ li {
71
+ overflow-wrap: anywhere;
72
+ }
84
73
 
85
- .top-level > li + li {
86
- margin-top: 0.75rem;
87
- }
74
+ ul ul li {
75
+ margin-inline-start: var(--sl-sidebar-item-padding-inline);
76
+ border-inline-start: 1px solid var(--sl-color-hairline-light);
77
+ padding-inline-start: var(--sl-sidebar-item-padding-inline);
78
+ }
88
79
 
89
- summary {
90
- display: flex;
91
- align-items: center;
92
- justify-content: space-between;
93
- padding: 0.2em var(--sl-sidebar-item-padding-inline);
94
- line-height: 1.4;
95
- cursor: pointer;
96
- user-select: none;
97
- }
98
- summary::marker,
99
- summary::-webkit-details-marker {
100
- display: none;
101
- }
80
+ .large {
81
+ font-size: var(--sl-text-lg);
82
+ font-weight: 600;
83
+ color: var(--sl-color-white);
84
+ }
102
85
 
103
- .caret {
104
- transition: transform 0.2s ease-in-out;
105
- flex-shrink: 0;
106
- }
107
- :global([dir='rtl']) .caret {
108
- transform: rotateZ(180deg);
109
- }
110
- [open] > summary .caret {
111
- transform: rotateZ(90deg);
112
- }
86
+ .top-level > li + li {
87
+ margin-top: 0.75rem;
88
+ }
113
89
 
114
- a {
115
- display: block;
116
- border-radius: 0.25rem;
117
- text-decoration: none;
118
- color: var(--sl-color-gray-2);
119
- padding: 0.3em var(--sl-sidebar-item-padding-inline);
120
- line-height: 1.4;
121
- }
90
+ summary {
91
+ display: flex;
92
+ align-items: center;
93
+ justify-content: space-between;
94
+ padding: 0.2em var(--sl-sidebar-item-padding-inline);
95
+ line-height: 1.4;
96
+ cursor: pointer;
97
+ user-select: none;
98
+ }
99
+ summary::marker,
100
+ summary::-webkit-details-marker {
101
+ display: none;
102
+ }
122
103
 
123
- a:hover,
124
- a:focus {
125
- color: var(--sl-color-white);
126
- }
104
+ .caret {
105
+ transition: transform 0.2s ease-in-out;
106
+ flex-shrink: 0;
107
+ }
108
+ :global([dir='rtl']) .caret {
109
+ transform: rotateZ(180deg);
110
+ }
111
+ [open] > summary .caret {
112
+ transform: rotateZ(90deg);
113
+ }
127
114
 
128
- [aria-current='page'],
129
- [aria-current='page']:hover,
130
- [aria-current='page']:focus {
131
- font-weight: 600;
132
- color: var(--sl-color-text-invert);
133
- background-color: var(--sl-color-text-accent);
134
- }
115
+ a {
116
+ display: block;
117
+ border-radius: 0.25rem;
118
+ text-decoration: none;
119
+ color: var(--sl-color-gray-2);
120
+ padding: 0.3em var(--sl-sidebar-item-padding-inline);
121
+ line-height: 1.4;
122
+ }
135
123
 
136
- a > *:not(:last-child),
137
- .group-label > *:not(:last-child) {
138
- margin-inline-end: 0.25em;
139
- }
124
+ a:hover,
125
+ a:focus {
126
+ color: var(--sl-color-white);
127
+ }
140
128
 
141
- @media (min-width: 50rem) {
142
- .top-level > li + li {
143
- margin-top: 0.5rem;
129
+ [aria-current='page'],
130
+ [aria-current='page']:hover,
131
+ [aria-current='page']:focus {
132
+ font-weight: 600;
133
+ color: var(--sl-color-text-invert);
134
+ background-color: var(--sl-color-text-accent);
144
135
  }
145
- .large {
146
- font-size: var(--sl-text-base);
136
+
137
+ a > *:not(:last-child),
138
+ .group-label > *:not(:last-child) {
139
+ margin-inline-end: 0.25em;
147
140
  }
148
- a {
149
- font-size: var(--sl-text-sm);
141
+
142
+ @media (min-width: 50rem) {
143
+ .top-level > li + li {
144
+ margin-top: 0.5rem;
145
+ }
146
+ .large {
147
+ font-size: var(--sl-text-base);
148
+ }
149
+ a {
150
+ font-size: var(--sl-text-sm);
151
+ }
150
152
  }
151
153
  }
152
154
  </style>
@@ -34,20 +34,22 @@ const { siteTitle, siteTitleHref } = Astro.locals.starlightRoute;
34
34
  </a>
35
35
 
36
36
  <style>
37
- .site-title {
38
- align-items: center;
39
- gap: var(--sl-nav-gap);
40
- font-size: var(--sl-text-h4);
41
- font-weight: 600;
42
- color: var(--sl-color-text-accent);
43
- text-decoration: none;
44
- white-space: nowrap;
45
- }
46
- img {
47
- height: calc(var(--sl-nav-height) - 2 * var(--sl-nav-pad-y));
48
- width: auto;
49
- max-width: 100%;
50
- object-fit: contain;
51
- object-position: 0 50%;
37
+ @layer starlight.core {
38
+ .site-title {
39
+ align-items: center;
40
+ gap: var(--sl-nav-gap);
41
+ font-size: var(--sl-text-h4);
42
+ font-weight: 600;
43
+ color: var(--sl-color-text-accent);
44
+ text-decoration: none;
45
+ white-space: nowrap;
46
+ }
47
+ img {
48
+ height: calc(var(--sl-nav-height) - 2 * var(--sl-nav-pad-y));
49
+ width: auto;
50
+ max-width: 100%;
51
+ object-fit: contain;
52
+ object-position: 0 50%;
53
+ }
52
54
  }
53
55
  </style>
@@ -5,20 +5,22 @@ import { PAGE_TITLE_ID } from '../constants';
5
5
  <a href={`#${PAGE_TITLE_ID}`}>{Astro.locals.t('skipLink.label')}</a>
6
6
 
7
7
  <style>
8
- a {
9
- clip: rect(0, 0, 0, 0);
10
- position: fixed;
11
- top: 0.75rem;
12
- inset-inline-start: 0.75rem;
13
- }
14
- a:focus {
15
- clip: unset;
16
- z-index: var(--sl-z-index-skiplink);
17
- display: block;
18
- padding: 0.5rem 1rem;
19
- text-decoration: none;
20
- color: var(--sl-color-text-invert);
21
- background-color: var(--sl-color-text-accent);
22
- box-shadow: var(--sl-shadow-lg);
8
+ @layer starlight.core {
9
+ a {
10
+ clip: rect(0, 0, 0, 0);
11
+ position: fixed;
12
+ top: 0.75rem;
13
+ inset-inline-start: 0.75rem;
14
+ }
15
+ a:focus {
16
+ clip: unset;
17
+ z-index: var(--sl-z-index-skiplink);
18
+ display: block;
19
+ padding: 0.5rem 1rem;
20
+ text-decoration: none;
21
+ color: var(--sl-color-text-invert);
22
+ background-color: var(--sl-color-text-accent);
23
+ box-shadow: var(--sl-shadow-lg);
24
+ }
23
25
  }
24
26
  </style>
@@ -19,12 +19,14 @@ const links = config.social || [];
19
19
  }
20
20
 
21
21
  <style>
22
- a {
23
- color: var(--sl-color-text-accent);
24
- padding: 0.5em;
25
- margin: -0.5em;
26
- }
27
- a:hover {
28
- opacity: 0.66;
22
+ @layer starlight.core {
23
+ a {
24
+ color: var(--sl-color-text-accent);
25
+ padding: 0.5em;
26
+ margin: -0.5em;
27
+ }
28
+ a:hover {
29
+ opacity: 0.66;
30
+ }
29
31
  }
30
32
  </style>
@@ -26,52 +26,54 @@ const { toc, isMobile = false, depth = 0 } = Astro.props;
26
26
  </ul>
27
27
 
28
28
  <style define:vars={{ depth }}>
29
- ul {
30
- padding: 0;
31
- list-style: none;
32
- }
33
- a {
34
- --pad-inline: 0.5rem;
35
- display: block;
36
- border-radius: 0.25rem;
37
- padding-block: 0.25rem;
38
- padding-inline: calc(1rem * var(--depth) + var(--pad-inline)) var(--pad-inline);
39
- line-height: 1.25;
40
- }
41
- a[aria-current='true'] {
42
- color: var(--sl-color-text-accent);
43
- }
44
- .isMobile a {
45
- --pad-inline: 1rem;
46
- display: flex;
47
- justify-content: space-between;
48
- gap: var(--pad-inline);
49
- border-top: 1px solid var(--sl-color-gray-6);
50
- border-radius: 0;
51
- padding-block: 0.5rem;
52
- color: var(--sl-color-text);
53
- font-size: var(--sl-text-sm);
54
- text-decoration: none;
55
- outline-offset: var(--sl-outline-offset-inside);
56
- }
57
- .isMobile:first-child > li:first-child > a {
58
- border-top: 0;
59
- }
60
- .isMobile a[aria-current='true'],
61
- .isMobile a[aria-current='true']:hover,
62
- .isMobile a[aria-current='true']:focus {
63
- color: var(--sl-color-white);
64
- background-color: unset;
65
- }
66
- .isMobile a[aria-current='true']::after {
67
- content: '';
68
- width: 1rem;
69
- background-color: var(--sl-color-text-accent);
70
- /* Check mark SVG icon */
71
- -webkit-mask-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAxNCAxNCc+PHBhdGggZD0nTTEwLjkxNCA0LjIwNmEuNTgzLjU4MyAwIDAgMC0uODI4IDBMNS43NCA4LjU1NyAzLjkxNCA2LjcyNmEuNTk2LjU5NiAwIDAgMC0uODI4Ljg1N2wyLjI0IDIuMjRhLjU4My41ODMgMCAwIDAgLjgyOCAwbDQuNzYtNC43NmEuNTgzLjU4MyAwIDAgMCAwLS44NTdaJy8+PC9zdmc+Cg==');
72
- mask-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAxNCAxNCc+PHBhdGggZD0nTTEwLjkxNCA0LjIwNmEuNTgzLjU4MyAwIDAgMC0uODI4IDBMNS43NCA4LjU1NyAzLjkxNCA2LjcyNmEuNTk2LjU5NiAwIDAgMC0uODI4Ljg1N2wyLjI0IDIuMjRhLjU4My41ODMgMCAwIDAgLjgyOCAwbDQuNzYtNC43NmEuNTgzLjU4MyAwIDAgMCAwLS44NTdaJy8+PC9zdmc+Cg==');
73
- -webkit-mask-repeat: no-repeat;
74
- mask-repeat: no-repeat;
75
- flex-shrink: 0;
29
+ @layer starlight.core {
30
+ ul {
31
+ padding: 0;
32
+ list-style: none;
33
+ }
34
+ a {
35
+ --pad-inline: 0.5rem;
36
+ display: block;
37
+ border-radius: 0.25rem;
38
+ padding-block: 0.25rem;
39
+ padding-inline: calc(1rem * var(--depth) + var(--pad-inline)) var(--pad-inline);
40
+ line-height: 1.25;
41
+ }
42
+ a[aria-current='true'] {
43
+ color: var(--sl-color-text-accent);
44
+ }
45
+ .isMobile a {
46
+ --pad-inline: 1rem;
47
+ display: flex;
48
+ justify-content: space-between;
49
+ gap: var(--pad-inline);
50
+ border-top: 1px solid var(--sl-color-gray-6);
51
+ border-radius: 0;
52
+ padding-block: 0.5rem;
53
+ color: var(--sl-color-text);
54
+ font-size: var(--sl-text-sm);
55
+ text-decoration: none;
56
+ outline-offset: var(--sl-outline-offset-inside);
57
+ }
58
+ .isMobile:first-child > li:first-child > a {
59
+ border-top: 0;
60
+ }
61
+ .isMobile a[aria-current='true'],
62
+ .isMobile a[aria-current='true']:hover,
63
+ .isMobile a[aria-current='true']:focus {
64
+ color: var(--sl-color-white);
65
+ background-color: unset;
66
+ }
67
+ .isMobile a[aria-current='true']::after {
68
+ content: '';
69
+ width: 1rem;
70
+ background-color: var(--sl-color-text-accent);
71
+ /* Check mark SVG icon */
72
+ -webkit-mask-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAxNCAxNCc+PHBhdGggZD0nTTEwLjkxNCA0LjIwNmEuNTgzLjU4MyAwIDAgMC0uODI4IDBMNS43NCA4LjU1NyAzLjkxNCA2LjcyNmEuNTk2LjU5NiAwIDAgMC0uODI4Ljg1N2wyLjI0IDIuMjRhLjU4My41ODMgMCAwIDAgLjgyOCAwbDQuNzYtNC43NmEuNTgzLjU4MyAwIDAgMCAwLS44NTdaJy8+PC9zdmc+Cg==');
73
+ mask-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAxNCAxNCc+PHBhdGggZD0nTTEwLjkxNCA0LjIwNmEuNTgzLjU4MyAwIDAgMC0uODI4IDBMNS43NCA4LjU1NyAzLjkxNCA2LjcyNmEuNTk2LjU5NiAwIDAgMC0uODI4Ljg1N2wyLjI0IDIuMjRhLjU4My41ODMgMCAwIDAgLjgyOCAwbDQuNzYtNC43NmEuNTgzLjU4MyAwIDAgMCAwLS44NTdaJy8+PC9zdmc+Cg==');
74
+ -webkit-mask-repeat: no-repeat;
75
+ mask-repeat: no-repeat;
76
+ flex-shrink: 0;
77
+ }
76
78
  }
77
79
  </style>
@@ -12,41 +12,43 @@
12
12
  </div>
13
13
 
14
14
  <style>
15
- .main-pane {
16
- isolation: isolate;
17
- }
18
-
19
- @media (min-width: 72rem) {
20
- .right-sidebar-container {
21
- order: 2;
22
- position: relative;
23
- width: calc(
24
- var(--sl-sidebar-width) + (100% - var(--sl-content-width) - var(--sl-sidebar-width)) / 2
25
- );
15
+ @layer starlight.core {
16
+ .main-pane {
17
+ isolation: isolate;
26
18
  }
27
19
 
28
- .right-sidebar {
29
- position: fixed;
30
- top: 0;
31
- border-inline-start: 1px solid var(--sl-color-hairline);
32
- padding-top: var(--sl-nav-height);
33
- width: 100%;
34
- height: 100vh;
35
- overflow-y: auto;
36
- scrollbar-width: none;
37
- }
20
+ @media (min-width: 72rem) {
21
+ .right-sidebar-container {
22
+ order: 2;
23
+ position: relative;
24
+ width: calc(
25
+ var(--sl-sidebar-width) + (100% - var(--sl-content-width) - var(--sl-sidebar-width)) / 2
26
+ );
27
+ }
38
28
 
39
- .main-pane {
40
- width: 100%;
41
- }
29
+ .right-sidebar {
30
+ position: fixed;
31
+ top: 0;
32
+ border-inline-start: 1px solid var(--sl-color-hairline);
33
+ padding-top: var(--sl-nav-height);
34
+ width: 100%;
35
+ height: 100vh;
36
+ overflow-y: auto;
37
+ scrollbar-width: none;
38
+ }
39
+
40
+ .main-pane {
41
+ width: 100%;
42
+ }
42
43
 
43
- :global([data-has-sidebar][data-has-toc]) .main-pane {
44
- --sl-content-margin-inline: auto 0;
44
+ :global([data-has-sidebar][data-has-toc]) .main-pane {
45
+ --sl-content-margin-inline: auto 0;
45
46
 
46
- order: 1;
47
- width: calc(
48
- var(--sl-content-width) + (100% - var(--sl-content-width) - var(--sl-sidebar-width)) / 2
49
- );
47
+ order: 1;
48
+ width: calc(
49
+ var(--sl-content-width) + (100% - var(--sl-content-width) - var(--sl-sidebar-width)) / 2
50
+ );
51
+ }
50
52
  }
51
53
  }
52
54
  </style>
package/index.ts CHANGED
@@ -26,6 +26,7 @@ import {
26
26
  } from './utils/plugins';
27
27
  import { processI18nConfig } from './utils/i18n';
28
28
  import type { StarlightConfig } from './types';
29
+ import { starlightAutolinkHeadings } from './integrations/heading-links';
29
30
 
30
31
  export default function StarlightIntegration(
31
32
  userOpts: StarlightUserConfigWithPlugins
@@ -127,10 +128,16 @@ export default function StarlightIntegration(
127
128
  absolutePathToLang,
128
129
  }),
129
130
  ],
130
- rehypePlugins: [rehypeRtlCodeSupport()],
131
- shikiConfig:
132
- // Configure Shiki theme if the user is using the default github-dark theme.
133
- config.markdown.shikiConfig.theme !== 'github-dark' ? {} : { theme: 'css-variables' },
131
+ rehypePlugins: [
132
+ rehypeRtlCodeSupport(),
133
+ // Process headings and add anchor links.
134
+ ...starlightAutolinkHeadings({
135
+ starlightConfig,
136
+ astroConfig: config,
137
+ useTranslations,
138
+ absolutePathToLang,
139
+ }),
140
+ ],
134
141
  },
135
142
  scopedStyleStrategy: 'where',
136
143
  // If not already configured, default to prefetching all links on hover.
@@ -81,6 +81,7 @@ export function getStarlightEcConfigPreprocessor({
81
81
 
82
82
  const {
83
83
  themes: themesInput,
84
+ cascadeLayer,
84
85
  customizeTheme,
85
86
  styleOverrides: { textMarkers: textMarkersStyleOverrides, ...otherStyleOverrides } = {},
86
87
  useStarlightDarkModeSwitch,
@@ -136,6 +137,7 @@ export function getStarlightEcConfigPreprocessor({
136
137
  // Return the default selector
137
138
  return `[data-theme='${theme.name}']`;
138
139
  },
140
+ cascadeLayer: cascadeLayer ?? 'starlight.components',
139
141
  styleOverrides: {
140
142
  borderRadius: '0px',
141
143
  borderWidth: '1px',