@rxova/astro-ui 0.4.0 → 0.5.1
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 +2 -2
- package/src/starlight/index.ts +1 -4
- package/src/styles/starlight.css +49 -40
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxova/astro-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Astro components, Starlight preset and shared chrome for rxova.org",
|
|
6
6
|
"keywords": [
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@astrojs/check": "^0.9.10",
|
|
54
54
|
"@astrojs/starlight": "^0.42.1",
|
|
55
|
-
"@rxova/repo-tooling": "0.0.
|
|
55
|
+
"@rxova/repo-tooling": "0.0.1",
|
|
56
56
|
"@types/node": "^26.6.1",
|
|
57
57
|
"@vitest/coverage-v8": "^5.0.1",
|
|
58
58
|
"astro": "^7.3.2",
|
package/src/starlight/index.ts
CHANGED
|
@@ -16,8 +16,6 @@ export interface SharedStarlightOptions {
|
|
|
16
16
|
components?: Record<string, string>
|
|
17
17
|
/** Path under the repo root that holds the docs site, for the edit link. */
|
|
18
18
|
editLinkBase?: string
|
|
19
|
-
/** Build body-only docs for rxova-website's shell: Starlight's page UI stays, the footer goes. */
|
|
20
|
-
pageComponent?: boolean
|
|
21
19
|
}
|
|
22
20
|
|
|
23
21
|
export function sharedStarlightConfig({
|
|
@@ -26,7 +24,6 @@ export function sharedStarlightConfig({
|
|
|
26
24
|
customCss = [],
|
|
27
25
|
components = {},
|
|
28
26
|
editLinkBase = 'apps/docs',
|
|
29
|
-
pageComponent = false,
|
|
30
27
|
}: SharedStarlightOptions) {
|
|
31
28
|
const self = getProject(project)
|
|
32
29
|
|
|
@@ -59,7 +56,7 @@ export function sharedStarlightConfig({
|
|
|
59
56
|
SocialIcons: '@rxova/astro-ui/starlight/SocialIcons.astro',
|
|
60
57
|
// Starlight's default footer (pagination, edit link, last updated) plus
|
|
61
58
|
// the shared four-column site footer beneath it.
|
|
62
|
-
|
|
59
|
+
Footer: '@rxova/astro-ui/starlight/Footer.astro',
|
|
63
60
|
// Starlight's own picker, plus a resync when a page is restored from the bfcache.
|
|
64
61
|
ThemeSelect: '@rxova/astro-ui/starlight/ThemeSelect.astro',
|
|
65
62
|
...components,
|
package/src/styles/starlight.css
CHANGED
|
@@ -65,46 +65,6 @@ header.header {
|
|
|
65
65
|
background: var(--sl-color-bg-nav);
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
/* In a schema-2 page bundle rxova-website renders the umbrella header outside `.page`; keep
|
|
69
|
-
Starlight's sticky docs bar below it. */
|
|
70
|
-
html[data-rxova-shell] {
|
|
71
|
-
--rx-shell-header-height: 3.5rem;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
html[data-rxova-shell] .page > header.header {
|
|
75
|
-
inset-block-start: var(--rx-shell-header-height);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
html[data-rxova-shell] .sidebar-pane {
|
|
79
|
-
inset-block-start: calc(var(--rx-shell-header-height) + var(--sl-nav-height));
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
html[data-rxova-shell] mobile-starlight-toc nav {
|
|
83
|
-
top: calc(var(--rx-shell-header-height) + var(--sl-nav-height) - 1px);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/* Starlight 0.42 dropped the <starlight-menu-button> wrapper for a bare
|
|
87
|
-
button.sl-menu-button; the peer range still covers the older markup. */
|
|
88
|
-
html[data-rxova-shell] starlight-menu-button button,
|
|
89
|
-
html[data-rxova-shell] .sl-menu-button {
|
|
90
|
-
top: calc(
|
|
91
|
-
var(--rx-shell-header-height) + (var(--sl-nav-height) - var(--sl-menu-button-size)) / 2
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
@media (min-width: 72rem) {
|
|
96
|
-
html[data-rxova-shell] .right-sidebar {
|
|
97
|
-
top: var(--rx-shell-header-height);
|
|
98
|
-
height: calc(100vh - var(--rx-shell-header-height));
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
@media (max-width: 34rem) {
|
|
103
|
-
html[data-rxova-shell] {
|
|
104
|
-
--rx-shell-header-height: 3.25rem;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
68
|
/* Site title: the rxova mark sits beside the project wordmark. */
|
|
109
69
|
.rx-site-title {
|
|
110
70
|
display: flex;
|
|
@@ -185,6 +145,55 @@ html[data-rxova-shell] .sl-menu-button {
|
|
|
185
145
|
flex-basis: 100%;
|
|
186
146
|
}
|
|
187
147
|
|
|
148
|
+
/* In the phone menu the switcher sits at the left edge and at the bottom of the menu, so its
|
|
149
|
+
list opens rightward and upward instead of off-screen. */
|
|
150
|
+
.mobile-preferences .rx-switcher .rx-switcher__menu {
|
|
151
|
+
inset-inline: 0 auto;
|
|
152
|
+
inset-block-end: 100%;
|
|
153
|
+
margin: 0 0 0.4rem;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/* A page with no sidebar (a splash landing) has no phone menu, so on phones the header takes a
|
|
157
|
+
second row for the switcher and the sections. Starlight offsets the page by --sl-nav-height. */
|
|
158
|
+
@media (max-width: 49.99rem) {
|
|
159
|
+
:root:not([data-has-sidebar]) {
|
|
160
|
+
--sl-nav-height: 6rem;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
:root:not([data-has-sidebar]) header.header > .header {
|
|
164
|
+
flex-wrap: wrap;
|
|
165
|
+
align-content: space-between;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
:root:not([data-has-sidebar]) header.header .title-wrapper {
|
|
169
|
+
flex: 1;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
:root:not([data-has-sidebar]) header.header .right-group {
|
|
173
|
+
display: flex;
|
|
174
|
+
flex-basis: 100%;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* Only the switcher and the sections: the social icons and theme picker do not fit. */
|
|
178
|
+
:root:not([data-has-sidebar]) header.header .right-group > :not(.social-icons),
|
|
179
|
+
:root:not([data-has-sidebar]) header.header .social-icons > :not(.rx-sections) {
|
|
180
|
+
display: none;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
:root:not([data-has-sidebar]) header.header .social-icons::after {
|
|
184
|
+
content: none;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/* Flush with the logo above, and opening rightward from the left edge. */
|
|
188
|
+
:root:not([data-has-sidebar]) header.header .rx-switcher__trigger {
|
|
189
|
+
margin-inline-start: -0.5rem;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
:root:not([data-has-sidebar]) header.header .rx-switcher .rx-switcher__menu {
|
|
193
|
+
inset-inline: 0 auto;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
188
197
|
/* --- Footer -------------------------------------------------------------- */
|
|
189
198
|
|
|
190
199
|
/* Footer styles live in footer.css (imported above) because /blog and /updates need them too. */
|