stack-site-builder 1.19.1 → 1.19.2

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 CHANGED
@@ -11,6 +11,18 @@ content schema, while a consuming site supplies only content, taxonomy data and
11
11
  config. Sites track the theme with `pnpm up stack-site-builder`, so each release
12
12
  here is a plain version bump they pull in.
13
13
 
14
+ ## [1.19.2] - 2026-07-23
15
+
16
+ ### Fixed
17
+
18
+ - **Dark mode made custom-styled diagrams unreadable** — authored
19
+ `style X fill:#…` lines carry light-mode colors, while Mermaid's HTML
20
+ labels take their text color from the theme variables; in dark mode that
21
+ paired light text with the hardcoded light fills. The loader now drops
22
+ fill styles when rendering in dark mode, so those diagrams follow the
23
+ theme palette there — light mode keeps the authored colors, and toggling
24
+ the theme re-renders accordingly.
25
+
14
26
  ## [1.19.1] - 2026-07-23
15
27
 
16
28
  ### Changed
@@ -333,6 +345,7 @@ catalog sites from a thin content-only repository.
333
345
  - **Standalone development setup** — a devcontainer and a minimal `playground/`
334
346
  consuming site for developing and previewing the theme on its own.
335
347
 
348
+ [1.19.2]: https://github.com/CodeCompose7/stack-site-builder/compare/v1.19.1...v1.19.2
336
349
  [1.19.1]: https://github.com/CodeCompose7/stack-site-builder/compare/v1.19.0...v1.19.1
337
350
  [1.19.0]: https://github.com/CodeCompose7/stack-site-builder/compare/v1.18.0...v1.19.0
338
351
  [1.18.0]: https://github.com/CodeCompose7/stack-site-builder/compare/v1.17.4...v1.18.0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "stack-site-builder",
3
3
  "type": "module",
4
- "version": "1.19.1",
4
+ "version": "1.19.2",
5
5
  "license": "MIT",
6
6
  "description": "The engine behind the awesome-*-stack catalog sites: an Astro theme with the catalog/concepts/articles/slides/samples routes, components, styles and markdown pipeline. Sites provide content, taxonomy data and config.",
7
7
  "repository": {
@@ -56,6 +56,19 @@
56
56
  });
57
57
  }
58
58
 
59
+ // Authored `style X fill:#…` lines carry light-mode colors, and Mermaid's
60
+ // HTML labels take their text color from the THEME variables — in dark mode
61
+ // that pairs light text with the hardcoded light fills, unreadable. So in
62
+ // dark mode we drop those fill styles and let the diagram render entirely
63
+ // from the theme palette; light mode keeps the authored colors.
64
+ function srcForTheme(src: string): string {
65
+ if (document.documentElement.dataset.theme !== 'dark') return src;
66
+ return src
67
+ .split('\n')
68
+ .filter((l) => !/^\s*style\s+\S+.*fill:#/.test(l))
69
+ .join('\n');
70
+ }
71
+
59
72
  async function renderAll() {
60
73
  const nodes = Array.from(document.querySelectorAll<HTMLElement>('pre.mermaid'));
61
74
  if (nodes.length === 0) return;
@@ -66,7 +79,7 @@
66
79
  // injecting it as HTML would turn `<…>` in labels into live DOM (the
67
80
  // server-side escaping exists precisely to prevent that). Mermaid reads
68
81
  // the element's innerHTML and decodes entities itself.
69
- n.textContent = n.dataset.src ?? '';
82
+ n.textContent = srcForTheme(n.dataset.src ?? '');
70
83
  }
71
84
  init();
72
85
  try {