@writedocs/generator 0.10.7 → 0.10.9

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@writedocs/generator",
3
- "version": "0.10.7",
3
+ "version": "0.10.9",
4
4
  "description": "Static site generator for docs — a writedocs.json + MDX folder in, a static site out.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -144,11 +144,11 @@ const titleId = _titleId ?? slugify(title);
144
144
  }
145
145
  .wd-accordion-description {
146
146
  font-size: 0.85rem;
147
- color: var(--wd-text-muted);
147
+ color: var(--wd-text);
148
148
  }
149
149
  .wd-accordion-title {
150
150
  font-weight: 700;
151
- color: var(--wd-text);
151
+ color: var(--wd-heading);
152
152
  scroll-margin-top: calc(var(--wd-topbar-offset, 5rem) + 1rem);
153
153
  }
154
154
  /* .wd-heading-anchor's base look (color, opacity: 0, transition) comes
@@ -171,7 +171,7 @@ const titleId = _titleId ?? slugify(title);
171
171
  }
172
172
  .wd-accordion-body {
173
173
  padding: 1.1rem 1rem;
174
- color: var(--wd-text-muted);
174
+ color: var(--wd-text);
175
175
  }
176
176
  .wd-accordion-body :global(p:first-child) {
177
177
  margin-top: 0;
@@ -207,7 +207,7 @@ const responseHtml = new Map(await Promise.all(responseEntries.map(async ([statu
207
207
  font-weight: 600;
208
208
  }
209
209
  .wd-api-description {
210
- color: var(--wd-text-muted);
210
+ color: var(--wd-text);
211
211
  margin: 0.9rem 0 0;
212
212
  }
213
213
  .wd-api-section {
@@ -216,7 +216,7 @@ const responseHtml = new Map(await Promise.all(responseEntries.map(async ([statu
216
216
  .wd-api-section h4 {
217
217
  font-size: 1rem;
218
218
  font-weight: 600;
219
- color: var(--wd-text);
219
+ color: var(--wd-heading);
220
220
  margin: 0 0 0.9rem;
221
221
  }
222
222
  .wd-api-content-type {
@@ -272,11 +272,11 @@ const responseHtml = new Map(await Promise.all(responseEntries.map(async ([statu
272
272
  }
273
273
  .wd-api-param-desc {
274
274
  margin: 0.4rem 0 0;
275
- color: var(--wd-text-muted);
275
+ color: var(--wd-text);
276
276
  font-size: 0.88rem;
277
277
  }
278
278
  .wd-api-param-desc-inline {
279
- color: var(--wd-text-muted);
279
+ color: var(--wd-text);
280
280
  font-size: 0.85rem;
281
281
  }
282
282
  /* Sits above a response tab's own schema field list (when there's a
@@ -906,7 +906,7 @@ const securityJson = JSON.stringify(op?.security ?? []);
906
906
  }
907
907
  .wd-api-modal-title-text {
908
908
  font-weight: 600;
909
- color: var(--wd-text);
909
+ color: var(--wd-heading);
910
910
  }
911
911
  /* Only rendered when the operation's request body actually carries a
912
912
  named `examples` map (see requestExampleEntries above) - sits
@@ -110,6 +110,7 @@ const methodClass = methodLower && KNOWN_METHODS.includes(methodLower) ? methodL
110
110
  .wd-card-title {
111
111
  margin: 0;
112
112
  font-size: 1rem;
113
+ color: var(--wd-heading);
113
114
  }
114
115
  .wd-card-method {
115
116
  flex-shrink: 0;
@@ -141,7 +142,7 @@ const methodClass = methodLower && KNOWN_METHODS.includes(methodLower) ? methodL
141
142
  }
142
143
  .wd-card-body {
143
144
  font-size: 0.9rem;
144
- color: var(--wd-text-muted);
145
+ color: var(--wd-text);
145
146
  margin: 0;
146
147
  }
147
148
  .wd-card-body :global(p) {
@@ -152,7 +152,7 @@ const { dropdown = false } = Astro.props as Props;
152
152
  font-family: monospace;
153
153
  font-size: 0.78rem;
154
154
  font-weight: 500;
155
- color: var(--wd-text-muted);
155
+ color: var(--wd-text);
156
156
  white-space: nowrap;
157
157
  cursor: pointer;
158
158
  }
@@ -100,13 +100,13 @@ const { caption, hint } = Astro.props as Props;
100
100
  }
101
101
  .wd-frame-hint {
102
102
  margin: 0.1rem 0.25rem 0.5rem;
103
- color: var(--wd-text-muted);
103
+ color: var(--wd-text);
104
104
  font-size: 0.8rem;
105
105
  }
106
106
  .wd-frame-caption {
107
107
  margin: 0.6rem 0 0;
108
108
  text-align: center;
109
- color: var(--wd-text-muted);
109
+ color: var(--wd-text);
110
110
  font-size: 0.75rem;
111
111
  }
112
112
  </style>
@@ -131,7 +131,7 @@ const valid = /^[\w.-]+\/[\w.-]+$/.test(slug);
131
131
  align-items: center;
132
132
  gap: 0.5rem;
133
133
  font-weight: 600;
134
- color: var(--wd-text);
134
+ color: var(--wd-heading);
135
135
  }
136
136
  :global(svg.wd-github-repo-icon) {
137
137
  width: 1.1rem;
@@ -141,7 +141,7 @@ const valid = /^[\w.-]+\/[\w.-]+$/.test(slug);
141
141
  .wd-github-repo-description {
142
142
  margin: 0.4rem 0 0;
143
143
  font-size: 0.875rem;
144
- color: var(--wd-text-muted);
144
+ color: var(--wd-text);
145
145
  }
146
146
  .wd-github-repo-stats {
147
147
  display: flex;
@@ -142,7 +142,7 @@ const sizeStyle = size ? `--wd-image-size:${size}` : undefined;
142
142
  .wd-image-caption {
143
143
  margin-top: 0.6rem;
144
144
  text-align: center;
145
- color: var(--wd-text-muted);
145
+ color: var(--wd-text);
146
146
  font-size: 0.75rem;
147
147
  }
148
148
  </style>
@@ -139,7 +139,7 @@ const hasDefault = defaultValue !== undefined && defaultValue !== null && defaul
139
139
  color: var(--wd-text-muted);
140
140
  }
141
141
  .wd-parameter-body {
142
- color: var(--wd-text-muted);
142
+ color: var(--wd-text);
143
143
  }
144
144
  .wd-parameter-body :global(p:first-child) {
145
145
  margin-top: 0;
@@ -127,7 +127,7 @@ const showCursor = actions.includes('cursor') && cursorHref !== null && cursorHr
127
127
  .wd-prompt-body {
128
128
  padding: 0 1.1rem 0.9rem;
129
129
  font-size: 0.9rem;
130
- color: var(--wd-text-muted);
130
+ color: var(--wd-text);
131
131
  }
132
132
  .wd-prompt-body :global(p:first-child) {
133
133
  margin-top: 0;
@@ -57,7 +57,7 @@ const { defaultTabIndex = 0 } = Astro.props as Props;
57
57
  padding: 0.5rem 0.9rem;
58
58
  cursor: pointer;
59
59
  font-size: 0.9rem;
60
- color: var(--wd-text-muted);
60
+ color: var(--wd-text);
61
61
  border-bottom: 2px solid transparent;
62
62
  }
63
63
  .wd-tabs-btn {
@@ -56,11 +56,11 @@ const Tag = href ? 'a' : 'div';
56
56
  .wd-tile-title {
57
57
  margin-top: 0.6rem;
58
58
  font-weight: 600;
59
- color: var(--wd-text);
59
+ color: var(--wd-heading);
60
60
  }
61
61
  .wd-tile-description {
62
62
  margin-top: 0.15rem;
63
63
  font-size: 0.875rem;
64
- color: var(--wd-text-muted);
64
+ color: var(--wd-text);
65
65
  }
66
66
  </style>
@@ -122,7 +122,7 @@ const id = _titleId ?? slugify(label);
122
122
  .wd-update-description {
123
123
  margin-top: 0.5rem;
124
124
  font-size: 0.85rem;
125
- color: var(--wd-text-muted);
125
+ color: var(--wd-text);
126
126
  }
127
127
  .wd-update-tags {
128
128
  display: flex;
@@ -130,7 +130,7 @@ const effectiveMuted = muted || autoplay;
130
130
  .wd-video-caption {
131
131
  margin-top: 0.6rem;
132
132
  text-align: center;
133
- color: var(--wd-text-muted);
133
+ color: var(--wd-text);
134
134
  font-size: 0.75rem;
135
135
  }
136
136
  </style>
@@ -17,7 +17,7 @@
17
17
  // component below imports for itself) lives in src/layout/styles/ - this
18
18
  // file is the layout's single entry point/orchestrator, everything else
19
19
  // is a piece it composes.
20
- import fs from 'node:fs';
20
+ import fs from "node:fs";
21
21
  // Named `nodePath`, not the more natural `path` - this component already
22
22
  // destructures a prop called `path` (the current page's own URL path,
23
23
  // see Props below) from Astro.props, which would otherwise shadow a
@@ -26,7 +26,7 @@ import fs from 'node:fs';
26
26
  // ("path.join is not a function") rather than a compile-time error, since
27
27
  // both are just plain identifiers to the bundler. Hit and fixed while
28
28
  // wiring up findRootAssets() below - real bug, not a hypothetical.
29
- import nodePath from 'node:path';
29
+ import nodePath from "node:path";
30
30
  import {
31
31
  resolveSiteUrl,
32
32
  resolveAbsoluteUrl,
@@ -40,8 +40,8 @@ import {
40
40
  type Selector,
41
41
  type GlobalDropdownView,
42
42
  type SeoFields,
43
- } from '../lib/config';
44
- import '../styles/global.css';
43
+ } from "../lib/config";
44
+ import "../styles/global.css";
45
45
  // rehypeKatex (astro.config.mjs) renders every $inline$/$$block$$ math
46
46
  // span into real KaTeX markup at build time - this is the one runtime
47
47
  // dependency that output needs: layout/glyph CSS for the .katex class
@@ -53,9 +53,9 @@ import '../styles/global.css';
53
53
  // output deliberately sets no explicit text color, inheriting `color`
54
54
  // from whatever wraps it - so it already follows this site's light/dark
55
55
  // theme with no extra CSS needed here.
56
- import 'katex/dist/katex.min.css';
57
- import './styles/base.css';
58
- import './styles/banner.css';
56
+ import "katex/dist/katex.min.css";
57
+ import "./styles/base.css";
58
+ import "./styles/banner.css";
59
59
  // Astro's client-side router - swaps <body> content between same-origin
60
60
  // navigations via the native View Transition API instead of a hard
61
61
  // browser reload, so the topbar/sidebar/footer don't visibly flash/
@@ -68,14 +68,14 @@ import './styles/banner.css';
68
68
  // pair) - that event only ever fires when this router is active, so this
69
69
  // was already the intended architecture, just missing this one piece
70
70
  // that actually turns it on.
71
- import { ClientRouter } from 'astro:transitions';
72
- import TopBar from './components/TopBar.astro';
73
- import MobileMenu from './components/MobileMenu.astro';
74
- import SearchModal from './components/SearchModal.astro';
75
- import ImageZoom from './components/ImageZoom.astro';
76
- import SiteFooter from './components/SiteFooter.astro';
77
- import AnalyticsScripts from './components/AnalyticsScripts.astro';
78
- import AskAiWidget from './components/AskAiWidget.astro';
71
+ import { ClientRouter } from "astro:transitions";
72
+ import TopBar from "./components/TopBar.astro";
73
+ import MobileMenu from "./components/MobileMenu.astro";
74
+ import SearchModal from "./components/SearchModal.astro";
75
+ import ImageZoom from "./components/ImageZoom.astro";
76
+ import SiteFooter from "./components/SiteFooter.astro";
77
+ import AnalyticsScripts from "./components/AnalyticsScripts.astro";
78
+ import AskAiWidget from "./components/AskAiWidget.astro";
79
79
 
80
80
  interface Props {
81
81
  config: DocsConfig;
@@ -115,7 +115,7 @@ interface Props {
115
115
  // own to conditionally omit - an unfilled named slot in Astro already
116
116
  // renders nothing, so this component only needs to know whether to
117
117
  // render the *column wrapper divs* at all).
118
- mode?: 'default' | 'wide' | 'frame' | 'custom' | 'blank';
118
+ mode?: "default" | "wide" | "frame" | "custom" | "blank";
119
119
  // The page's language, for <html lang> - the `language` of the
120
120
  // navigation level it belongs to (see [...slug].astro), or 'en'.
121
121
  lang?: string;
@@ -128,23 +128,23 @@ const {
128
128
  seo = {},
129
129
  selectors = [],
130
130
  globalDropdowns = [],
131
- mode = 'default',
132
- lang = 'en',
131
+ mode = "default",
132
+ lang = "en",
133
133
  } = Astro.props as Props;
134
- const showSidebarCol = mode === 'default' || mode === 'wide';
135
- const showTocCol = mode === 'default';
134
+ const showSidebarCol = mode === "default" || mode === "wide";
135
+ const showTocCol = mode === "default";
136
136
  // Meta tag resolution - all derived once here rather than inline in the
137
137
  // template below, so the JSX stays a straight list of conditional <meta>
138
138
  // tags instead of repeating this logic at each call site.
139
139
  const siteUrl = resolveSiteUrl(config);
140
140
  const effectiveDescription = description ?? config.description;
141
141
  const canonicalUrl = siteUrl ? `${siteUrl}${path}` : null;
142
- const ogType = seo.ogType ?? 'website';
142
+ const ogType = seo.ogType ?? "website";
143
143
  const absoluteOgImage = seo.ogImage ? resolveAbsoluteUrl(siteUrl, seo.ogImage) : undefined;
144
144
  // summary_large_image needs a real image to make sense as a card size;
145
145
  // falls back to the smaller "summary" card when no image is set, rather
146
146
  // than always defaulting to the large-image card regardless.
147
- const twitterCard = seo.twitterCard ?? (absoluteOgImage ? 'summary_large_image' : 'summary');
147
+ const twitterCard = seo.twitterCard ?? (absoluteOgImage ? "summary_large_image" : "summary");
148
148
  // Light-mode values come straight from styles.colors/styles.background
149
149
  // (with defaults); dark-mode values fall back to their light counterpart
150
150
  // when the site's own dark override doesn't set them, so a site only has
@@ -159,9 +159,11 @@ const twitterCard = seo.twitterCard ?? (absoluteOgImage ? 'summary_large_image'
159
159
  // into custom-property assignments at all, and that directive only works
160
160
  // on a <style> tag physically inside an .astro file's own template.
161
161
  const lightPrimary = config.styles.colors.primary;
162
- const lightText = config.styles.colors.text ?? '#0f172a';
162
+ const lightText = config.styles.colors.text ?? "#404045";
163
163
  const darkPrimary = config.styles.colors.dark?.primary ?? lightPrimary;
164
- const darkText = config.styles.colors.dark?.text ?? '#e2e8f0';
164
+ // Body text - also the sidebar's and table of contents' links. Headings,
165
+ // bold text and group titles use the stronger --wd-heading (below).
166
+ const darkText = config.styles.colors.dark?.text ?? "#a0a0a5";
165
167
  // Text drawn on the primary color (step numbers, the info banner, the API
166
168
  // playground's buttons) - white, or black on a clearly light primary
167
169
  // (contrastTextColor(), lib/config.ts). It used to be white everywhere,
@@ -177,8 +179,8 @@ const darkOnPrimary = contrastTextColor(darkPrimary);
177
179
  // just the --wd-background half, independent of this - see config.ts's
178
180
  // own comment on why that split was removed; `lightBackground`/
179
181
  // `darkBackground` here is what used to read that other field.
180
- const lightBackground = config.styles.background?.colors?.light ?? '#ffffff';
181
- const darkBackground = config.styles.background?.colors?.dark ?? '#0b1120';
182
+ const lightBackground = config.styles.background?.colors?.light ?? "#ffffff";
183
+ const darkBackground = config.styles.background?.colors?.dark ?? "#0b1120";
182
184
  // The topbar/mobile-menu-panel background - falls back to the page's own
183
185
  // background (above) when a site doesn't set it, so an unconfigured navbar
184
186
  // keeps blending into the page exactly as it always has; only sites that
@@ -218,14 +220,19 @@ const darkNavbarConfigured = config.styles.navbar?.dark !== undefined;
218
220
  // would drag it back toward the background's own hue and undo the
219
221
  // contrast fix) - a plain opacity reduction, so it stays legible
220
222
  // regardless of what hue the navbar itself happens to be.
221
- const lightNavbarFg = lightNavbarConfigured ? contrastTextColor(lightNavbarBg) : 'var(--wd-text)';
222
- const darkNavbarFg = darkNavbarConfigured ? contrastTextColor(darkNavbarBg) : 'var(--wd-text)';
223
+ const lightNavbarFg = lightNavbarConfigured ? contrastTextColor(lightNavbarBg) : "var(--wd-text)";
224
+ const darkNavbarFg = darkNavbarConfigured ? contrastTextColor(darkNavbarBg) : "var(--wd-text)";
225
+ // The current tab (and a hovered one) stands out: the heading color on the
226
+ // page's own background, or the same computed black/white on a configured
227
+ // navbar - which is already the strongest color there.
228
+ const lightNavbarFgStrong = lightNavbarConfigured ? lightNavbarFg : "var(--wd-heading)";
229
+ const darkNavbarFgStrong = darkNavbarConfigured ? darkNavbarFg : "var(--wd-heading)";
223
230
  const lightNavbarFgMuted = lightNavbarConfigured
224
231
  ? `color-mix(in srgb, ${lightNavbarFg} 70%, transparent)`
225
- : 'var(--wd-text-muted)';
232
+ : "var(--wd-text-muted)";
226
233
  const darkNavbarFgMuted = darkNavbarConfigured
227
234
  ? `color-mix(in srgb, ${darkNavbarFg} 70%, transparent)`
228
- : 'var(--wd-text-muted)';
235
+ : "var(--wd-text-muted)";
229
236
  // --wd-navbar-accent: the tab-hover-underline/active-tab-fill color inside
230
237
  // the topbar specifically - `accent` on the object form (a real, legitimate
231
238
  // design choice, unlike text color above), falling back to the sitewide
@@ -246,16 +253,16 @@ const darkNavbarAccent = navDark.accent ?? darkPrimary;
246
253
  // pixel-identical to before this existed.
247
254
  const lightNavbarBorder = lightNavbarConfigured
248
255
  ? `color-mix(in srgb, ${lightNavbarFg} 25%, transparent)`
249
- : 'var(--wd-border)';
256
+ : "var(--wd-border)";
250
257
  const darkNavbarBorder = darkNavbarConfigured
251
258
  ? `color-mix(in srgb, ${darkNavbarFg} 25%, transparent)`
252
- : 'var(--wd-border)';
259
+ : "var(--wd-border)";
253
260
  // --wd-navbar-hover: a topbar tab's background on hover. On a navbar with
254
261
  // the page's own background, the sidebar's hover tint (NavTree.astro) -
255
262
  // the same 6% of --wd-primary. A configured navbar can *be* the primary
256
263
  // color, where that tint would vanish, so there it's a light tint of the
257
264
  // navbar's own contrast-correct text color instead, like --wd-navbar-border.
258
- const sidebarHover = 'color-mix(in srgb, var(--wd-primary) 6%, transparent)';
265
+ const sidebarHover = "color-mix(in srgb, var(--wd-primary) 6%, transparent)";
259
266
  const lightNavbarHover = lightNavbarConfigured ? `color-mix(in srgb, ${lightNavbarFg} 12%, transparent)` : sidebarHover;
260
267
  const darkNavbarHover = darkNavbarConfigured ? `color-mix(in srgb, ${darkNavbarFg} 12%, transparent)` : sidebarHover;
261
268
  // The <body> canvas's own paint - same color as --wd-background above
@@ -270,10 +277,10 @@ const lightPageBgColor = lightBackground;
270
277
  const darkPageBgColor = darkBackground;
271
278
  const lightPageBgImage = config.styles.background?.images?.light
272
279
  ? `url('${config.styles.background.images.light}')`
273
- : 'none';
280
+ : "none";
274
281
  const darkPageBgImage = config.styles.background?.images?.dark
275
282
  ? `url('${config.styles.background.images.dark}')`
276
- : 'none';
283
+ : "none";
277
284
  // A logo is either one path used for both modes, or a {light, dark,
278
285
  // label} object - normalized to a single light/dark pair here (the one
279
286
  // place that needs to know which form writedocs.json used) so TopBar.astro,
@@ -289,9 +296,9 @@ const darkPageBgImage = config.styles.background?.images?.dark
289
296
  // image nor a label falls back to plain config.name text, so the brand
290
297
  // link is never left empty.
291
298
  const logo = config.styles.logo;
292
- const logoLight = typeof logo === 'string' ? logo : logo?.light;
293
- const logoDark = typeof logo === 'string' ? logo : logo?.dark;
294
- const logoLabel = typeof logo === 'string' ? undefined : logo?.label;
299
+ const logoLight = typeof logo === "string" ? logo : logo?.light;
300
+ const logoDark = typeof logo === "string" ? logo : logo?.dark;
301
+ const logoLabel = typeof logo === "string" ? undefined : logo?.label;
295
302
  const hasLogoImage = Boolean(logoLight || logoDark);
296
303
  const brandLabel = logoLabel ?? (hasLogoImage ? undefined : config.name);
297
304
 
@@ -307,12 +314,12 @@ const brandLabel = logoLabel ?? (hasLogoImage ? undefined : config.name);
307
314
  // one alongside or underneath it.
308
315
  const footerLogoConfig = config.footer.logo;
309
316
  const footerLogoLight = footerLogoConfig
310
- ? typeof footerLogoConfig === 'string'
317
+ ? typeof footerLogoConfig === "string"
311
318
  ? footerLogoConfig
312
319
  : footerLogoConfig.light
313
320
  : logoLight;
314
321
  const footerLogoDark = footerLogoConfig
315
- ? typeof footerLogoConfig === 'string'
322
+ ? typeof footerLogoConfig === "string"
316
323
  ? footerLogoConfig
317
324
  : footerLogoConfig.dark
318
325
  : logoDark;
@@ -337,8 +344,12 @@ const rootAssets = findRootAssets(contentDir);
337
344
  // "docs/theme.css") - split and rejoin with nodePath.join rather than
338
345
  // handing the raw string straight to it, so a nested asset resolves
339
346
  // correctly on every OS this might run on, not just POSIX ones.
340
- const rootCssContents = rootAssets.css.map((name) => fs.readFileSync(nodePath.join(contentDir, ...name.split('/')), 'utf-8'));
341
- const rootJsContents = rootAssets.js.map((name) => fs.readFileSync(nodePath.join(contentDir, ...name.split('/')), 'utf-8'));
347
+ const rootCssContents = rootAssets.css.map((name) =>
348
+ fs.readFileSync(nodePath.join(contentDir, ...name.split("/")), "utf-8"),
349
+ );
350
+ const rootJsContents = rootAssets.js.map((name) =>
351
+ fs.readFileSync(nodePath.join(contentDir, ...name.split("/")), "utf-8"),
352
+ );
342
353
  // public/*.css and public/*.js auto-load too, but as <link>/<script src>
343
354
  // pointing at their already-public URL (see findRootAssets()'s own
344
355
  // comment for why - no point inlining a file that's also independently
@@ -385,9 +396,13 @@ const wdFontFamilyBody = resolvedFonts.body ? fontStack(resolvedFonts.body.famil
385
396
  // descriptor, or the Google Fonts URL's `:wght@` axis inside
386
397
  // googleFontsHref() above), not the actual rendered boldness of any
387
398
  // element - see wdFontWeightCss right below for that other half.
388
- const fontFaceCss = [fontFaceRule(resolvedFonts.base), fontFaceRule(resolvedFonts.heading), fontFaceRule(resolvedFonts.body)]
399
+ const fontFaceCss = [
400
+ fontFaceRule(resolvedFonts.base),
401
+ fontFaceRule(resolvedFonts.heading),
402
+ fontFaceRule(resolvedFonts.body),
403
+ ]
389
404
  .filter(Boolean)
390
- .join('\n');
405
+ .join("\n");
391
406
  // Without this, a configured `weight` only ever changed which font *file*
392
407
  // loaded - h1-h6 still rendered at the browser's own default `font-weight:
393
408
  // bold` (a user-agent-stylesheet rule, present regardless of which file
@@ -403,13 +418,14 @@ const fontFaceCss = [fontFaceRule(resolvedFonts.base), fontFaceRule(resolvedFont
403
418
  const wdFontWeightHeading = resolvedFonts.heading?.weight ?? resolvedFonts.base.weight;
404
419
  const wdFontWeightBody = resolvedFonts.body?.weight ?? resolvedFonts.base.weight;
405
420
  const fontWeightCss = [
406
- wdFontWeightHeading !== undefined ? `h1, h2, h3, h4, h5, h6 { font-weight: ${wdFontWeightHeading}; }` : '',
407
- wdFontWeightBody !== undefined ? `body { font-weight: ${wdFontWeightBody}; }` : '',
421
+ wdFontWeightHeading !== undefined ? `h1, h2, h3, h4, h5, h6 { font-weight: ${wdFontWeightHeading}; }` : "",
422
+ wdFontWeightBody !== undefined ? `body { font-weight: ${wdFontWeightBody}; }` : "",
408
423
  ]
409
424
  .filter(Boolean)
410
- .join('\n');
411
- const fontExtraCss = [fontFaceCss, fontWeightCss].filter(Boolean).join('\n');
425
+ .join("\n");
426
+ const fontExtraCss = [fontFaceCss, fontWeightCss].filter(Boolean).join("\n");
412
427
  ---
428
+
413
429
  <!doctype html>
414
430
  <html lang={lang}>
415
431
  <head>
@@ -420,11 +436,12 @@ const fontExtraCss = [fontFaceCss, fontWeightCss].filter(Boolean).join('\n');
420
436
  <title>{title} · {config.name}</title>
421
437
  <ClientRouter />
422
438
  {effectiveDescription && <meta name="description" content={effectiveDescription} />}
423
- {seo.keywords && seo.keywords.length > 0 && <meta name="keywords" content={seo.keywords.join(', ')} />}
439
+ {seo.keywords && seo.keywords.length > 0 && <meta name="keywords" content={seo.keywords.join(", ")} />}
424
440
  {seo.noindex && <meta name="robots" content="noindex, nofollow" />}
425
441
  {canonicalUrl && <link rel="canonical" href={canonicalUrl} />}
426
442
  {config.styles.favicon && <link rel="icon" href={config.styles.favicon} />}
427
- {/* styles.fonts - see resolveFonts()/googleFontsHref() in lib/config.ts.
443
+ {
444
+ /* styles.fonts - see resolveFonts()/googleFontsHref() in lib/config.ts.
428
445
  Present (non-null) whenever at least one configured font (or the
429
446
  Inter default, when styles.fonts is unset entirely) has no `source`
430
447
  - i.e. is a Google Font, auto-loaded by family name. The two
@@ -435,14 +452,17 @@ const fontExtraCss = [fontFaceCss, fontWeightCss].filter(Boolean).join('\n');
435
452
  their fonts. Rendered this early in <head> (right after favicon,
436
453
  before Open Graph/Twitter meta) so the font starts loading as soon
437
454
  as possible rather than competing with less render-critical tags
438
- for bandwidth/priority. */}
439
- {fontsGoogleHref && (
440
- <>
441
- <link rel="preconnect" href="https://fonts.googleapis.com" />
442
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
443
- <link rel="stylesheet" href={fontsGoogleHref} />
444
- </>
445
- )}
455
+ for bandwidth/priority. */
456
+ }
457
+ {
458
+ fontsGoogleHref && (
459
+ <>
460
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
461
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
462
+ <link rel="stylesheet" href={fontsGoogleHref} />
463
+ </>
464
+ )
465
+ }
446
466
  <!-- Open Graph -->
