Skip to content

feat(docs): brand-styled Mermaid diagrams via @docusaurus/theme-mermaid - #69

Merged
rubenvdlinde merged 2 commits into
mainfrom
feature/mermaid-flow-diagrams
May 13, 2026
Merged

feat(docs): brand-styled Mermaid diagrams via @docusaurus/theme-mermaid#69
rubenvdlinde merged 2 commits into
mainfrom
feature/mermaid-flow-diagrams

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Summary

Turn the three tables in docs/WayOfWork/spec-driven-development.md (Pipeline, Layers, Commands) into Conduction-branded Mermaid flowcharts. Authors keep writing plain Markdown; diagrams render with the cobalt-and-orange palette automatically.

What changes

  • @docusaurus/theme-mermaid added to website/. The theme registers a remark plugin that picks up triple-backtick mermaid fences in both .md and .mdx, so the existing CommonMark docs (which don't escape angle brackets / curly braces) keep working.
  • Site-wide brand themeVariables in docusaurus.config.js — cobalt-50 fill, cobalt-200 border, cobalt-400 edges, cobalt-700 text, Figtree font. Authors don't need per-diagram %%{init}%% blocks.
  • website/src/css/conduction-mermaid.css ships the container chrome (cobalt-50 panel matching the product-page mockups), uppercase Plex Mono cluster labels, and three classDef hooks:
    • :::accent — KNVB orange, the one-orange-per-scene knob (use once per diagram).
    • :::stage — solid cobalt for system / 'owned by us' nodes.
    • :::muted — dashed cobalt-100 for out-of-scope nodes.
  • spec-driven-development.md — three tables become three Mermaid charts plus bullet detail (so the prose in column 3 doesn't get lost in 3-word nodes).

Why hybrid, not all-Mermaid

Mermaid is excellent for flowcharts and stays diff-friendly in MDX, but it cannot reliably render pointy-top hexes with one-orange accents and stay brand-strict. The line is:

  • Process / flow diagrams -> Mermaid (this PR).
  • Brand-illustrative shapes (hex apex layouts, honeycomb backdrops, two-system bridges) -> <cn-*> web components from @conduction/docusaurus-preset/diagrams.

The shape-illustration side is being expanded in a parallel design-system PR (new <cn-pair> and <cn-arch-flow> components extracted from the unindexed patterns in preview/product-pages/technical-docs.html and integrations.html).

Follow-up (not in this PR)

Promote conduction-mermaid.css from website/src/css/ into @conduction/docusaurus-preset so every Conduction Docusaurus site inherits the theme. Deferred until the CSS settles in the live site.

Test plan

  • npm run start boots cleanly on localhost:3088
  • Pipeline diagram renders: 4 stages, 3 - Build in KNVB orange
  • Layers diagram renders: Frontend -> Backend data -> Backend logic, OpenRegister in KNVB orange
  • Commands diagram renders: 5 stage clusters, /opsx-apply in KNVB orange
  • No console errors, no compile errors (1 pre-existing webpack warning about app-downloads.json in the preset, unrelated)
  • npm run build succeeds (preview only; CI will run on merge)

Convert the three tables in WayOfWork/spec-driven-development.md
(Pipeline stages, Layers, Commands) into Mermaid flowcharts that
inherit the Conduction cobalt-and-orange palette.

- Add @docusaurus/theme-mermaid and enable markdown.mermaid in
  docusaurus.config.js. The theme registers a remark plugin that
  picks up ```mermaid fences in both .md and .mdx, so existing
  CommonMark docs keep working.
- Set site-wide brand themeVariables (cobalt-50 fill, cobalt-200
  border, cobalt-400 edges, cobalt-700 text, Figtree font) so authors
  write plain ```mermaid blocks without per-diagram theme directives.
- Ship src/css/conduction-mermaid.css with container chrome (cobalt-50
  panel matching the product-page mockups), uppercase Plex Mono
  cluster labels, and three classDef hooks: :::accent (KNVB orange,
  one per diagram), :::stage (cobalt-cobalt for system nodes),
  :::muted (dashed cobalt-100 for out-of-scope nodes).
… MDX

Three round-trip refinements to the Mermaid + cn-arch-flow surface:

1. Mermaid nodes are now solid cobalt-blue with white text and no
   visible border (border = fill). The previous lavender fill was
   Mermaid's `default` theme leaking through — the theme key has to
   live at themeConfig.mermaid.theme (not options.theme), because
   theme-mermaid's client spreads options first and overlays theme
   last, so options.theme was always overridden.

2. Subgraph cluster rects: transparent fill, cobalt-blue stroke.
   Groups now read as outlined regions rather than stacked cards —
   filled cobalt nodes > outlined groups > panel background. Cluster
   label fill also bumped from cobalt-400 to cobalt-blue for matching
   weight.

3. <cn-arch-flow> is now available site-wide in MDX/Markdown.
   src/diagrams/cn-arch-flow.js is copied locally pending the next
   @conduction/docusaurus-preset release; registration happens via
   clientModules so authors can drop <cn-arch-flow>...</cn-arch-flow>
   into any page without a per-page import. (clientModules also has
   to be set on the config object directly, since the preset's
   createConfig wrapper doesn't forward it.)

Two MDX edits land alongside the wiring:

- spec-driven-development.md "Claude Code" — the 3-lane Mermaid
  Layers diagram is replaced by two cn-arch-flow rows (Tool name on
  top row, what Claude does on bottom row), with OpenRegister /
  Schemas & validation as the accent column.
- hydra/README.md "How it works" — the ASCII pipeline diagram
  becomes two cn-arch-flow rows: Build phase (Todo → Builder → Quality
  tests → Browser tests, Builder accent) and Review phase (Code review
  → Security review → Draft PR → Archive, Security review is the
  orange-hex accent). Prose bullets carry the detail that the
  3-word nodes can't.
@rubenvdlinde
rubenvdlinde merged commit afb63ac into main May 13, 2026
4 checks passed
@rubenvdlinde
rubenvdlinde deleted the feature/mermaid-flow-diagrams branch May 13, 2026 14:48
rubenvdlinde added a commit that referenced this pull request May 14, 2026
Brings in cn-pair, cn-arch-flow, and the App Builder hex orange fix.
Drops the local website/src/diagrams/cn-arch-flow.js stopgap copy that
was committed alongside PR #69 before the preset version bump.

Site-wide cn-arch-flow registration now lives in one line:

  import '@conduction/docusaurus-preset/diagrams/cn-arch-flow';

(in website/src/diagrams/index.js, side-effect-imported via the
clientModules entry in docusaurus.config.js — no per-page imports
needed in MDX/Markdown).

Verified locally: cn-arch-flow upgrades to a shadow-rooted custom
element on the Spec-Driven Development and Hydra pages, no console
errors, no missing-module warnings.
MWest2020 pushed a commit that referenced this pull request Jul 17, 2026
…uild timeouts for 2-locale sites' (#69) from ci/docs-drop-setup-node-and-bump-timeout into main
@rubenvdlinde
rubenvdlinde restored the feature/mermaid-flow-diagrams branch August 8, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant