@writedocs/generator 0.11.1 → 0.12.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.
@@ -1,327 +1,326 @@
1
- /* Base element styles + the .wd-shell three-column layout (sidebar / main
2
- / toc) - imported once by BaseLayout.astro. Everything here consumes the
3
- semantic --wd-* custom properties (--wd-primary, --wd-background, etc.)
4
- set on :root by BaseLayout's own inline <style define:vars> block, not
5
- the raw wdPrimaryLight/wdPrimaryDark values themselves - so, unlike that
6
- block, none of this needs to live inside an .astro file's own scoped
7
- <style> to work. A plain imported .css file is never scoped by Astro in
8
- the first place, so every selector below is already effectively global -
9
- no :global() wrapper needed (and, if left in by mistake, :global(...) is
10
- not valid CSS outside Astro's own scoped-<style> processing, so a rule
11
- written that way here would just silently never match anything). */
12
-
13
- * {
14
- box-sizing: border-box;
15
- }
16
- body {
17
- margin: 0;
18
- /* Sticky-footer layout: body is the flex column, .wd-page (everything
19
- above the footer - banner/topbar/.wd-shell, see BaseLayout.astro) is
20
- its flex: 1 0 auto item below, and <footer class="wd-footer"> is a
21
- plain sibling after it - on a page short enough not to need
22
- scrolling, .wd-page's flex-grow fills the leftover space down to the
23
- viewport's bottom edge, pushing the footer flush against it (rather
24
- than the footer trailing right after a half-empty page with its own
25
- background peeking through beneath it); on a page tall enough to
26
- already fill/exceed the viewport, .wd-page just settles at its own
27
- natural (larger) height and the footer trails normally at the real
28
- end of the document, exactly as before this rule existed. Doesn't
29
- apply in `mode: "blank"` (no .wd-page wrapper, no footer at all in
30
- that branch - see BaseLayout.astro) - a blank page already controls
31
- 100% of its own layout.
32
- */
33
- display: flex;
34
- flex-direction: column;
35
- min-height: 100vh;
36
- /* theme.background (writedocs.json) - --wd-page-bg-color/--wd-page-bg-image
37
- default to the same value as --wd-background/'none' (see
38
- BaseLayout.astro's lightPageBgColor/lightPageBgImage resolution), so
39
- an unconfigured site renders identically to a plain background: var(
40
- --wd-background) rule. background-attachment: fixed keeps a
41
- configured image sized to the viewport rather than the full
42
- (possibly very tall) document - the more expected look for a
43
- decorative page background, not something that stretches/tiles
44
- across a long scrolling doc. The topbar and footer each get their
45
- own explicit opaque background (topbar.css, footer.css)
46
- specifically so this doesn't show through them - the sidebar, main
47
- content, and toc columns all have no background of their own, so a
48
- configured page background/image shows through all three. */
49
- background-color: var(--wd-page-bg-color);
50
- background-image: var(--wd-page-bg-image);
51
- background-size: cover;
52
- background-position: center;
53
- background-repeat: no-repeat;
54
- background-attachment: fixed;
55
- color: var(--wd-text);
56
- /* --wd-font-family-body/--wd-font-family (BaseLayout.astro's own
57
- define:vars <style> block, driven by theme.fonts - see
58
- resolveFonts()/fontsSchema in lib/config.ts) are always both set to a
59
- real, already-resolved font stack, never left for this rule's own
60
- fallback to cover - an unconfigured site still resolves to Inter here
61
- (genuinely loaded via a Google Fonts <link>, not just named as a
62
- fallback the way this line used to work before theme.fonts existed).
63
- The literal fallback stack below only matters in the narrow window
64
- before that <style> block itself has been parsed. */
65
- font-family: var(--wd-font-family-body, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
66
- line-height: 1.6;
67
- }
68
- a {
69
- color: var(--wd-primary);
70
- }
71
- /* theme.fonts.heading (or the site-wide theme.fonts.family/Inter default,
72
- when no heading-specific override is configured - see
73
- --wd-font-family-heading's own resolution in BaseLayout.astro) - applies
74
- everywhere a heading renders (article prose, the auto-generated
75
- .wd-article-header h1, etc.), not just inside .wd-article specifically,
76
- since nothing site-wide should render headings in a different font by
77
- accident just because it happens to sit outside that one container. */
78
- h1,
79
- h2,
80
- h3,
81
- h4,
82
- h5,
83
- h6 {
84
- font-family: var(--wd-font-family-heading, inherit);
85
- }
86
- /* A page's headings and bold text stand out over its body text (--wd-text).
87
- :where() keeps this at no specificity, so a component's own title color,
88
- or a page's own styles, still win - and it's scoped to the page's article,
89
- so hand-built `mode: custom` pages keep inheriting their own colors. */
90
- :where(.wd-article, .wd-article-header) :where(h1, h2, h3, h4, h5, h6, strong, b) {
91
- color: var(--wd-heading);
92
- }
93
- code {
94
- background: var(--wd-surface);
95
- border: 1px solid var(--wd-border);
96
- padding: 0.15em 0.45em;
97
- border-radius: 0.35em;
98
- font-size: 1em;
99
- font-weight: 500;
100
- }
101
- pre code {
102
- background: none;
103
- border: none;
104
- padding: 0;
105
- font-weight: normal;
106
- }
107
- pre {
108
- padding: 1rem;
109
- border-radius: 0.5rem;
110
- overflow-x: auto;
111
- }
112
-
113
- /* flex: 1 0 auto (not the shorthand `flex: 1` main.wd-shell below also
114
- uses) so this never shrinks below its own natural content height even
115
- inside a flex *column* ancestor shorter than that - see body's own
116
- comment above for the sticky-footer layout this is the growing half
117
- of. */
118
- .wd-page {
119
- display: flex;
120
- flex-direction: column;
121
- flex: 1 0 auto;
122
- }
123
- .wd-shell {
124
- display: flex;
125
- max-width: 1440px;
126
- margin: 0 auto;
127
- width: 100%;
128
- /* Grows to fill .wd-page's remaining height (after the banner/topbar
129
- above it take their own natural height) on a short page - see body's
130
- comment above. .wd-sidebar-col/.wd-toc-col below then stretch to
131
- match *this* element's own height for free, via flexbox's own
132
- default `align-items: stretch` on a row - no min-height of their own
133
- needed (this replaces one on .wd-sidebar-col that used to hardcode
134
- 100vh instead, which overshot on a page with a banner/tall topbar
135
- above it, or undershot the real page height on a page taller than
136
- one viewport). */
137
- flex: 1;
138
- }
139
- .wd-sidebar-col {
140
- width: 260px;
141
- flex-shrink: 0;
142
- border-right: 1px solid var(--wd-border);
143
- }
144
- .wd-main-col {
145
- flex: 1;
146
- min-width: 0;
147
- }
148
- .wd-toc-col {
149
- width: 230px;
150
- flex-shrink: 0;
151
- border-left: 1px solid var(--wd-border);
152
- }
153
- @media (max-width: 1150px) {
154
- .wd-toc-col {
155
- display: none;
156
- }
157
- }
158
- @media (max-width: 860px) {
159
- .wd-shell {
160
- flex-direction: column;
161
- }
162
- /* The sidebar itself no longer stacks full-width above the page content
163
- at this width - it moved into MobileMenu.astro's own panel instead
164
- (see its own <slot name="sidebar" /> copy), which renders its own
165
- second copy of the same sidebar content. This copy (inside
166
- .wd-sidebar-col) just disappears rather than being repositioned. */
167
- .wd-sidebar-col {
168
- display: none;
169
- }
170
- /* Sidebar.astro's .wd-sidebar is sticky-with-its-own-scrollbar on wide
171
- screens (see its own style block for why) - not appropriate for the
172
- copy now living inside MobileMenu.astro's own scroll area, which
173
- already has its own scroll area; this makes it flow as a plain block
174
- there instead of trying to run a second, nested one. This selector
175
- reaches into Sidebar.astro's own scoped class from a plain external
176
- stylesheet - works with no special syntax needed (unlike the
177
- :global() wrapper this rule needed back when it lived in BaseLayout's
178
- own scoped <style> block), since a plain .css file was never scoped
179
- to begin with. */
180
- .wd-sidebar {
181
- position: static;
182
- max-height: none;
183
- overflow-y: visible;
184
- }
185
- }
186
-
187
- /* Dual light/dark logo: both <img> tags are always in the markup (see
188
- TopBar.astro/MobileMenu.astro/SiteFooter.astro, all three of which
189
- render this same pair), CSS shows only the one matching the active
190
- [data-theme] - set by the inline anti-FOUC script in BaseLayout's
191
- <head> + the theme-toggle click handler (src/scripts/theme-toggle.ts).
192
- A site that only gave one logo path gets the same <img> rendered twice
193
- with both classes worth of visibility rules, i.e. it's just always
194
- shown. Kept here (not co-located with any one of the three components
195
- above) since all three need it identically. */
196
- .wd-logo-dark {
197
- display: none;
198
- }
199
- [data-theme="dark"] .wd-logo-light {
200
- display: none;
201
- }
202
- [data-theme="dark"] .wd-logo-dark {
203
- display: block;
204
- }
205
-
206
- /* Same dual-image/CSS-toggle mechanism as the logo pair above, for the
207
- "Powered by writedocs" sidebar watermark (Sidebar.astro) - kept as
208
- plain global rules here rather than a `:global()`-wrapped selector
209
- inside that component's own scoped <style> block, matching this
210
- proven pattern exactly instead of a second, more exotic variant of
211
- it. */
212
- .wd-watermark-dark {
213
- display: none;
214
- }
215
- [data-theme="dark"] .wd-watermark-light {
216
- display: none;
217
- }
218
- [data-theme="dark"] .wd-watermark-dark {
219
- display: block;
220
- }
221
-
222
- /* Astro's Shiki output (both the built-in MDX code-fence pipeline,
223
- configured with dual themes in astro.config.mjs, and the <Code />
224
- component used for the API playground's request/response snippets)
225
- bakes the "light" theme as each element's base color/background and
226
- stashes the dark equivalents in --shiki-dark/--shiki-dark-bg custom
227
- properties. Swapping to those on [data-theme='dark'] is the officially
228
- documented way to make Shiki-highlighted code follow a manual
229
- (non-media-query) theme toggle - see
230
- https://docs.astro.build/en/guides/syntax-highlighting/#setting-light-and-dark-mode-themes.
231
- Site-wide/article-content concern, unrelated to any one layout
232
- component, which is why it lives here rather than in any of the
233
- feature-specific stylesheets. */
234
- [data-theme="dark"] .astro-code,
235
- [data-theme="dark"] .astro-code span {
236
- color: var(--shiki-dark) !important;
237
- background-color: var(--shiki-dark-bg) !important;
238
- font-style: var(--shiki-dark-font-style) !important;
239
- font-weight: var(--shiki-dark-font-weight) !important;
240
- text-decoration: var(--shiki-dark-text-decoration) !important;
241
- }
242
-
243
- /* An icon given as an image URL or path (resolveIcon()'s 'image' kind,
244
- rendered by AppIcon.astro) - 1em square inside its caller's own icon
245
- span, so it sizes like a glyph icon would. Lives here rather than in
246
- AppIcon.astro so it's part of the shared stylesheet, not an inline
247
- <style> added to every page. */
248
- /* An image the build gave its file's width and height
249
- (lib/rehype-image-loading.js): those attributes reserve its place while
250
- it loads, and this keeps its height following its width when it's shown
251
- narrower than the file - without it, the height attribute would stretch
252
- it. :where() adds no specificity, so any rule that sets a height wins. */
253
- /* The note for AI agents at the top of every page (lib/agent-directive.js):
254
- in the HTML, where an agent reads it, and out of sight. Clipped rather
255
- than display: none, which HTML-to-text converters often drop. */
256
- .wd-agent-note {
257
- position: absolute;
258
- width: 1px;
259
- height: 1px;
260
- margin: -1px;
261
- padding: 0;
262
- overflow: hidden;
263
- clip: rect(0 0 0 0);
264
- clip-path: inset(50%);
265
- white-space: nowrap;
266
- border: 0;
267
- }
268
- /* The logo has a width beside its height (logoWidth(), lib/image-size.js)
269
- so its place is kept while it loads. `width: auto` lets a site's own CSS
270
- change its height without squeezing it - the two attributes still tell
271
- the browser its proportions. */
272
- :where(.wd-logo-light, .wd-logo-dark) {
273
- width: auto;
274
- }
275
- :where(img[data-wd-sized]) {
276
- height: auto;
277
- }
278
- img.wd-icon-img {
279
- display: block;
280
- width: 1em;
281
- height: 1em;
282
- object-fit: contain;
283
- }
284
-
285
- /* Scrollbars of the columns beside the page - the sidebar, the table of
286
- contents, the mobile menu and its option lists: a thin pill in the
287
- site's muted text color on no track, faint while the pointer is
288
- elsewhere, clearer over the column, strongest on the pill itself.
289
- Chromium and Safari draw it from the ::-webkit-scrollbar rules (the
290
- standard scrollbar-color/-width would switch those off in Chromium, and
291
- can't make it this thin); Firefox, which has only the standard ones,
292
- gets its thin scrollbar in the same colors. */
293
- :root {
294
- --wd-scrollbar-thumb: color-mix(in srgb, var(--wd-text-muted) 22%, transparent);
295
- --wd-scrollbar-thumb-near: color-mix(in srgb, var(--wd-text-muted) 45%, transparent);
296
- --wd-scrollbar-thumb-active: color-mix(in srgb, var(--wd-text-muted) 70%, transparent);
297
- }
298
- :is(.wd-sidebar, .wd-toc, .wd-mobile-menu-scroll, .wd-mobile-accordion-options-panel)::-webkit-scrollbar {
299
- width: 10px;
300
- height: 10px;
301
- }
302
- :is(.wd-sidebar, .wd-toc, .wd-mobile-menu-scroll, .wd-mobile-accordion-options-panel)::-webkit-scrollbar-track {
303
- background: transparent;
304
- }
305
- :is(.wd-sidebar, .wd-toc, .wd-mobile-menu-scroll, .wd-mobile-accordion-options-panel)::-webkit-scrollbar-thumb {
306
- background: var(--wd-scrollbar-thumb);
307
- /* A 6px pill with 2px of air on each side - off the column's border line. */
308
- border: 2px solid transparent;
309
- background-clip: padding-box;
310
- border-radius: 999px;
311
- }
312
- :is(.wd-sidebar, .wd-toc, .wd-mobile-menu-scroll, .wd-mobile-accordion-options-panel):hover::-webkit-scrollbar-thumb {
313
- background: var(--wd-scrollbar-thumb-near);
314
- }
315
- :is(.wd-sidebar, .wd-toc, .wd-mobile-menu-scroll, .wd-mobile-accordion-options-panel)::-webkit-scrollbar-thumb:hover,
316
- :is(.wd-sidebar, .wd-toc, .wd-mobile-menu-scroll, .wd-mobile-accordion-options-panel)::-webkit-scrollbar-thumb:active {
317
- background: var(--wd-scrollbar-thumb-active);
318
- }
319
- @supports not selector(::-webkit-scrollbar) {
320
- :is(.wd-sidebar, .wd-toc, .wd-mobile-menu-scroll, .wd-mobile-accordion-options-panel) {
321
- scrollbar-width: thin;
322
- scrollbar-color: var(--wd-scrollbar-thumb) transparent;
323
- }
324
- :is(.wd-sidebar, .wd-toc, .wd-mobile-menu-scroll, .wd-mobile-accordion-options-panel):hover {
325
- scrollbar-color: var(--wd-scrollbar-thumb-near) transparent;
326
- }
327
- }
1
+ /* Base element styles + the .wd-shell three-column layout (sidebar / main
2
+ / toc) - imported once by BaseLayout.astro. Everything here consumes the
3
+ semantic --wd-* custom properties (--wd-primary, --wd-background, etc.)
4
+ set on :root by BaseLayout's own inline <style define:vars> block, not
5
+ the raw wdPrimaryLight/wdPrimaryDark values themselves - so, unlike that
6
+ block, none of this needs to live inside an .astro file's own scoped
7
+ <style> to work. A plain imported .css file is never scoped by Astro in
8
+ the first place, so every selector below is already effectively global -
9
+ no :global() wrapper needed (and, if left in by mistake, :global(...) is
10
+ not valid CSS outside Astro's own scoped-<style> processing, so a rule
11
+ written that way here would just silently never match anything). */
12
+
13
+ * {
14
+ box-sizing: border-box;
15
+ }
16
+ body {
17
+ margin: 0;
18
+ /* Sticky-footer layout: body is the flex column, .wd-page (everything
19
+ above the footer - banner/topbar/.wd-shell, see BaseLayout.astro) is
20
+ its flex: 1 0 auto item below, and <footer class="wd-footer"> is a
21
+ plain sibling after it - on a page short enough not to need
22
+ scrolling, .wd-page's flex-grow fills the leftover space down to the
23
+ viewport's bottom edge, pushing the footer flush against it (rather
24
+ than the footer trailing right after a half-empty page with its own
25
+ background peeking through beneath it); on a page tall enough to
26
+ already fill/exceed the viewport, .wd-page just settles at its own
27
+ natural (larger) height and the footer trails normally at the real
28
+ end of the document, exactly as before this rule existed. Doesn't
29
+ apply in `mode: "blank"` (no .wd-page wrapper, no footer at all in
30
+ that branch - see BaseLayout.astro) - a blank page already controls
31
+ 100% of its own layout.
32
+ */
33
+ display: flex;
34
+ flex-direction: column;
35
+ min-height: 100vh;
36
+ /* theme.background (writedocs.json) - --wd-page-bg-color/--wd-page-bg-image
37
+ default to the same value as --wd-background/'none' (see
38
+ BaseLayout.astro's lightPageBgColor/lightPageBgImage resolution), so
39
+ an unconfigured site renders identically to a plain background: var(
40
+ --wd-background) rule. background-attachment: fixed keeps a
41
+ configured image sized to the viewport rather than the full
42
+ (possibly very tall) document - the more expected look for a
43
+ decorative page background, not something that stretches/tiles
44
+ across a long scrolling doc. The topbar and footer each get their
45
+ own explicit opaque background (topbar.css, footer.css)
46
+ specifically so this doesn't show through them - the sidebar, main
47
+ content, and toc columns all have no background of their own, so a
48
+ configured page background/image shows through all three. */
49
+ background-color: var(--wd-page-bg-color);
50
+ background-image: var(--wd-page-bg-image);
51
+ background-size: cover;
52
+ background-position: center;
53
+ background-repeat: no-repeat;
54
+ background-attachment: fixed;
55
+ color: var(--wd-text);
56
+ /* --wd-font-family-body/--wd-font-family (BaseLayout.astro's own
57
+ define:vars <style> block, driven by theme.fonts - see
58
+ resolveFonts()/fontsSchema in lib/config.ts) are always both set to a
59
+ real, already-resolved font stack, never left for this rule's own
60
+ fallback to cover - an unconfigured site still resolves to Inter here
61
+ (genuinely loaded via a Google Fonts <link>, not just named as a
62
+ fallback the way this line used to work before theme.fonts existed).
63
+ The literal fallback stack below only matters in the narrow window
64
+ before that <style> block itself has been parsed. */
65
+ font-family: var(--wd-font-family-body, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
66
+ line-height: 1.6;
67
+ }
68
+ a {
69
+ color: var(--wd-primary);
70
+ }
71
+ /* theme.fonts.heading (or the site-wide theme.fonts.family/Inter default,
72
+ when no heading-specific override is configured - see
73
+ --wd-font-family-heading's own resolution in BaseLayout.astro) - applies
74
+ everywhere a heading renders (article prose, the auto-generated
75
+ .wd-article-header h1, etc.), not just inside .wd-article specifically,
76
+ since nothing site-wide should render headings in a different font by
77
+ accident just because it happens to sit outside that one container. */
78
+ h1,
79
+ h2,
80
+ h3,
81
+ h4,
82
+ h5,
83
+ h6 {
84
+ font-family: var(--wd-font-family-heading, inherit);
85
+ }
86
+ /* A page's headings and bold text stand out over its body text (--wd-text).
87
+ :where() keeps this at no specificity, so a component's own title color,
88
+ or a page's own styles, still win - and it's scoped to the page's article,
89
+ so hand-built `mode: custom` pages keep inheriting their own colors. */
90
+ :where(.wd-article, .wd-article-header) :where(h1, h2, h3, h4, h5, h6, strong, b) {
91
+ color: var(--wd-heading);
92
+ }
93
+ code {
94
+ background: var(--wd-surface);
95
+ border: 1px solid var(--wd-border);
96
+ padding: 0.15em 0.45em;
97
+ border-radius: 0.35em;
98
+ font-size: 1em;
99
+ font-weight: 500;
100
+ }
101
+ pre code {
102
+ background: none;
103
+ border: none;
104
+ padding: 0;
105
+ font-weight: normal;
106
+ }
107
+ pre {
108
+ padding: 1rem;
109
+ border-radius: 0.5rem;
110
+ overflow-x: auto;
111
+ }
112
+
113
+ /* flex: 1 0 auto (not the shorthand `flex: 1` main.wd-shell below also
114
+ uses) so this never shrinks below its own natural content height even
115
+ inside a flex *column* ancestor shorter than that - see body's own
116
+ comment above for the sticky-footer layout this is the growing half
117
+ of. */
118
+ .wd-page {
119
+ display: flex;
120
+ flex-direction: column;
121
+ flex: 1 0 auto;
122
+ }
123
+ .wd-shell {
124
+ display: flex;
125
+ max-width: 1440px;
126
+ margin: 0 auto;
127
+ width: 100%;
128
+ /* Grows to fill .wd-page's remaining height (after the banner/topbar
129
+ above it take their own natural height) on a short page - see body's
130
+ comment above. .wd-sidebar-col/.wd-toc-col below then stretch to
131
+ match *this* element's own height for free, via flexbox's own
132
+ default `align-items: stretch` on a row - no min-height of their own
133
+ needed (this replaces one on .wd-sidebar-col that used to hardcode
134
+ 100vh instead, which overshot on a page with a banner/tall topbar
135
+ above it, or undershot the real page height on a page taller than
136
+ one viewport). */
137
+ flex: 1;
138
+ }
139
+ .wd-sidebar-col {
140
+ width: 260px;
141
+ flex-shrink: 0;
142
+ border-right: 1px solid var(--wd-border);
143
+ }
144
+ .wd-main-col {
145
+ flex: 1;
146
+ min-width: 0;
147
+ }
148
+ .wd-toc-col {
149
+ width: 230px;
150
+ flex-shrink: 0;
151
+ border-left: 1px solid var(--wd-border);
152
+ }
153
+ @media (max-width: 1150px) {
154
+ .wd-toc-col {
155
+ display: none;
156
+ }
157
+ }
158
+ @media (max-width: 860px) {
159
+ .wd-shell {
160
+ flex-direction: column;
161
+ }
162
+ /* The sidebar doesn't stack full-width above the page content at this
163
+ width - it's shown in MobileMenu.astro's panel instead, which the
164
+ menu's script moves it into when it opens (src/scripts/mobile-menu.ts).
165
+ Its column just disappears. */
166
+ .wd-sidebar-col {
167
+ display: none;
168
+ }
169
+ /* Sidebar.astro's .wd-sidebar is sticky-with-its-own-scrollbar on wide
170
+ screens (see its own style block for why) - not appropriate inside
171
+ MobileMenu.astro's panel, which already has its own scroll area; this
172
+ makes it flow as a plain block
173
+ there instead of trying to run a second, nested one. This selector
174
+ reaches into Sidebar.astro's own scoped class from a plain external
175
+ stylesheet - works with no special syntax needed (unlike the
176
+ :global() wrapper this rule needed back when it lived in BaseLayout's
177
+ own scoped <style> block), since a plain .css file was never scoped
178
+ to begin with. */
179
+ .wd-sidebar {
180
+ position: static;
181
+ max-height: none;
182
+ overflow-y: visible;
183
+ }
184
+ }
185
+
186
+ /* Dual light/dark logo: both <img> tags are always in the markup (see
187
+ TopBar.astro/MobileMenu.astro/SiteFooter.astro, all three of which
188
+ render this same pair), CSS shows only the one matching the active
189
+ [data-theme] - set by the inline anti-FOUC script in BaseLayout's
190
+ <head> + the theme-toggle click handler (src/scripts/theme-toggle.ts).
191
+ A site that only gave one logo path gets the same <img> rendered twice
192
+ with both classes worth of visibility rules, i.e. it's just always
193
+ shown. Kept here (not co-located with any one of the three components
194
+ above) since all three need it identically. */
195
+ .wd-logo-dark {
196
+ display: none;
197
+ }
198
+ [data-theme="dark"] .wd-logo-light {
199
+ display: none;
200
+ }
201
+ [data-theme="dark"] .wd-logo-dark {
202
+ display: block;
203
+ }
204
+
205
+ /* Same dual-image/CSS-toggle mechanism as the logo pair above, for the
206
+ "Powered by writedocs" sidebar watermark (Sidebar.astro) - kept as
207
+ plain global rules here rather than a `:global()`-wrapped selector
208
+ inside that component's own scoped <style> block, matching this
209
+ proven pattern exactly instead of a second, more exotic variant of
210
+ it. */
211
+ .wd-watermark-dark {
212
+ display: none;
213
+ }
214
+ [data-theme="dark"] .wd-watermark-light {
215
+ display: none;
216
+ }
217
+ [data-theme="dark"] .wd-watermark-dark {
218
+ display: block;
219
+ }
220
+
221
+ /* Astro's Shiki output (both the built-in MDX code-fence pipeline,
222
+ configured with dual themes in astro.config.mjs, and the <Code />
223
+ component used for the API playground's request/response snippets)
224
+ bakes the "light" theme as each element's base color/background and
225
+ stashes the dark equivalents in --shiki-dark/--shiki-dark-bg custom
226
+ properties. Swapping to those on [data-theme='dark'] is the officially
227
+ documented way to make Shiki-highlighted code follow a manual
228
+ (non-media-query) theme toggle - see
229
+ https://docs.astro.build/en/guides/syntax-highlighting/#setting-light-and-dark-mode-themes.
230
+ Site-wide/article-content concern, unrelated to any one layout
231
+ component, which is why it lives here rather than in any of the
232
+ feature-specific stylesheets. */
233
+ [data-theme="dark"] .astro-code,
234
+ [data-theme="dark"] .astro-code span {
235
+ color: var(--shiki-dark) !important;
236
+ background-color: var(--shiki-dark-bg) !important;
237
+ font-style: var(--shiki-dark-font-style) !important;
238
+ font-weight: var(--shiki-dark-font-weight) !important;
239
+ text-decoration: var(--shiki-dark-text-decoration) !important;
240
+ }
241
+
242
+ /* An icon given as an image URL or path (resolveIcon()'s 'image' kind,
243
+ rendered by AppIcon.astro) - 1em square inside its caller's own icon
244
+ span, so it sizes like a glyph icon would. Lives here rather than in
245
+ AppIcon.astro so it's part of the shared stylesheet, not an inline
246
+ <style> added to every page. */
247
+ /* An image the build gave its file's width and height
248
+ (lib/rehype-image-loading.js): those attributes reserve its place while
249
+ it loads, and this keeps its height following its width when it's shown
250
+ narrower than the file - without it, the height attribute would stretch
251
+ it. :where() adds no specificity, so any rule that sets a height wins. */
252
+ /* The note for AI agents at the top of every page (lib/agent-directive.js):
253
+ in the HTML, where an agent reads it, and out of sight. Clipped rather
254
+ than display: none, which HTML-to-text converters often drop. */
255
+ .wd-agent-note {
256
+ position: absolute;
257
+ width: 1px;
258
+ height: 1px;
259
+ margin: -1px;
260
+ padding: 0;
261
+ overflow: hidden;
262
+ clip: rect(0 0 0 0);
263
+ clip-path: inset(50%);
264
+ white-space: nowrap;
265
+ border: 0;
266
+ }
267
+ /* The logo has a width beside its height (logoWidth(), lib/image-size.js)
268
+ so its place is kept while it loads. `width: auto` lets a site's own CSS
269
+ change its height without squeezing it - the two attributes still tell
270
+ the browser its proportions. */
271
+ :where(.wd-logo-light, .wd-logo-dark) {
272
+ width: auto;
273
+ }
274
+ :where(img[data-wd-sized]) {
275
+ height: auto;
276
+ }
277
+ img.wd-icon-img {
278
+ display: block;
279
+ width: 1em;
280
+ height: 1em;
281
+ object-fit: contain;
282
+ }
283
+
284
+ /* Scrollbars of the columns beside the page - the sidebar, the table of
285
+ contents, the mobile menu and its option lists: a thin pill in the
286
+ site's muted text color on no track, faint while the pointer is
287
+ elsewhere, clearer over the column, strongest on the pill itself.
288
+ Chromium and Safari draw it from the ::-webkit-scrollbar rules (the
289
+ standard scrollbar-color/-width would switch those off in Chromium, and
290
+ can't make it this thin); Firefox, which has only the standard ones,
291
+ gets its thin scrollbar in the same colors. */
292
+ :root {
293
+ --wd-scrollbar-thumb: color-mix(in srgb, var(--wd-text-muted) 22%, transparent);
294
+ --wd-scrollbar-thumb-near: color-mix(in srgb, var(--wd-text-muted) 45%, transparent);
295
+ --wd-scrollbar-thumb-active: color-mix(in srgb, var(--wd-text-muted) 70%, transparent);
296
+ }
297
+ :is(.wd-sidebar, .wd-toc, .wd-mobile-menu-scroll, .wd-mobile-accordion-options-panel)::-webkit-scrollbar {
298
+ width: 10px;
299
+ height: 10px;
300
+ }
301
+ :is(.wd-sidebar, .wd-toc, .wd-mobile-menu-scroll, .wd-mobile-accordion-options-panel)::-webkit-scrollbar-track {
302
+ background: transparent;
303
+ }
304
+ :is(.wd-sidebar, .wd-toc, .wd-mobile-menu-scroll, .wd-mobile-accordion-options-panel)::-webkit-scrollbar-thumb {
305
+ background: var(--wd-scrollbar-thumb);
306
+ /* A 6px pill with 2px of air on each side - off the column's border line. */
307
+ border: 2px solid transparent;
308
+ background-clip: padding-box;
309
+ border-radius: 999px;
310
+ }
311
+ :is(.wd-sidebar, .wd-toc, .wd-mobile-menu-scroll, .wd-mobile-accordion-options-panel):hover::-webkit-scrollbar-thumb {
312
+ background: var(--wd-scrollbar-thumb-near);
313
+ }
314
+ :is(.wd-sidebar, .wd-toc, .wd-mobile-menu-scroll, .wd-mobile-accordion-options-panel)::-webkit-scrollbar-thumb:hover,
315
+ :is(.wd-sidebar, .wd-toc, .wd-mobile-menu-scroll, .wd-mobile-accordion-options-panel)::-webkit-scrollbar-thumb:active {
316
+ background: var(--wd-scrollbar-thumb-active);
317
+ }
318
+ @supports not selector(::-webkit-scrollbar) {
319
+ :is(.wd-sidebar, .wd-toc, .wd-mobile-menu-scroll, .wd-mobile-accordion-options-panel) {
320
+ scrollbar-width: thin;
321
+ scrollbar-color: var(--wd-scrollbar-thumb) transparent;
322
+ }
323
+ :is(.wd-sidebar, .wd-toc, .wd-mobile-menu-scroll, .wd-mobile-accordion-options-panel):hover {
324
+ scrollbar-color: var(--wd-scrollbar-thumb-near) transparent;
325
+ }
326
+ }