447
467
  <meta property="og:title" content={title} />
448
468
  {effectiveDescription && <meta property="og:description" content={effectiveDescription} />}
@@ -455,12 +475,14 @@ const fontExtraCss = [fontFaceCss, fontWeightCss].filter(Boolean).join('\n');
455
475
  <meta name="twitter:title" content={title} />
456
476
  {effectiveDescription && <meta name="twitter:description" content={effectiveDescription} />}
457
477
  {absoluteOgImage && <meta name="twitter:image" content={absoluteOgImage} />}
458
- {/* writedocs.json's `integrations` (the six analytics providers) - see
478
+ {
479
+ /* writedocs.json's `integrations` (the six analytics providers) - see
459
480
  AnalyticsScripts.astro. Rendered as early in <head> as reasonably
460
481
  possible (right after the meta tags, before even the theme-
461
482
  detection script below) - the usual placement every one of these
462
483
  providers' own install instructions ask for, so pageview timing is
463
- captured as close to actual page load as it can be. */}
484
+ captured as close to actual page load as it can be. */
485
+ }
464
486
  <AnalyticsScripts config={config} />
465
487
  <script is:inline>
466
488
  // Sets [data-theme] and [data-banner-dismissed] on <html> before
@@ -487,22 +509,26 @@ const fontExtraCss = [fontFaceCss, fontWeightCss].filter(Boolean).join('\n');
487
509
  // prevents any visible flash on client-side navigations too.
