Skip to content

docs: add mermaid-classdefs plugin and migrate contributing diagrams, dark and light mode images - #105

Merged
yeoldegrove merged 5 commits into
mainfrom
feat/mermaid_images_theming
Jul 8, 2026
Merged

yeoldegrove merged 5 commits into
mainfrom
feat/mermaid_images_theming

Conversation

@yeoldegrove

@yeoldegrove yeoldegrove commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

  • docs: add mermaid-classdefs plugin, canonical classes, and dark-mode color support
    • Add a markdown-it plugin (docs/.vitepress/plugins/mermaid-classdefs.ts) that injects five shared classDef declarations into every flowchart/graph mermaid fence at build time, eliminating per-diagram hex color duplication. Skips sequenceDiagram, gantt, and %%{init}%% blocks where classDef is invalid syntax.
    • Five canonical semantic classes: decision, input, process, output, neutral — assigned by authors with class NodeA decision; never written as classDef or style X fill: directly in diagram source.
    • Move all color values out of the plugin and into docs/.vitepress/theme/style.css. The plugin emits only opacity:1 per class (a visually inert sentinel that registers the class name with mermaid without causing mermaid to emit competing !important fill/stroke rules).
    • Add light-mode and dark-mode palettes to theme/style.css. Declarations use !important to override mermaid's SVG-scoped theme CSS, which is injected with ID-selector specificity (#mermaid-N .node rect { fill: ... }) and would otherwise take precedence over plain class selectors. Dark-mode fills are deep-tinted versions of the light-mode hues with bright colored strokes and light text; node colors switch automatically when the reader toggles the site theme.
    • Update vitepress-features.md to document the five canonica

before

image image

after

image image

Which issue(s) this PR fixes:
Fixes gardenlinux/gardenlinux#4972
Fixes gardenlinux/gardenlinux#4971

Add a markdown-it plugin (docs/.vitepress/plugins/mermaid-classdefs.ts)
that injects five shared classDef declarations into every flowchart/graph
mermaid fence at build time, eliminating per-diagram hex color duplication.

Classes: decision (blue), input (yellow), process (gray), output (green),
neutral (violet) — injected after the diagram-type line, skipped for
sequenceDiagram/gantt/%%{init}%% blocks.

Update vitepress-features.md to document the five canonical classes.

Signed-off-by: Eike Waldt <waldt@b1-systems.de>
On-behalf-of: SAP <eike.waldt@sap.com>
Assisted-by: Kilo:claude-opus-4-7
Assisted-by: Kilo:claude-sonnet-4-6
Signed-off-by: Eike Waldt <waldt@b1-systems.de>
On-behalf-of: SAP <eike.waldt@sap.com>
Assisted-by: Kilo:claude-opus-4-7
Assisted-by: Kilo:claude-sonnet-4-6
Signed-off-by: Eike Waldt <waldt@b1-systems.de>
On-behalf-of: SAP <eike.waldt@sap.com>
@netlify

netlify Bot commented Jul 7, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for gardenlinux-docs ready!

Name Link
🔨 Latest commit 7088847
🔍 Latest deploy log https://app.netlify.com/projects/gardenlinux-docs/deploys/6a4df9f67506a20008c9c773
😎 Deploy Preview https://deploy-preview-105--gardenlinux-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Signed-off-by: Eike Waldt <waldt@b1-systems.de>
On-behalf-of: SAP <eike.waldt@sap.com>
@yeoldegrove
yeoldegrove requested a review from ByteOtter July 7, 2026 14:52
@yeoldegrove yeoldegrove self-assigned this Jul 7, 2026
@yeoldegrove yeoldegrove added this to the 2026-07 milestone Jul 7, 2026
@yeoldegrove
yeoldegrove marked this pull request as ready for review July 7, 2026 14:57
@ByteOtter

Copy link
Copy Markdown
Collaborator

This looks really good. Though personally I would prefer the dark mode mermaid nodes to actually be dark mode as well with colored outlines/text if necessary. Not sure if this is more trouble than it's worth though?

Migrate all fill/stroke/color values out of the mermaid-classdefs plugin
and into docs/.vitepress/theme/style.css. The plugin now emits only an
opacity:1 sentinel per classDef so mermaid does not emit competing
!important rules. The CSS adds both a light-mode palette (identical to
the previous values) and a dark-mode palette (:root.dark prefix) with
deep-tint fills, bright colored strokes, and light text. All declarations
use !important to beat mermaid's SVG-scoped id-selector theme rules.
Update vitepress-features.md to remove per-class color names and point
to style.css as the color source.

Signed-off-by: Eike Waldt <waldt@b1-systems.de>
On-behalf-of: SAP <eike.waldt@sap.com>
Assisted-by: Kilo:claude-opus-4-7
Assisted-by: Kilo:claude-sonnet-4-6
@yeoldegrove

Copy link
Copy Markdown
Contributor Author

@ByteOtter Rethought and updated it... css/code is now seperated and we have seperate colors and also outlines inside the dark mode.

@ByteOtter ByteOtter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great now! Thanks for the work.

@yeoldegrove
yeoldegrove merged commit 3265d61 into main Jul 8, 2026
10 checks passed
@yeoldegrove
yeoldegrove deleted the feat/mermaid_images_theming branch July 22, 2026 09:00
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.

[ER] [Docs] mermaid graphics based on theme [ER] [Docs] images based on theme

2 participants