@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/components/Select.astro
CHANGED
|
@@ -37,60 +37,64 @@ interface Props {
|
|
|
37
37
|
</label>
|
|
38
38
|
|
|
39
39
|
<style>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
label:hover {
|
|
53
|
+
color: var(--sl-color-gray-2);
|
|
54
|
+
}
|
|
54
55
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
.icon {
|
|
57
|
+
position: absolute;
|
|
58
|
+
top: 50%;
|
|
59
|
+
transform: translateY(-50%);
|
|
60
|
+
pointer-events: none;
|
|
61
|
+
}
|
|
61
62
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
77
|
+
option {
|
|
78
|
+
background-color: var(--sl-color-bg-nav);
|
|
79
|
+
color: var(--sl-color-gray-1);
|
|
80
|
+
}
|
|
71
81
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
.caret {
|
|
96
|
+
font-size: var(--sl-caret-size);
|
|
97
|
+
inset-inline-end: 0;
|
|
94
98
|
}
|
|
95
99
|
}
|
|
96
100
|
</style>
|
|
@@ -60,93 +60,95 @@ const { sublist, nested } = Astro.props;
|
|
|
60
60
|
</ul>
|
|
61
61
|
|
|
62
62
|
<style>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
color: var(--sl-color-white);
|
|
83
|
-
}
|
|
70
|
+
li {
|
|
71
|
+
overflow-wrap: anywhere;
|
|
72
|
+
}
|
|
84
73
|
|
|
85
|
-
|
|
86
|
-
|
|
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
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
124
|
+
a:hover,
|
|
125
|
+
a:focus {
|
|
126
|
+
color: var(--sl-color-white);
|
|
127
|
+
}
|
|
140
128
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
-
|
|
146
|
-
|
|
136
|
+
|
|
137
|
+
a > *:not(:last-child),
|
|
138
|
+
.group-label > *:not(:last-child) {
|
|
139
|
+
margin-inline-end: 0.25em;
|
|
147
140
|
}
|
|
148
|
-
|
|
149
|
-
|
|
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
|
-
.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
.
|
|
16
|
-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
40
|
-
|
|
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
|
-
|
|
44
|
-
|
|
44
|
+
:global([data-has-sidebar][data-has-toc]) .main-pane {
|
|
45
|
+
--sl-content-margin-inline: auto 0;
|
|
45
46
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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: [
|
|
131
|
-
|
|
132
|
-
//
|
|
133
|
-
|
|
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',
|