488
510
  function wdApplyStoredPreferences() {
489
511
  try {
490
- var stored = localStorage.getItem('wd-theme');
491
- var theme = stored === 'light' || stored === 'dark'
492
- ? stored
493
- : (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
512
+ var stored = localStorage.getItem("wd-theme");
513
+ var theme =
514
+ stored === "light" || stored === "dark"
515
+ ? stored
516
+ : window.matchMedia("(prefers-color-scheme: dark)").matches
517
+ ? "dark"
518
+ : "light";
494
519
  document.documentElement.dataset.theme = theme;
495
520
  } catch (e) {
496
- document.documentElement.dataset.theme = 'light';
521
+ document.documentElement.dataset.theme = "light";
497
522
  }
498
523
  try {
499
- document.documentElement.dataset.bannerDismissed = localStorage.getItem('wd-banner-dismissed') === 'true' ? 'true' : 'false';
524
+ document.documentElement.dataset.bannerDismissed =
525
+ localStorage.getItem("wd-banner-dismissed") === "true" ? "true" : "false";
500
526
  } catch (e) {
501
- document.documentElement.dataset.bannerDismissed = 'false';
527
+ document.documentElement.dataset.bannerDismissed = "false";
502
528
  }
503
529
  }
504
530
  wdApplyStoredPreferences();
505
- document.addEventListener('astro:after-swap', wdApplyStoredPreferences);
531
+ document.addEventListener("astro:after-swap", wdApplyStoredPreferences);
506
532
  </script>
507
533
  <script>
508
534
  // Preserves the sidebar's own scroll position across a ClientRouter
@@ -514,10 +540,10 @@ const fontExtraCss = [fontFaceCss, fontWeightCss].filter(Boolean).join('\n');
514
540
  // same reason: after-swap fires before the next paint, so there's no
515
541
  // visible flash of the sidebar sitting at the top before jumping
516
542
  // back to where the reader had it scrolled.
517
- import { saveSidebarScroll, restoreSidebarScroll } from '../scripts/sidebar-scroll';
543
+ import { saveSidebarScroll, restoreSidebarScroll } from "../scripts/sidebar-scroll";
518
544
 
519
- document.addEventListener('astro:before-swap', saveSidebarScroll);
520
- document.addEventListener('astro:after-swap', restoreSidebarScroll);
545
+ document.addEventListener("astro:before-swap", saveSidebarScroll);
546
+ document.addEventListener("astro:after-swap", restoreSidebarScroll);
521
547
  </script>
522
548
  <style
523
549
  define:vars={{
@@ -527,6 +553,7 @@ const fontExtraCss = [fontFaceCss, fontWeightCss].filter(Boolean).join('\n');
527
553
  wdTextLight: lightText,
528
554
  wdNavbarLight: lightNavbarBg,
529
555
  wdNavbarFgLight: lightNavbarFg,
556
+ wdNavbarFgStrongLight: lightNavbarFgStrong,
530
557
  wdNavbarFgMutedLight: lightNavbarFgMuted,
531
558
  wdNavbarAccentLight: lightNavbarAccent,
532
559
  wdNavbarBorderLight: lightNavbarBorder,
@@ -542,6 +569,7 @@ const fontExtraCss = [fontFaceCss, fontWeightCss].filter(Boolean).join('\n');
542
569
  wdTextDark: darkText,
543
570
  wdNavbarDark: darkNavbarBg,
544
571
  wdNavbarFgDark: darkNavbarFg,
572
+ wdNavbarFgStrongDark: darkNavbarFgStrong,
545
573
  wdNavbarFgMutedDark: darkNavbarFgMuted,
546
574
  wdNavbarAccentDark: darkNavbarAccent,
547
575
  wdNavbarBorderDark: darkNavbarBorder,
@@ -557,6 +585,7 @@ const fontExtraCss = [fontFaceCss, fontWeightCss].filter(Boolean).join('\n');
557
585
  --wd-text: var(--wdTextLight);
558
586
  --wd-navbar-background: var(--wdNavbarLight);
559
587
  --wd-navbar-foreground: var(--wdNavbarFgLight);
588
+ --wd-navbar-foreground-strong: var(--wdNavbarFgStrongLight);
560
589
  --wd-navbar-foreground-muted: var(--wdNavbarFgMutedLight);
561
590
  --wd-navbar-accent: var(--wdNavbarAccentLight);
562
591
  --wd-navbar-border: var(--wdNavbarBorderLight);
@@ -564,6 +593,12 @@ const fontExtraCss = [fontFaceCss, fontWeightCss].filter(Boolean).join('\n');
564
593
  --wd-page-bg-color: var(--wdPageBgColorLight);
565
594
  --wd-page-bg-image: var(--wdPageBgImageLight);
566
595
  --wd-text-muted: #64748b;
596
+ /* Headings, bold text, card titles, and the sidebar's group titles -
597
+ a stronger color than body text (--wd-text), which the sidebar's
598
+ and table of contents' links use (--wd-nav-text). */
599
+ --wd-heading: #18191d;
600
+ --wd-nav-title: var(--wd-heading);
601
+ --wd-nav-text: var(--wd-text);
567
602
  --wd-border: #e2e8f0;
568
603
  --wd-surface: #f8fafc;
569
604
  /* The browser's own controls - the page's scrollbar, a code block's -
@@ -582,13 +617,14 @@ const fontExtraCss = [fontFaceCss, fontWeightCss].filter(Boolean).join('\n');
582
617
  regardless of source order once data-theme is set to "dark" by
583
618
  the inline script above or the toggle button's click handler
584
619
  (src/scripts/theme-toggle.ts). */
585
- :root[data-theme='dark'] {
620
+ :root[data-theme="dark"] {
586
621
  --wd-primary: var(--wdPrimaryDark);
587
622
  --wd-on-primary: var(--wdOnPrimaryDark);
588
623
  --wd-background: var(--wdBackgroundDark);
589
624
  --wd-text: var(--wdTextDark);
590
625
  --wd-navbar-background: var(--wdNavbarDark);
591
626
  --wd-navbar-foreground: var(--wdNavbarFgDark);
627
+ --wd-navbar-foreground-strong: var(--wdNavbarFgStrongDark);
592
628
  --wd-navbar-foreground-muted: var(--wdNavbarFgMutedDark);
593
629
  --wd-navbar-accent: var(--wdNavbarAccentDark);
594
630
  --wd-navbar-border: var(--wdNavbarBorderDark);
@@ -596,12 +632,14 @@ const fontExtraCss = [fontFaceCss, fontWeightCss].filter(Boolean).join('\n');
596
632
  --wd-page-bg-color: var(--wdPageBgColorDark);
597
633
  --wd-page-bg-image: var(--wdPageBgImageDark);
598
634
  --wd-text-muted: #94a3b8;
635
+ --wd-heading: #e0e0e5;
599
636
  --wd-border: #1e293b;
600
637
  --wd-surface: #131a2b;
601
638
  color-scheme: dark;
602
639
  }
603
640
  </style>
604
- {/* styles.fonts: local/externally-hosted font(s) (fontFaceRule() in
641
+ {
642
+ /* styles.fonts: local/externally-hosted font(s) (fontFaceRule() in
605
643
  lib/config.ts - a local `source` path resolves the same way
606
644
  styles.favicon/styles.logo/styles.background.images already do, see
607
645
  collectConfiguredAssetPaths() + styles-asset-integration.js, no
@@ -615,17 +653,23 @@ const fontExtraCss = [fontFaceCss, fontWeightCss].filter(Boolean).join('\n');
615
653
  bare `h1, h2, ...` selector list assembled as a runtime string -
616
654
  empty string renders nothing when neither piece has anything to
617
655
  contribute (every configured font is a Google Font, and no
618
- `weight` was set anywhere in `styles.fonts`). */}
656
+ `weight` was set anywhere in `styles.fonts`). */
657
+ }
619
658
  {fontExtraCss && <style set:html={fontExtraCss} />}
620
- {/* writedocs.json's `scripts.head` - see scriptEntrySchema in lib/config.ts.
659
+ {
660
+ /* writedocs.json's `scripts.head` - see scriptEntrySchema in lib/config.ts.
621
661
  Each entry is exactly one of an external/local `src` or inline
622
662
  `content` (enforced by the schema's own .refine()), rendered right
623
663
  before </head> so it runs before body content paints - the usual
624
- spot a third-party script's own install instructions ask for. */}
625
- {config.scripts.head.map((s) =>
626
- s.src ? <script is:inline src={s.src} /> : <script is:inline set:html={s.content} />
627
- )}
628
- {/* Zero-config custom CSS - see findRootAssets() in lib/pages.js and
664
+ spot a third-party script's own install instructions ask for. */
665
+ }
666
+ {
667
+ config.scripts.head.map((s) =>
668
+ s.src ? <script is:inline src={s.src} /> : <script is:inline set:html={s.content} />,
669
+ )
670
+ }
671
+ {
672
+ /* Zero-config custom CSS - see findRootAssets() in lib/pages.js and
629
673
  rootCssContents above. Rendered last in <head>, so a project-owned
630
674
  file - anywhere in the project, not just the root - wins over
631
675
  everything else writedocs generates itself. Inlined as raw <style>
@@ -634,107 +678,123 @@ const fontExtraCss = [fontFaceCss, fontWeightCss].filter(Boolean).join('\n');
634
678
  independently fetchable as a URL; inlining sidesteps needing one.
635
679
  One <style> tag per file (not concatenated) so each is independently
636
680
  visible/attributable
637
- in devtools. */}
638
- {rootCssContents.map((content) => (
639
- <style is:inline set:html={content} />
640
- ))}
641
- {/* Zero-config custom CSS living in public/ - see findRootAssets()'s
681
+ in devtools. */
682
+ }
683
+ {rootCssContents.map((content) => <style is:inline set:html={content} />)}
684
+ {
685
+ /* Zero-config custom CSS living in public/ - see findRootAssets()'s
642
686
  own comment in lib/pages.js for why these render as <link> tags
643
687
  pointing at their already-public URL instead of joining
644
- rootCssContents above as inlined content. */}
645
- {publicCssHrefs.map((href) => (
646
- <link rel="stylesheet" href={href} />
647
- ))}
688
+ rootCssContents above as inlined content. */
689
+ }
690
+ {publicCssHrefs.map((href) => <link rel="stylesheet" href={href} />)}
648
691
  </head>
649
692
  <body>
650
- {mode === 'blank' ? (
651
- // No site chrome at all - no topbar, no sidebar/toc columns, not
652
- // even the .wd-shell wrapper's own max-width - the page's own
653
- // MDX/components control 100% of the layout, including whether
654
- // there's any nav/branding at all. SearchModal.astro's own overlay
655
- // markup and its ⌘K listener still work even with no visible
656
- // trigger button to click (it's rendered unconditionally below,
657
- // outside this mode === 'blank' branch), so that's left in rather
658
- // than also gated on mode.
659
- <slot />
660
- ) : (
661
- <Fragment>
662
- {/* Everything above the footer, in one wrapper - see .wd-page/body in
693
+ {
694
+ mode === "blank" ? (
695
+ // No site chrome at all - no topbar, no sidebar/toc columns, not
696
+ // even the .wd-shell wrapper's own max-width - the page's own
697
+ // MDX/components control 100% of the layout, including whether
698
+ // there's any nav/branding at all. SearchModal.astro's own overlay
699
+ // markup and its ⌘K listener still work even with no visible
700
+ // trigger button to click (it's rendered unconditionally below,
701
+ // outside this mode === 'blank' branch), so that's left in rather
702
+ // than also gated on mode.
703
+ <slot />
704
+ ) : (
705
+ <Fragment>
706
+ {/* Everything above the footer, in one wrapper - see .wd-page/body in
663
707
  base.css: body is a flex column, this is its flex: 1 0 auto item,
664
708
  and the footer (a plain sibling below, not inside this wrapper) is
665
709
  what that pushes down to the viewport's bottom edge on a page
666
710
  short enough not to need scrolling - the "sticky footer" pattern,
667
711
  not position: sticky/fixed (either of which would cover page
668
712
  content instead of just trailing it once actually reached). */}
669
- <div class="wd-page">
670
- {config.banner && (
671
- <div class={`wd-banner wd-banner-${config.banner.type}`} id="wd-banner">
672
- <div class="wd-banner-inner">
673
- <span class="wd-banner-content">{config.banner.content}</span>
674
- {config.banner.dismissible && (
675
- <button type="button" class="wd-banner-dismiss" aria-label="Dismiss banner" data-banner-dismiss>
676
- &times;
677
- </button>
678
- )}
679
- </div>
680
- </div>
681
- )}
682
- <TopBar
683
- config={config}
684
- selectors={selectors}
685
- globalDropdowns={globalDropdowns}
686
- showSidebarCol={showSidebarCol}
687
- logoLight={logoLight}
688
- logoDark={logoDark}
689
- brandLabel={brandLabel}
690
- />
691
- <MobileMenu
692
- config={config}
693
- selectors={selectors}
694
- globalDropdowns={globalDropdowns}
695
- showSidebarCol={showSidebarCol}
696
- logoLight={logoLight}
697
- logoDark={logoDark}
698
- brandLabel={brandLabel}
699
- >
700
- <slot name="sidebar" slot="sidebar" />
701
- </MobileMenu>
702
- <div class="wd-shell">
703
- {showSidebarCol && <div class="wd-sidebar-col"><slot name="sidebar" /></div>}
704
- <div class="wd-main-col"><slot /></div>
705
- {showTocCol && <div class="wd-toc-col"><slot name="toc" /></div>}
706
- </div>
707
- </div>
708
- <SiteFooter config={config} logoLight={footerLogoLight} logoDark={footerLogoDark} />
709
- </Fragment>
710
- )}
713
+ <div class="wd-page">
714
+ {config.banner && (
715
+ <div class={`wd-banner wd-banner-${config.banner.type}`} id="wd-banner">
716
+ <div class="wd-banner-inner">
717
+ <span class="wd-banner-content">{config.banner.content}</span>
718
+ {config.banner.dismissible && (
719
+ <button type="button" class="wd-banner-dismiss" aria-label="Dismiss banner" data-banner-dismiss>
720
+ &times;
721
+ </button>
722
+ )}
723
+ </div>
724
+ </div>
725
+ )}
726
+ <TopBar
727
+ config={config}
728
+ selectors={selectors}
729
+ globalDropdowns={globalDropdowns}
730
+ showSidebarCol={showSidebarCol}
731
+ logoLight={logoLight}
732
+ logoDark={logoDark}
733
+ brandLabel={brandLabel}
734
+ />
735
+ <MobileMenu
736
+ config={config}
737
+ selectors={selectors}
738
+ globalDropdowns={globalDropdowns}
739
+ showSidebarCol={showSidebarCol}
740
+ logoLight={logoLight}
741
+ logoDark={logoDark}
742
+ brandLabel={brandLabel}
743
+ >
744
+ <slot name="sidebar" slot="sidebar" />
745
+ </MobileMenu>
746
+ <div class="wd-shell">
747
+ {showSidebarCol && (
748
+ <div class="wd-sidebar-col">
749
+ <slot name="sidebar" />
750
+ </div>
751
+ )}
752
+ <div class="wd-main-col">
753
+ <slot />
754
+ </div>
755
+ {showTocCol && (
756
+ <div class="wd-toc-col">
757
+ <slot name="toc" />
758
+ </div>
759
+ )}
760
+ </div>
761
+ </div>
762
+ <SiteFooter config={config} logoLight={footerLogoLight} logoDark={footerLogoDark} />
763
+ </Fragment>
764
+ )
765
+ }
711
766
 
712
767
  <SearchModal />
713
768
  <ImageZoom />
714
769
 
715
770
  <script>
716
- import { initBanner } from '../scripts/banner';
717
- import { initTopbarOffset } from '../scripts/topbar-offset';
771
+ import { initBanner } from "../scripts/banner";
772
+ import { initTopbarOffset } from "../scripts/topbar-offset";
718
773
 
719
774
  initBanner(document);
720
- document.addEventListener('astro:page-load', () => initBanner(document));
775
+ document.addEventListener("astro:page-load", () => initBanner(document));
721
776
 
722
777
  // No ordering dependency on initBanner above - see topbar-offset.ts
723
778
  // for why it measures only the topbar itself (not the banner) and
724
779
  // why that's live-measured rather than a fixed CSS value.
725
780
  initTopbarOffset();
726
- document.addEventListener('astro:page-load', () => initTopbarOffset());
781
+ document.addEventListener("astro:page-load", () => initTopbarOffset());
727
782
  </script>
728
- {/* writedocs.json's `scripts.body` - see scriptEntrySchema in lib/config.ts.
783
+ {
784
+ /* writedocs.json's `scripts.body` - see scriptEntrySchema in lib/config.ts.
729
785
  Rendered after everything above (including every component's own
730
786
  <script> tags, which Astro/Vite already bundles to run in document
731
787
  order) so it runs after every other script on the page has already
732
788
  loaded/hydrated - matching where a third-party script's own install
733
- instructions usually ask for a "body end" placement. */}
734
- {config.scripts.body.map((s) =>
735
- s.src ? <script is:inline src={s.src} /> : <script is:inline set:html={s.content} />
736
- )}
737
- {/* Zero-config custom JS - see findRootAssets() in lib/pages.js and
789
+ instructions usually ask for a "body end" placement. */
790
+ }
791
+ {
792
+ config.scripts.body.map((s) =>
793
+ s.src ? <script is:inline src={s.src} /> : <script is:inline set:html={s.content} />,
794
+ )
795
+ }
796
+ {
797
+ /* Zero-config custom JS - see findRootAssets() in lib/pages.js and
738
798
  rootJsContents above. Rendered last, after writedocs.json's own
739
799
  `scripts.body`, same "most locally-owned override runs last"
740
800
  reasoning as the root CSS above. `is:inline` here isn't optional -
@@ -742,11 +802,11 @@ const fontExtraCss = [fontFaceCss, fontWeightCss].filter(Boolean).join('\n');
742
802
  the build fails outright ("Cannot find the built path for ...
743
803
  type=script&index=N") the same way a dynamic-`src` script did
744
804
  while this file's own writedocs.json `scripts` support was first being
745
- built - see that feature's own commit for the full story. */}
746
- {rootJsContents.map((content) => (
747
- <script is:inline set:html={content} />
748
- ))}
749
- {/* Zero-config custom JS living in public/ - see this file's own CSS
805
+ built - see that feature's own commit for the full story. */
806
+ }
807
+ {rootJsContents.map((content) => <script is:inline set:html={content} />)}
808
+ {
809
+ /* Zero-config custom JS living in public/ - see this file's own CSS
750
810
  equivalent above and findRootAssets()'s comment in lib/pages.js.
751
811
  `<script src>`, not `is:inline set:html` - the file's already a
752
812
  fetchable URL, no reason to inline its content. Filtered against
@@ -757,14 +817,15 @@ const fontExtraCss = [fontFaceCss, fontWeightCss].filter(Boolean).join('\n');
757
817
  as a second tag; `scripts.head` vs `scripts.body` placement is a
758
818
  deliberate choice this can't second-guess, but `head` is by far
759
819
  the more common spot for a plain local script and this hasn't come
760
- up in practice). */}
761
- {publicJsHrefs.map((href) => (
762
- <script is:inline src={href} />
763
- ))}
764
- {/* writedocs.json's `integrations.askAi` - see AskAiWidget.astro. Rendered
820
+ up in practice). */
821
+ }
822
+ {publicJsHrefs.map((href) => <script is:inline src={href} />)}
823
+ {
824
+ /* writedocs.json's `integrations.askAi` - see AskAiWidget.astro. Rendered
765
825
  last of all - it's a floating chat widget, not something anything
766
826
  else on the page depends on running before, so there's no reason
767
- to load it any earlier than absolutely last. */}
827
+ to load it any earlier than absolutely last. */
828
+ }
768
829
  <AskAiWidget config={config} />
769
830
  </body>
770
831
  </html>
@@ -156,7 +156,7 @@ const { nodes, hrefForSlug, currentSlug, depth = 0 } = Astro.props as Props;
156
156
  .wd-nav-section-title {
157
157
  padding: 0;
158
158
  margin-bottom: 0.4rem;
159
- color: var(--wd-text);
159
+ color: var(--wd-nav-title);
160
160
  font-size: 0.75rem;
161
161
  font-weight: 600;
162
162
  text-transform: uppercase;
@@ -215,7 +215,7 @@ const { nodes, hrefForSlug, currentSlug, depth = 0 } = Astro.props as Props;
215
215
  margin: 0.1rem 0;
216
216
  border-radius: 0 0.4rem 0.4rem 0;
217
217
  text-decoration: none;
218
- color: var(--wd-text);
218
+ color: var(--wd-nav-text);
219
219
  font-size: 0.9rem;
220
220
  }
221
221
  /* Primary-tinted rather than a neutral surface gray - a faint preview
@@ -224,7 +224,7 @@ const { nodes, hrefForSlug, currentSlug, depth = 0 } = Astro.props as Props;
224
224
  hover state shared with every other clickable thing on the page. */
225
225
  .wd-nav-list a:hover {
226
226
  background: color-mix(in srgb, var(--wd-primary) 6%, transparent);
227
- color: var(--wd-text);
227
+ color: var(--wd-nav-title);
228
228
  }
229
229
  .wd-nav-list a.active {
230
230
  background: color-mix(in srgb, var(--wd-primary) 12%, transparent);
@@ -326,7 +326,7 @@ const { nodes, hrefForSlug, currentSlug, depth = 0 } = Astro.props as Props;
326
326
  margin: 0.1rem 0;
327
327
  border-radius: 0 0.4rem 0.4rem 0;
328
328
  cursor: pointer;
329
- color: var(--wd-text);
329
+ color: var(--wd-nav-text);
330
330
  font-size: 0.9rem;
331
331
  list-style: none;
332
332
  }
@@ -339,7 +339,7 @@ const { nodes, hrefForSlug, currentSlug, depth = 0 } = Astro.props as Props;
339
339
  /* Same primary-tinted hover as a plain page link above. */
340
340
  .wd-nav-collapsible summary:hover {
341
341
  background: color-mix(in srgb, var(--wd-primary) 6%, transparent);
342
- color: var(--wd-text);
342
+ color: var(--wd-nav-title);
343
343
  }
344
344
  /* When the group's own attached page is the current page, the pill
345
345
  background lives on <summary> itself (not the inner <a> below,
@@ -374,7 +374,7 @@ const { nodes, hrefForSlug, currentSlug, depth = 0 } = Astro.props as Props;
374
374
  }
375
375
  .wd-nav-collapsible summary a:hover {
376
376
  background: none;
377
- color: var(--wd-text);
377
+ color: var(--wd-nav-title);
378
378
  }
379
379
  .wd-nav-collapsible summary a.active {
380
380
  background: none;
@@ -84,7 +84,7 @@ const { headings } = Astro.props as Props;
84
84
  font-weight: 600;
85
85
  text-transform: uppercase;
86
86
  letter-spacing: 0.04em;
87
- color: var(--wd-text-muted);
87
+ color: var(--wd-nav-title);
88
88
  margin-bottom: 0.6rem;
89
89
  }
90
90
  .wd-toc ul {
@@ -99,7 +99,7 @@ const { headings } = Astro.props as Props;
99
99
  margin-left: -1px;
100
100
  border-left: 2px solid transparent;
101
101
  text-decoration: none;
102
- color: var(--wd-text-muted);
102
+ color: var(--wd-nav-text);
103
103
  line-height: 1.4;
104
104
  }
105
105
  .wd-toc-level-3 a {
@@ -107,7 +107,7 @@ const { headings } = Astro.props as Props;
107
107
  font-size: 0.82rem;
108
108
  }
109
109
  .wd-toc-item a:hover {
110
- color: var(--wd-text);
110
+ color: var(--wd-nav-title);
111
111
  }
112
112
  .wd-toc-item a.active {
113
113
  color: var(--wd-primary);
@@ -83,6 +83,13 @@ h5,
83
83
  h6 {
84
84
  font-family: var(--wd-font-family-heading, inherit);
85
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
+ }
86
93
  code {
87
94
  background: var(--wd-surface);
88
95
  border: 1px solid var(--wd-border);
@@ -259,10 +259,12 @@
259
259
  }
260
260
  /* The selected tab: just its border-bottom, in --wd-navbar-accent (falls
261
261
  back to --wd-primary - see BaseLayout.astro), landing on the row's
262
- bottom edge as an underline. No fill - the text keeps the navbar's own
263
- color. */
262
+ bottom edge as an underline. No fill - the text takes the navbar's
263
+ strongest color (the heading color, or the computed black/white on a
264
+ navbar of its own - --wd-navbar-foreground-strong in BaseLayout.astro). */
264
265
  .wd-tab-link.active {
265
266
  border-bottom-color: var(--wd-navbar-accent);
267
+ color: var(--wd-navbar-foreground-strong);
266
268
  font-weight: 600;
267
269
  }
268
270
  /* Any tab on hover: a light background tint, the same as a sidebar item's
@@ -270,6 +272,7 @@
270
272
  corners above shape it. */
271
273
  .wd-tab-link:hover {
272
274
  background: var(--wd-navbar-hover);
275
+ color: var(--wd-navbar-foreground-strong);
273
276
  }
274
277
  .wd-topbar-links {
275
278
  display: flex;
@@ -42,7 +42,7 @@ async function parse(text, format) {
42
42
 
43
43
  // The theme's own fallbacks (src/layout/BaseLayout.astro).
44
44
  const DEFAULT_BACKGROUND = { light: '#ffffff', dark: '#0b1120' };
45
- const DEFAULT_TEXT = { light: '#0f172a', dark: '#e2e8f0' };
45
+ const DEFAULT_TEXT = { light: '#404045', dark: '#a0a0a5' };
46
46
  const MIN_TEXT_CONTRAST = 4.5;
47
47
 
48
48
  // contrastRatio() is re-exported: it was defined here, and tests import it
@@ -99,10 +99,10 @@ export const DESCRIPTIONS = {
99
99
  styles: 'Colors, logo, favicon, fonts, code block themes, navbar and background.',
100
100
  'styles.colors': 'The site\'s colors.',
101
101
  'styles.colors.primary': 'Main color: links, buttons, the active page in the sidebar. Default "#6366f1".',
102
- 'styles.colors.text': 'Body text color in light mode. Default "#0f172a".',
102
+ 'styles.colors.text': 'Body text color in light mode, and the sidebar pages. Default "#404045".',
103
103
  'styles.colors.dark': 'Dark-mode colors. Anything left out uses the light-mode value.',
104
104
  'styles.colors.dark.primary': 'Main color in dark mode. Pick a lighter one if `primary` is dark - links use it on a dark background.',
105
- 'styles.colors.dark.text': 'Body text color in dark mode. Default "#e2e8f0".',
105
+ 'styles.colors.dark.text': 'Body text color in dark mode, and the sidebar pages. Default "#a0a0a5".',
106
106
  ...logo('styles.logo'),
107
107
  'styles.favicon': 'Favicon image path.',
108
108
  'styles.fonts': 'Fonts. Default: Inter. `heading` and `body` override just that part; anything they leave out comes from the top-level fields.',
@@ -1110,7 +1110,7 @@ const components = {
1110
1110
  .wd-prevnext-title {
1111
1111
  font-weight: 600;
1112
1112
  font-size: 0.85rem;
1113
- color: var(--wd-text);
1113
+ color: var(--wd-heading);
1114
1114
  white-space: nowrap;
1115
1115
  overflow: hidden;
1116
1116
  text-overflow: ellipsis;
@@ -41,8 +41,8 @@
41
41
  },
42
42
  "text": {
43
43
  "type": "string",
44
- "description": "Body text color in light mode. Default \"#0f172a\".",
45
- "markdownDescription": "Body text color in light mode. Default \"#0f172a\"."
44
+ "description": "Body text color in light mode, and the sidebar pages. Default \"#404045\".",
45
+ "markdownDescription": "Body text color in light mode, and the sidebar pages. Default \"#404045\"."
46
46
  },
47
47
  "dark": {
48
48
  "type": "object",
@@ -54,8 +54,8 @@
54
54
  },
55
55
  "text": {
56
56
  "type": "string",
57
- "description": "Body text color in dark mode. Default \"#e2e8f0\".",
58
- "markdownDescription": "Body text color in dark mode. Default \"#e2e8f0\"."
57
+ "description": "Body text color in dark mode, and the sidebar pages. Default \"#a0a0a5\".",
58
+ "markdownDescription": "Body text color in dark mode, and the sidebar pages. Default \"#a0a0a5\"."
59
59
  }
60
60
  },
61
61
  "description": "Dark-mode colors. Anything left out uses the light-mode value.",