minimal-vibe-coding-kit 0.5.1 → 0.5.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/.agents/skills/agentshield-security-review/SKILL.md +16 -8
- package/.agents/skills/agentshield-security-review/references/native-install.md +2 -2
- package/.agents/skills/agentshield-security-review/scripts/agentshield_repo_probe.py +19 -1
- package/.agents/skills/mermaid/SKILL.md +141 -0
- package/.agents/skills/mermaid/UPSTREAM-NOTICE.md +52 -0
- package/.agents/skills/mermaid/references/architecture.md +433 -0
- package/.agents/skills/mermaid/references/block.md +752 -0
- package/.agents/skills/mermaid/references/c4.md +618 -0
- package/.agents/skills/mermaid/references/classDiagram.md +1191 -0
- package/.agents/skills/mermaid/references/coding-level-charts.md +27 -0
- package/.agents/skills/mermaid/references/config-configuration.md +71 -0
- package/.agents/skills/mermaid/references/config-directives.md +341 -0
- package/.agents/skills/mermaid/references/config-layouts.md +39 -0
- package/.agents/skills/mermaid/references/config-math.md +95 -0
- package/.agents/skills/mermaid/references/config-theming.md +245 -0
- package/.agents/skills/mermaid/references/config-tidy-tree.md +88 -0
- package/.agents/skills/mermaid/references/cynefin.md +278 -0
- package/.agents/skills/mermaid/references/debug-heatmap.md +68 -0
- package/.agents/skills/mermaid/references/entityRelationshipDiagram.md +902 -0
- package/.agents/skills/mermaid/references/eventmodeling.md +474 -0
- package/.agents/skills/mermaid/references/examples.md +300 -0
- package/.agents/skills/mermaid/references/flowchart.md +2166 -0
- package/.agents/skills/mermaid/references/gantt.md +736 -0
- package/.agents/skills/mermaid/references/gitgraph.md +2137 -0
- package/.agents/skills/mermaid/references/ishikawa.md +65 -0
- package/.agents/skills/mermaid/references/kanban.md +160 -0
- package/.agents/skills/mermaid/references/kit-examples.md +210 -0
- package/.agents/skills/mermaid/references/mindmap.md +334 -0
- package/.agents/skills/mermaid/references/packet.md +152 -0
- package/.agents/skills/mermaid/references/pie.md +111 -0
- package/.agents/skills/mermaid/references/preview.html +1143 -0
- package/.agents/skills/mermaid/references/quadrantChart.md +266 -0
- package/.agents/skills/mermaid/references/radar.md +268 -0
- package/.agents/skills/mermaid/references/railroad.md +455 -0
- package/.agents/skills/mermaid/references/requirementDiagram.md +494 -0
- package/.agents/skills/mermaid/references/sankey.md +414 -0
- package/.agents/skills/mermaid/references/sequenceDiagram.md +1206 -0
- package/.agents/skills/mermaid/references/stateDiagram.md +669 -0
- package/.agents/skills/mermaid/references/styling-preset.md +620 -0
- package/.agents/skills/mermaid/references/swimlanes.md +523 -0
- package/.agents/skills/mermaid/references/timeline.md +570 -0
- package/.agents/skills/mermaid/references/treeView.md +432 -0
- package/.agents/skills/mermaid/references/treemap.md +352 -0
- package/.agents/skills/mermaid/references/userJourney.md +41 -0
- package/.agents/skills/mermaid/references/venn.md +156 -0
- package/.agents/skills/mermaid/references/wardley.md +731 -0
- package/.agents/skills/mermaid/references/xyChart.md +392 -0
- package/.agents/skills/mermaid/references/zenuml.md +473 -0
- package/.agents/skills/sequential-thinking/SKILL.md +97 -69
- package/.agents/skills/sequential-thinking/examples/adaptive-depth.md +15 -536
- package/.agents/skills/sequential-thinking/examples/branching-exploration.md +18 -468
- package/.agents/skills/sequential-thinking/examples/linear-reasoning.md +22 -203
- package/.agents/skills/sequential-thinking/examples/revision-pattern.md +17 -298
- package/.agents/skills/sequential-thinking/references/advanced-techniques.md +98 -0
- package/.agents/skills/sequential-thinking/references/output-schema.md +99 -458
- package/.agents/skills/sequential-thinking/references/parameters.md +73 -435
- package/.agents/skills/sequential-thinking/references/patterns.md +72 -639
- package/.claude/skills/agentshield-security-review/SKILL.md +16 -8
- package/.claude/skills/agentshield-security-review/references/native-install.md +2 -2
- package/.claude/skills/agentshield-security-review/scripts/agentshield_repo_probe.py +19 -1
- package/.claude/skills/mermaid/SKILL.md +141 -0
- package/.claude/skills/mermaid/UPSTREAM-NOTICE.md +52 -0
- package/.claude/skills/mermaid/references/architecture.md +433 -0
- package/.claude/skills/mermaid/references/block.md +752 -0
- package/.claude/skills/mermaid/references/c4.md +618 -0
- package/.claude/skills/mermaid/references/classDiagram.md +1191 -0
- package/.claude/skills/mermaid/references/coding-level-charts.md +27 -0
- package/.claude/skills/mermaid/references/config-configuration.md +71 -0
- package/.claude/skills/mermaid/references/config-directives.md +341 -0
- package/.claude/skills/mermaid/references/config-layouts.md +39 -0
- package/.claude/skills/mermaid/references/config-math.md +95 -0
- package/.claude/skills/mermaid/references/config-theming.md +245 -0
- package/.claude/skills/mermaid/references/config-tidy-tree.md +88 -0
- package/.claude/skills/mermaid/references/cynefin.md +278 -0
- package/.claude/skills/mermaid/references/debug-heatmap.md +68 -0
- package/.claude/skills/mermaid/references/entityRelationshipDiagram.md +902 -0
- package/.claude/skills/mermaid/references/eventmodeling.md +474 -0
- package/.claude/skills/mermaid/references/examples.md +300 -0
- package/.claude/skills/mermaid/references/flowchart.md +2166 -0
- package/.claude/skills/mermaid/references/gantt.md +736 -0
- package/.claude/skills/mermaid/references/gitgraph.md +2137 -0
- package/.claude/skills/mermaid/references/ishikawa.md +65 -0
- package/.claude/skills/mermaid/references/kanban.md +160 -0
- package/.claude/skills/mermaid/references/kit-examples.md +210 -0
- package/.claude/skills/mermaid/references/mindmap.md +334 -0
- package/.claude/skills/mermaid/references/packet.md +152 -0
- package/.claude/skills/mermaid/references/pie.md +111 -0
- package/.claude/skills/mermaid/references/preview.html +1143 -0
- package/.claude/skills/mermaid/references/quadrantChart.md +266 -0
- package/.claude/skills/mermaid/references/radar.md +268 -0
- package/.claude/skills/mermaid/references/railroad.md +455 -0
- package/.claude/skills/mermaid/references/requirementDiagram.md +494 -0
- package/.claude/skills/mermaid/references/sankey.md +414 -0
- package/.claude/skills/mermaid/references/sequenceDiagram.md +1206 -0
- package/.claude/skills/mermaid/references/stateDiagram.md +669 -0
- package/.claude/skills/mermaid/references/styling-preset.md +620 -0
- package/.claude/skills/mermaid/references/swimlanes.md +523 -0
- package/.claude/skills/mermaid/references/timeline.md +570 -0
- package/.claude/skills/mermaid/references/treeView.md +432 -0
- package/.claude/skills/mermaid/references/treemap.md +352 -0
- package/.claude/skills/mermaid/references/userJourney.md +41 -0
- package/.claude/skills/mermaid/references/venn.md +156 -0
- package/.claude/skills/mermaid/references/wardley.md +731 -0
- package/.claude/skills/mermaid/references/xyChart.md +392 -0
- package/.claude/skills/mermaid/references/zenuml.md +473 -0
- package/.claude/skills/sequential-thinking/SKILL.md +97 -69
- package/.claude/skills/sequential-thinking/examples/adaptive-depth.md +15 -536
- package/.claude/skills/sequential-thinking/examples/branching-exploration.md +18 -468
- package/.claude/skills/sequential-thinking/examples/linear-reasoning.md +22 -203
- package/.claude/skills/sequential-thinking/examples/revision-pattern.md +17 -298
- package/.claude/skills/sequential-thinking/references/advanced-techniques.md +98 -0
- package/.claude/skills/sequential-thinking/references/output-schema.md +99 -458
- package/.claude/skills/sequential-thinking/references/parameters.md +73 -435
- package/.claude/skills/sequential-thinking/references/patterns.md +72 -639
- package/.codex-plugin/plugin.json +1 -1
- package/.cursor/skills/mermaid/SKILL.md +141 -0
- package/.cursor/skills/mermaid/UPSTREAM-NOTICE.md +52 -0
- package/.cursor/skills/mermaid/references/architecture.md +433 -0
- package/.cursor/skills/mermaid/references/block.md +752 -0
- package/.cursor/skills/mermaid/references/c4.md +618 -0
- package/.cursor/skills/mermaid/references/classDiagram.md +1191 -0
- package/.cursor/skills/mermaid/references/coding-level-charts.md +27 -0
- package/.cursor/skills/mermaid/references/config-configuration.md +71 -0
- package/.cursor/skills/mermaid/references/config-directives.md +341 -0
- package/.cursor/skills/mermaid/references/config-layouts.md +39 -0
- package/.cursor/skills/mermaid/references/config-math.md +95 -0
- package/.cursor/skills/mermaid/references/config-theming.md +245 -0
- package/.cursor/skills/mermaid/references/config-tidy-tree.md +88 -0
- package/.cursor/skills/mermaid/references/cynefin.md +278 -0
- package/.cursor/skills/mermaid/references/debug-heatmap.md +68 -0
- package/.cursor/skills/mermaid/references/entityRelationshipDiagram.md +902 -0
- package/.cursor/skills/mermaid/references/eventmodeling.md +474 -0
- package/.cursor/skills/mermaid/references/examples.md +300 -0
- package/.cursor/skills/mermaid/references/flowchart.md +2166 -0
- package/.cursor/skills/mermaid/references/gantt.md +736 -0
- package/.cursor/skills/mermaid/references/gitgraph.md +2137 -0
- package/.cursor/skills/mermaid/references/ishikawa.md +65 -0
- package/.cursor/skills/mermaid/references/kanban.md +160 -0
- package/.cursor/skills/mermaid/references/kit-examples.md +210 -0
- package/.cursor/skills/mermaid/references/mindmap.md +334 -0
- package/.cursor/skills/mermaid/references/packet.md +152 -0
- package/.cursor/skills/mermaid/references/pie.md +111 -0
- package/.cursor/skills/mermaid/references/preview.html +1143 -0
- package/.cursor/skills/mermaid/references/quadrantChart.md +266 -0
- package/.cursor/skills/mermaid/references/radar.md +268 -0
- package/.cursor/skills/mermaid/references/railroad.md +455 -0
- package/.cursor/skills/mermaid/references/requirementDiagram.md +494 -0
- package/.cursor/skills/mermaid/references/sankey.md +414 -0
- package/.cursor/skills/mermaid/references/sequenceDiagram.md +1206 -0
- package/.cursor/skills/mermaid/references/stateDiagram.md +669 -0
- package/.cursor/skills/mermaid/references/styling-preset.md +620 -0
- package/.cursor/skills/mermaid/references/swimlanes.md +523 -0
- package/.cursor/skills/mermaid/references/timeline.md +570 -0
- package/.cursor/skills/mermaid/references/treeView.md +432 -0
- package/.cursor/skills/mermaid/references/treemap.md +352 -0
- package/.cursor/skills/mermaid/references/userJourney.md +41 -0
- package/.cursor/skills/mermaid/references/venn.md +156 -0
- package/.cursor/skills/mermaid/references/wardley.md +731 -0
- package/.cursor/skills/mermaid/references/xyChart.md +392 -0
- package/.cursor/skills/mermaid/references/zenuml.md +473 -0
- package/.cursor/skills/sequential-thinking/SKILL.md +97 -69
- package/.cursor/skills/sequential-thinking/examples/adaptive-depth.md +15 -536
- package/.cursor/skills/sequential-thinking/examples/branching-exploration.md +18 -468
- package/.cursor/skills/sequential-thinking/examples/linear-reasoning.md +22 -203
- package/.cursor/skills/sequential-thinking/examples/revision-pattern.md +17 -298
- package/.cursor/skills/sequential-thinking/references/advanced-techniques.md +98 -0
- package/.cursor/skills/sequential-thinking/references/output-schema.md +99 -458
- package/.cursor/skills/sequential-thinking/references/parameters.md +73 -435
- package/.cursor/skills/sequential-thinking/references/patterns.md +72 -639
- package/.grok/skills/agentshield-security-review/SKILL.md +16 -8
- package/.grok/skills/agentshield-security-review/references/native-install.md +2 -2
- package/.grok/skills/agentshield-security-review/scripts/agentshield_repo_probe.py +19 -1
- package/.grok/skills/mermaid/SKILL.md +141 -0
- package/.grok/skills/mermaid/UPSTREAM-NOTICE.md +52 -0
- package/.grok/skills/mermaid/references/architecture.md +433 -0
- package/.grok/skills/mermaid/references/block.md +752 -0
- package/.grok/skills/mermaid/references/c4.md +618 -0
- package/.grok/skills/mermaid/references/classDiagram.md +1191 -0
- package/.grok/skills/mermaid/references/coding-level-charts.md +27 -0
- package/.grok/skills/mermaid/references/config-configuration.md +71 -0
- package/.grok/skills/mermaid/references/config-directives.md +341 -0
- package/.grok/skills/mermaid/references/config-layouts.md +39 -0
- package/.grok/skills/mermaid/references/config-math.md +95 -0
- package/.grok/skills/mermaid/references/config-theming.md +245 -0
- package/.grok/skills/mermaid/references/config-tidy-tree.md +88 -0
- package/.grok/skills/mermaid/references/cynefin.md +278 -0
- package/.grok/skills/mermaid/references/debug-heatmap.md +68 -0
- package/.grok/skills/mermaid/references/entityRelationshipDiagram.md +902 -0
- package/.grok/skills/mermaid/references/eventmodeling.md +474 -0
- package/.grok/skills/mermaid/references/examples.md +300 -0
- package/.grok/skills/mermaid/references/flowchart.md +2166 -0
- package/.grok/skills/mermaid/references/gantt.md +736 -0
- package/.grok/skills/mermaid/references/gitgraph.md +2137 -0
- package/.grok/skills/mermaid/references/ishikawa.md +65 -0
- package/.grok/skills/mermaid/references/kanban.md +160 -0
- package/.grok/skills/mermaid/references/kit-examples.md +210 -0
- package/.grok/skills/mermaid/references/mindmap.md +334 -0
- package/.grok/skills/mermaid/references/packet.md +152 -0
- package/.grok/skills/mermaid/references/pie.md +111 -0
- package/.grok/skills/mermaid/references/preview.html +1143 -0
- package/.grok/skills/mermaid/references/quadrantChart.md +266 -0
- package/.grok/skills/mermaid/references/radar.md +268 -0
- package/.grok/skills/mermaid/references/railroad.md +455 -0
- package/.grok/skills/mermaid/references/requirementDiagram.md +494 -0
- package/.grok/skills/mermaid/references/sankey.md +414 -0
- package/.grok/skills/mermaid/references/sequenceDiagram.md +1206 -0
- package/.grok/skills/mermaid/references/stateDiagram.md +669 -0
- package/.grok/skills/mermaid/references/styling-preset.md +620 -0
- package/.grok/skills/mermaid/references/swimlanes.md +523 -0
- package/.grok/skills/mermaid/references/timeline.md +570 -0
- package/.grok/skills/mermaid/references/treeView.md +432 -0
- package/.grok/skills/mermaid/references/treemap.md +352 -0
- package/.grok/skills/mermaid/references/userJourney.md +41 -0
- package/.grok/skills/mermaid/references/venn.md +156 -0
- package/.grok/skills/mermaid/references/wardley.md +731 -0
- package/.grok/skills/mermaid/references/xyChart.md +392 -0
- package/.grok/skills/mermaid/references/zenuml.md +473 -0
- package/.grok/skills/sequential-thinking/SKILL.md +97 -69
- package/.grok/skills/sequential-thinking/examples/adaptive-depth.md +15 -536
- package/.grok/skills/sequential-thinking/examples/branching-exploration.md +18 -468
- package/.grok/skills/sequential-thinking/examples/linear-reasoning.md +22 -203
- package/.grok/skills/sequential-thinking/examples/revision-pattern.md +17 -298
- package/.grok/skills/sequential-thinking/references/advanced-techniques.md +98 -0
- package/.grok/skills/sequential-thinking/references/output-schema.md +99 -458
- package/.grok/skills/sequential-thinking/references/parameters.md +73 -435
- package/.grok/skills/sequential-thinking/references/patterns.md +72 -639
- package/.vibekit/docs/INSTALL.md +2 -1
- package/.vibekit/docs/SECURITY_MODEL.md +4 -1
- package/.vibekit/scripts/init-backbone.mjs +1 -1
- package/.vibekit/scripts/validate-kit.mjs +179 -3
- package/.vibekit/skills/agentshield-security-review/SKILL.md +16 -8
- package/.vibekit/skills/agentshield-security-review/references/native-install.md +2 -2
- package/.vibekit/skills/agentshield-security-review/scripts/agentshield_repo_probe.py +19 -1
- package/.vibekit/skills/mermaid/SKILL.md +141 -0
- package/.vibekit/skills/mermaid/UPSTREAM-NOTICE.md +52 -0
- package/.vibekit/skills/mermaid/references/architecture.md +433 -0
- package/.vibekit/skills/mermaid/references/block.md +752 -0
- package/.vibekit/skills/mermaid/references/c4.md +618 -0
- package/.vibekit/skills/mermaid/references/classDiagram.md +1191 -0
- package/.vibekit/skills/mermaid/references/coding-level-charts.md +27 -0
- package/.vibekit/skills/mermaid/references/config-configuration.md +71 -0
- package/.vibekit/skills/mermaid/references/config-directives.md +341 -0
- package/.vibekit/skills/mermaid/references/config-layouts.md +39 -0
- package/.vibekit/skills/mermaid/references/config-math.md +95 -0
- package/.vibekit/skills/mermaid/references/config-theming.md +245 -0
- package/.vibekit/skills/mermaid/references/config-tidy-tree.md +88 -0
- package/.vibekit/skills/mermaid/references/cynefin.md +278 -0
- package/.vibekit/skills/mermaid/references/debug-heatmap.md +68 -0
- package/.vibekit/skills/mermaid/references/entityRelationshipDiagram.md +902 -0
- package/.vibekit/skills/mermaid/references/eventmodeling.md +474 -0
- package/.vibekit/skills/mermaid/references/examples.md +300 -0
- package/.vibekit/skills/mermaid/references/flowchart.md +2166 -0
- package/.vibekit/skills/mermaid/references/gantt.md +736 -0
- package/.vibekit/skills/mermaid/references/gitgraph.md +2137 -0
- package/.vibekit/skills/mermaid/references/ishikawa.md +65 -0
- package/.vibekit/skills/mermaid/references/kanban.md +160 -0
- package/.vibekit/skills/mermaid/references/kit-examples.md +210 -0
- package/.vibekit/skills/mermaid/references/mindmap.md +334 -0
- package/.vibekit/skills/mermaid/references/packet.md +152 -0
- package/.vibekit/skills/mermaid/references/pie.md +111 -0
- package/.vibekit/skills/mermaid/references/preview.html +1143 -0
- package/.vibekit/skills/mermaid/references/quadrantChart.md +266 -0
- package/.vibekit/skills/mermaid/references/radar.md +268 -0
- package/.vibekit/skills/mermaid/references/railroad.md +455 -0
- package/.vibekit/skills/mermaid/references/requirementDiagram.md +494 -0
- package/.vibekit/skills/mermaid/references/sankey.md +414 -0
- package/.vibekit/skills/mermaid/references/sequenceDiagram.md +1206 -0
- package/.vibekit/skills/mermaid/references/stateDiagram.md +669 -0
- package/.vibekit/skills/mermaid/references/styling-preset.md +620 -0
- package/.vibekit/skills/mermaid/references/swimlanes.md +523 -0
- package/.vibekit/skills/mermaid/references/timeline.md +570 -0
- package/.vibekit/skills/mermaid/references/treeView.md +432 -0
- package/.vibekit/skills/mermaid/references/treemap.md +352 -0
- package/.vibekit/skills/mermaid/references/userJourney.md +41 -0
- package/.vibekit/skills/mermaid/references/venn.md +156 -0
- package/.vibekit/skills/mermaid/references/wardley.md +731 -0
- package/.vibekit/skills/mermaid/references/xyChart.md +392 -0
- package/.vibekit/skills/mermaid/references/zenuml.md +473 -0
- package/.vibekit/skills/sequential-thinking/SKILL.md +97 -69
- package/.vibekit/skills/sequential-thinking/examples/adaptive-depth.md +15 -536
- package/.vibekit/skills/sequential-thinking/examples/branching-exploration.md +18 -468
- package/.vibekit/skills/sequential-thinking/examples/linear-reasoning.md +22 -203
- package/.vibekit/skills/sequential-thinking/examples/revision-pattern.md +17 -298
- package/.vibekit/skills/sequential-thinking/references/advanced-techniques.md +98 -0
- package/.vibekit/skills/sequential-thinking/references/output-schema.md +99 -458
- package/.vibekit/skills/sequential-thinking/references/parameters.md +73 -435
- package/.vibekit/skills/sequential-thinking/references/patterns.md +72 -639
- package/.vibekit/skills/skills-manifest.json +2 -1
- package/CHANGELOG.md +25 -0
- package/README.md +269 -13
- package/docs/README.vi.md +287 -31
- package/docs/README.zh-CN.md +269 -13
- package/package.json +3 -1
|
@@ -0,0 +1,620 @@
|
|
|
1
|
+
# Vivid Clay Style Preset
|
|
2
|
+
|
|
3
|
+
Default visual style for every generated diagram: **colourful claymorphism × neubrutalism**.
|
|
4
|
+
Soft rounded shapes and saturated pastel fills (clay) + dark borders, ink text, high contrast
|
|
5
|
+
(neubrutalism). Goal: one glance separates roles — steps, decisions, success, failure — before
|
|
6
|
+
reading a single label.
|
|
7
|
+
|
|
8
|
+
Apply this preset unless the user asks for plain/minimal output or names another theme.
|
|
9
|
+
|
|
10
|
+
## Design rules
|
|
11
|
+
|
|
12
|
+
1. **One hue = one semantic role**, never one hue per node. All nodes of the same kind share a color.
|
|
13
|
+
2. **Uniform dark borders**: `#444444`, 2px on nodes, 1.5px on edges. Differentiation comes from fill hue, not border color.
|
|
14
|
+
3. **Contrast**: ink `#111111` text on pastel fills; white `#FFFFFF` text only on the ink fill. Never light-on-light.
|
|
15
|
+
4. **Every node gets a class** (in diagram types that support classDef). No unstyled default-gray boxes.
|
|
16
|
+
5. **Rounded shapes for the clay feel**: stadium `([ ])` for start/end, rounded `( )` for steps, diamond `{ }` for decisions, cylinder `[( )]` for data stores.
|
|
17
|
+
6. Edge labels: short (1–3 words), white background (`edgeLabelBackground`).
|
|
18
|
+
7. Group phases with subgraphs on the paper tint when the flow has distinct stages.
|
|
19
|
+
|
|
20
|
+
## Anti-overflow rules (text must never clip)
|
|
21
|
+
|
|
22
|
+
- `fontFamily` is one of the verified stacks in the Typography section below —
|
|
23
|
+
the default mono stack everywhere, the sans option when the user asks for a prose look,
|
|
24
|
+
or the web-font mono variant when the host preloads fonts.
|
|
25
|
+
Fonts like `ui-sans-serif` make Mermaid measure text with one font and render with another;
|
|
26
|
+
containers come out too narrow and labels clip (verified: ER headers lost their last character).
|
|
27
|
+
- Never put a dash-containing token (`sans-serif`, `system-ui`) in a **custom**
|
|
28
|
+
`themeVariables.fontFamily`: mermaid's sanitizer whitelists `[\d "#%(),.;A-Za-z]` and blanks
|
|
29
|
+
the whole value on any other character, silently falling back to the default stack (upstream
|
|
30
|
+
mermaid#6256; verified by render probes on v11.16 — `segoe ui, verdana, arial` passes, adding
|
|
31
|
+
`, sans-serif` voids the value). Mermaid's own trebuchet default is unaffected only because
|
|
32
|
+
the sanitizer's fallback happens to equal it. Generic `serif` and `monospace` are dash-free
|
|
33
|
+
and safe.
|
|
34
|
+
- Never set `font-weight` in classDef — bold renders wider than the measured normal text and
|
|
35
|
+
overflows the node.
|
|
36
|
+
- Node labels ≤ 6 words, edge labels ≤ 3 words. Break longer text with `<br/>`.
|
|
37
|
+
|
|
38
|
+
## Typography
|
|
39
|
+
|
|
40
|
+
Three verified stacks — mono is the default for every diagram:
|
|
41
|
+
|
|
42
|
+
| Stack | fontSize | When |
|
|
43
|
+
| ----- | -------- | ---- |
|
|
44
|
+
| `cascadia mono, consolas, noto sans mono, menlo, monospace` (default) | 15px | Every diagram on any page. Dev/terminal look that fits the neubrutalist style, Vietnamese-safe end to end: Cascadia Mono (Windows 11) → Consolas (older Windows) → Noto Sans Mono (Linux with Noto) → Menlo (macOS, best effort). System fonts — no loading race. |
|
|
45
|
+
| `segoe ui, verdana, arial` (sans option) | 16px | Only when the user asks for a sans/prose look. Vietnamese-safe on Windows; macOS falls through to Verdana/Arial. No `sans-serif` generic: the sanitizer voids dash tokens (see anti-overflow). |
|
|
46
|
+
| `JetBrains Mono, Cascadia Code, Consolas, monospace` (web-font mono) | 15px | Only when the host page preloads the fonts (own site, preview HTML). Load JetBrains Mono with a Vietnamese sample string (web-font section below). |
|
|
47
|
+
|
|
48
|
+
Every preview.html section renders the default mono stack at 15px (re-verified 2026-07;
|
|
49
|
+
clip-scanned). Mono glyphs run wider than sans — keep 15px, not 16px.
|
|
50
|
+
|
|
51
|
+
### Language coverage — Vietnamese
|
|
52
|
+
|
|
53
|
+
Mermaid's own default face, **Trebuchet MS, has no Vietnamese glyphs**. Its Latin Extended
|
|
54
|
+
Additional coverage is 8 characters (U+1E80–1E85, U+1EF2–1EF3) — none of the Vietnamese range
|
|
55
|
+
U+1EA0–1EF9, no horn vowels (ư U+01B0), no đồng sign (₫ U+20AB). Verified 2026-07 two ways: the
|
|
56
|
+
glyph map of trebuc.ttf on Windows 11, and the font's published Unicode coverage table. The
|
|
57
|
+
browser falls back **per character** to Verdana: base letters draw in Trebuchet, marked letters
|
|
58
|
+
in Verdana — two typefaces inside one word. It also clips: mermaid measures text on a canvas,
|
|
59
|
+
where a missing glyph hits a different fallback than the DOM draw (preview section 33a measures
|
|
60
|
+
~34px of overflow on "Kiểm thử hệ thống dữ liệu").
|
|
61
|
+
|
|
62
|
+
The default mono stack is Vietnamese-safe by construction — verified per member: Cascadia
|
|
63
|
+
Mono and Consolas by glyph map (Windows 11), Noto Sans Mono by its Google Fonts `vietnamese`
|
|
64
|
+
subset. Menlo is best effort: it descends from DejaVu Sans Mono, whose own langcover.txt
|
|
65
|
+
reports only 76% Vietnamese coverage, so macOS marks may sit slightly off.
|
|
66
|
+
|
|
67
|
+
Fonts that look tempting but break Vietnamese — keep them out of every stack:
|
|
68
|
+
|
|
69
|
+
- **Fira Code / Fira Mono** — no `vietnamese` subset (Google Fonts css2, checked 2026-07).
|
|
70
|
+
- **SF Mono** — Apple lists Latin, Greek, Cyrillic only; a Mac with it installed mixes
|
|
71
|
+
typefaces on marked letters.
|
|
72
|
+
- **DejaVu Sans Mono, Ubuntu Mono, Red Hat Mono, Liberation Mono** — missing or deformed
|
|
73
|
+
Vietnamese marks (DejaVu 76%; Ubuntu and Red Hat ship no vietnamese subset; Liberation
|
|
74
|
+
misplaces combining marks).
|
|
75
|
+
- **Trebuchet MS, Georgia** — no Vietnamese glyph block at all (glyph map, Windows 11).
|
|
76
|
+
|
|
77
|
+
For a sans look on pages you control, the best face is **Be Vietnam Pro** (Google Fonts,
|
|
78
|
+
OFL — designed for Vietnamese, diacritic-adaptive letterforms):
|
|
79
|
+
`fontFamily: Be Vietnam Pro, segoe ui, verdana, arial`, fontSize 16px.
|
|
80
|
+
Load it with a Vietnamese sample string before `mermaid.run()` — see the web-font section
|
|
81
|
+
below; without the sample only the latin file loads and Vietnamese labels are measured
|
|
82
|
+
with the fallback font.
|
|
83
|
+
|
|
84
|
+
preview.html section 33 renders all of this, including the Trebuchet mixed-font repro.
|
|
85
|
+
|
|
86
|
+
### Web fonts must load before mermaid runs
|
|
87
|
+
|
|
88
|
+
Mermaid measures label text once, at render time (upstream issues mermaid#1540, mermaid#5701).
|
|
89
|
+
If a web font arrives later, text is measured with the fallback font but drawn with the web
|
|
90
|
+
font — labels clip. When self-hosting:
|
|
91
|
+
|
|
92
|
+
```html
|
|
93
|
+
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
|
|
94
|
+
<script type="module">
|
|
95
|
+
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
|
|
96
|
+
mermaid.initialize({ startOnLoad: false });
|
|
97
|
+
await document.fonts.load('15px "JetBrains Mono"', 'Đọc dữ liệu, gỡ lỗi — 500.000₫');
|
|
98
|
+
await mermaid.run();
|
|
99
|
+
</script>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
The second argument to `load()` matters: Google Fonts splits each family into unicode-range
|
|
103
|
+
files (latin, vietnamese, …) and `load()` fetches only the files that sample text needs —
|
|
104
|
+
the default sample is a single space, which pulls the latin file alone. Pass a sample in
|
|
105
|
+
every script the diagram renders (the Vietnamese sample above pulls the vietnamese file too).
|
|
106
|
+
|
|
107
|
+
On pages you don't control the loading race is unfixable — never name a web font there;
|
|
108
|
+
stay on the default stack.
|
|
109
|
+
|
|
110
|
+
### The mermaid container needs a real font stack too
|
|
111
|
+
|
|
112
|
+
Some diagram types (verified: block) never inject `fontFamily` into their SVG, so labels
|
|
113
|
+
inherit the font of the surrounding element. Diagrams usually sit in a `<pre class="mermaid">`,
|
|
114
|
+
and the browser default for `<pre>` is monospace — text gets measured with the themeVariables
|
|
115
|
+
font but drawn in monospace, and labels clip (caught by the eval harness: block's
|
|
116
|
+
"Load balancer" lost its trailing letters). When self-hosting, mirror the stack on the container:
|
|
117
|
+
|
|
118
|
+
```css
|
|
119
|
+
.mermaid { font-family: cascadia mono, consolas, noto sans mono, menlo, monospace; }
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Hosted renderers (GitHub, mermaid.live) style their own containers; this rule is for pages you control.
|
|
123
|
+
|
|
124
|
+
### Weight, emphasis, text color
|
|
125
|
+
|
|
126
|
+
- Never set `font-weight` in classDef or themeVariables (see anti-overflow rules).
|
|
127
|
+
Mermaid's own bold (titles, ER headers, section labels) is already measured correctly — leave it.
|
|
128
|
+
- Emphasis comes from fill color (palette roles), not bold.
|
|
129
|
+
- Text color is fixed by the palette: ink `#111111` on pastel fills, white `#FFFFFF` only on
|
|
130
|
+
the ink fill. No mid-gray text on tinted fills.
|
|
131
|
+
|
|
132
|
+
### Font licensing (checked 2026-07)
|
|
133
|
+
|
|
134
|
+
JetBrains Mono, Fira Code, and Be Vietnam Pro are OFL-licensed — free for any use, served by Google Fonts.
|
|
135
|
+
Dank Mono (~$40) and MonoLisa (~$59) are commercial with no public CDN: never emit them in
|
|
136
|
+
shipped diagrams. A user who owns one can prepend it to the mono stack on their own machine —
|
|
137
|
+
the fallback chain keeps the diagram valid everywhere else.
|
|
138
|
+
|
|
139
|
+
## Palette tokens
|
|
140
|
+
|
|
141
|
+
| Role | Fill | Text | Use for |
|
|
142
|
+
| ---- | ---- | ---- | ------- |
|
|
143
|
+
| `terminal` | `#111111` | `#FFFFFF` | start / end / exit points |
|
|
144
|
+
| `step` | `#8ECAFF` sky | `#111111` | normal process steps |
|
|
145
|
+
| `decision` | `#FFD43B` amber | `#111111` | branches, questions |
|
|
146
|
+
| `success` | `#8CE99A` green | `#111111` | happy path, pass, done |
|
|
147
|
+
| `danger` | `#FF8787` red | `#111111` | failure, error, abort |
|
|
148
|
+
| `accent` | `#D0BFFF` violet | `#111111` | highlights, key artifacts |
|
|
149
|
+
| `data` | `#63E6BE` teal | `#111111` | data stores, files, I/O |
|
|
150
|
+
| `external` | `#FFA94D` orange | `#111111` | third-party / external systems |
|
|
151
|
+
|
|
152
|
+
All borders: `#444444`. Paper/cluster tint: `#FFF9DB`. Hex only — the theming engine does not accept color names.
|
|
153
|
+
|
|
154
|
+
### Strong palette — large-area marks
|
|
155
|
+
|
|
156
|
+
Some renderers **lighten** the colors you give them before painting big areas: timeline tints
|
|
157
|
+
period and event boxes, kanban tints column backgrounds, and xychart draws wide bars with no
|
|
158
|
+
border. Feed those types the pastel tokens above and the result washes out (pale bars, faded
|
|
159
|
+
columns). For those large-area marks use the strong variants — same hue family, one level
|
|
160
|
+
deeper — and keep the pastel tokens for small bordered nodes:
|
|
161
|
+
|
|
162
|
+
| Role | Strong fill | Pairs with |
|
|
163
|
+
| ---- | ----------- | ---------- |
|
|
164
|
+
| `stepStrong` | `#339AF0` blue | `step` #8ECAFF |
|
|
165
|
+
| `decisionStrong` | `#FAB005` yellow | `decision` #FFD43B |
|
|
166
|
+
| `successStrong` | `#40C057` green | `success` #8CE99A |
|
|
167
|
+
| `dangerStrong` | `#FA5252` red | `danger` #FF8787; use ink `#111111` text |
|
|
168
|
+
| `accentStrong` | `#9775FA` violet | `accent` #D0BFFF |
|
|
169
|
+
| `dataStrong` | `#20C997` teal | `data` #63E6BE |
|
|
170
|
+
| `externalStrong` | `#FD7E14` orange | `external` #FFA94D |
|
|
171
|
+
|
|
172
|
+
All strong fills keep ink `#111111` text readable. Do not use white on `#FA5252` for normal text:
|
|
173
|
+
the contrast is only 3.28:1; ink `#111111` reaches 5.75:1.
|
|
174
|
+
|
|
175
|
+
## Universal frontmatter block
|
|
176
|
+
|
|
177
|
+
Works for every diagram type (only `base` theme is customizable). Start each diagram with:
|
|
178
|
+
|
|
179
|
+
```yaml
|
|
180
|
+
---
|
|
181
|
+
title: <diagram title>
|
|
182
|
+
config:
|
|
183
|
+
theme: base
|
|
184
|
+
themeVariables:
|
|
185
|
+
fontFamily: cascadia mono, consolas, noto sans mono, menlo, monospace
|
|
186
|
+
fontSize: 15px
|
|
187
|
+
primaryColor: "#8ECAFF"
|
|
188
|
+
primaryTextColor: "#111111"
|
|
189
|
+
primaryBorderColor: "#444444"
|
|
190
|
+
secondaryColor: "#FFD43B"
|
|
191
|
+
secondaryBorderColor: "#444444"
|
|
192
|
+
tertiaryColor: "#FFF9DB"
|
|
193
|
+
tertiaryBorderColor: "#444444"
|
|
194
|
+
lineColor: "#444444"
|
|
195
|
+
textColor: "#111111"
|
|
196
|
+
edgeLabelBackground: "#FFFFFF"
|
|
197
|
+
clusterBkg: "#FFF9DB"
|
|
198
|
+
clusterBorder: "#444444"
|
|
199
|
+
---
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Include the `title:` line only when the host page's background is controlled (own site,
|
|
203
|
+
preview HTML). The title renders in plain `textColor` ink directly on the canvas — see the
|
|
204
|
+
theme-following-hosts section below before shipping a titled diagram to GitHub.
|
|
205
|
+
|
|
206
|
+
## Theme-following hosts (GitHub light/dark)
|
|
207
|
+
|
|
208
|
+
GitHub and similar renderers draw the SVG on a transparent canvas that follows the page
|
|
209
|
+
theme. The preset's filled shapes carry their own text colors, so nodes survive both
|
|
210
|
+
modes — but any text that does not sit on a filled shape flips illegible in one mode
|
|
211
|
+
(observed 2026-07 on GitHub dark mode, Mermaid 11):
|
|
212
|
+
|
|
213
|
+
- **Diagram `title:`** — rendered in `textColor` ink on the transparent canvas; invisible
|
|
214
|
+
on a dark page. Omit the frontmatter title on theme-following hosts and let the
|
|
215
|
+
surrounding document heading name the diagram.
|
|
216
|
+
- **Edge labels** — safe: `edgeLabelBackground: "#FFFFFF"` keeps a white pill behind ink text.
|
|
217
|
+
- **Cluster titles** — safe: they sit inside the `clusterBkg` paper fill.
|
|
218
|
+
- **Mindmap node text** — not safe; see the mindmap trap in the timeline/mindmap/kanban
|
|
219
|
+
section. For a catalog/overview on a theme-following host, prefer a flowchart of
|
|
220
|
+
per-category subgraph columns: `direction TB` inside each subgraph, invisible `~~~`
|
|
221
|
+
links to stack the entries, and a classDef per category so every label has an explicit
|
|
222
|
+
fill and text color.
|
|
223
|
+
|
|
224
|
+
Rule of thumb: on a host with more than one theme, every character must sit on a shape
|
|
225
|
+
whose fill and text color the diagram sets explicitly, or on the white edge-label pill.
|
|
226
|
+
|
|
227
|
+
## Flowchart / state / block diagrams — classDef recipe
|
|
228
|
+
|
|
229
|
+
Append after the diagram body, then assign every node:
|
|
230
|
+
|
|
231
|
+
```
|
|
232
|
+
classDef terminal fill:#111111,stroke:#444444,stroke-width:2px,color:#FFFFFF
|
|
233
|
+
classDef step fill:#8ECAFF,stroke:#444444,stroke-width:2px,color:#111111
|
|
234
|
+
classDef decision fill:#FFD43B,stroke:#444444,stroke-width:2px,color:#111111
|
|
235
|
+
classDef success fill:#8CE99A,stroke:#444444,stroke-width:2px,color:#111111
|
|
236
|
+
classDef danger fill:#FF8787,stroke:#444444,stroke-width:2px,color:#111111
|
|
237
|
+
classDef accent fill:#D0BFFF,stroke:#444444,stroke-width:2px,color:#111111
|
|
238
|
+
classDef data fill:#63E6BE,stroke:#444444,stroke-width:2px,color:#111111
|
|
239
|
+
classDef external fill:#FFA94D,stroke:#444444,stroke-width:2px,color:#111111
|
|
240
|
+
linkStyle default stroke:#444444,stroke-width:1.5px
|
|
241
|
+
|
|
242
|
+
class Start,End terminal
|
|
243
|
+
class S1,S2 step
|
|
244
|
+
class Q1 decision
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Only emit the classDefs you actually assign. Drop unused roles.
|
|
248
|
+
`linkStyle` exists in flowcharts only — omit it in state and block diagrams.
|
|
249
|
+
Block diagrams keep the same `classDef` + `class` syntax and support the cylinder
|
|
250
|
+
shape `Name[("Label")]` for data stores.
|
|
251
|
+
|
|
252
|
+
### Full example (rendered and verified)
|
|
253
|
+
|
|
254
|
+
```mermaid
|
|
255
|
+
---
|
|
256
|
+
title: Deploy pipeline
|
|
257
|
+
config:
|
|
258
|
+
theme: base
|
|
259
|
+
themeVariables:
|
|
260
|
+
fontFamily: cascadia mono, consolas, noto sans mono, menlo, monospace
|
|
261
|
+
fontSize: 15px
|
|
262
|
+
lineColor: "#444444"
|
|
263
|
+
textColor: "#111111"
|
|
264
|
+
edgeLabelBackground: "#FFFFFF"
|
|
265
|
+
---
|
|
266
|
+
flowchart TD
|
|
267
|
+
Start([Push to main]) --> Build(Build image)
|
|
268
|
+
Build --> Test(Run tests)
|
|
269
|
+
Test --> Q1{All green?}
|
|
270
|
+
Q1 -->|yes| Stage(Deploy to staging)
|
|
271
|
+
Q1 -->|no| Alert(Notify channel)
|
|
272
|
+
Alert --> End1([Abort])
|
|
273
|
+
Stage --> Q2{Smoke test OK?}
|
|
274
|
+
Q2 -->|yes| Prod(Deploy to prod)
|
|
275
|
+
Q2 -->|no| Roll(Rollback)
|
|
276
|
+
Roll --> Alert
|
|
277
|
+
Prod --> Done([Released])
|
|
278
|
+
|
|
279
|
+
classDef terminal fill:#111111,stroke:#444444,stroke-width:2px,color:#FFFFFF
|
|
280
|
+
classDef step fill:#8ECAFF,stroke:#444444,stroke-width:2px,color:#111111
|
|
281
|
+
classDef decision fill:#FFD43B,stroke:#444444,stroke-width:2px,color:#111111
|
|
282
|
+
classDef success fill:#8CE99A,stroke:#444444,stroke-width:2px,color:#111111
|
|
283
|
+
classDef danger fill:#FF8787,stroke:#444444,stroke-width:2px,color:#111111
|
|
284
|
+
linkStyle default stroke:#444444,stroke-width:1.5px
|
|
285
|
+
|
|
286
|
+
class Start,End1,Done terminal
|
|
287
|
+
class Build,Test,Stage step
|
|
288
|
+
class Q1,Q2 decision
|
|
289
|
+
class Prod success
|
|
290
|
+
class Alert,Roll danger
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
## Class / ER diagrams — themeVariables only
|
|
294
|
+
|
|
295
|
+
`classDef` inside `classDiagram` is unreliable in Mermaid v11 (silently ignored when combined
|
|
296
|
+
with frontmatter config; washed out via `cssClass` — verified by rendering). Style these two
|
|
297
|
+
types with the universal frontmatter block alone: `primaryColor` sky fills headers/boxes,
|
|
298
|
+
`primaryBorderColor` and `lineColor` keep the dark outline. Do not emit classDef/cssClass here.
|
|
299
|
+
|
|
300
|
+
## Sequence diagram
|
|
301
|
+
|
|
302
|
+
Add to the universal block:
|
|
303
|
+
|
|
304
|
+
```yaml
|
|
305
|
+
actorBkg: "#8ECAFF"
|
|
306
|
+
actorBorder: "#444444"
|
|
307
|
+
actorTextColor: "#111111"
|
|
308
|
+
actorLineColor: "#777777"
|
|
309
|
+
signalColor: "#444444"
|
|
310
|
+
signalTextColor: "#111111"
|
|
311
|
+
activationBkgColor: "#FFD43B"
|
|
312
|
+
activationBorderColor: "#444444"
|
|
313
|
+
labelBoxBkgColor: "#D0BFFF"
|
|
314
|
+
labelBoxBorderColor: "#444444"
|
|
315
|
+
noteBkgColor: "#FFF9DB"
|
|
316
|
+
noteBorderColor: "#444444"
|
|
317
|
+
noteTextColor: "#111111"
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
## Pie chart
|
|
321
|
+
|
|
322
|
+
```yaml
|
|
323
|
+
pie1: "#8ECAFF"
|
|
324
|
+
pie2: "#FFD43B"
|
|
325
|
+
pie3: "#8CE99A"
|
|
326
|
+
pie4: "#FF8787"
|
|
327
|
+
pie5: "#D0BFFF"
|
|
328
|
+
pie6: "#63E6BE"
|
|
329
|
+
pie7: "#FFA94D"
|
|
330
|
+
pie8: "#FAA2C1"
|
|
331
|
+
pieStrokeColor: "#444444"
|
|
332
|
+
pieStrokeWidth: 1.5px
|
|
333
|
+
pieOuterStrokeColor: "#444444"
|
|
334
|
+
pieOuterStrokeWidth: 2px
|
|
335
|
+
pieOpacity: 1
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
`pieOpacity: 1` matters — the 0.7 default washes the palette out.
|
|
339
|
+
|
|
340
|
+
## Gantt
|
|
341
|
+
|
|
342
|
+
```yaml
|
|
343
|
+
sectionBkgColor: "#FFF9DB"
|
|
344
|
+
altSectionBkgColor: "#FFFFFF"
|
|
345
|
+
taskBkgColor: "#8ECAFF"
|
|
346
|
+
taskBorderColor: "#444444"
|
|
347
|
+
taskTextColor: "#111111"
|
|
348
|
+
taskTextOutsideColor: "#111111"
|
|
349
|
+
activeTaskBkgColor: "#FFD43B"
|
|
350
|
+
activeTaskBorderColor: "#444444"
|
|
351
|
+
doneTaskBkgColor: "#8CE99A"
|
|
352
|
+
doneTaskBorderColor: "#444444"
|
|
353
|
+
critBkgColor: "#FF8787"
|
|
354
|
+
critBorderColor: "#444444"
|
|
355
|
+
todayLineColor: "#FF8787"
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
## User journey
|
|
359
|
+
|
|
360
|
+
```yaml
|
|
361
|
+
fillType0: "#8ECAFF"
|
|
362
|
+
fillType1: "#FFD43B"
|
|
363
|
+
fillType2: "#8CE99A"
|
|
364
|
+
fillType3: "#FF8787"
|
|
365
|
+
fillType4: "#D0BFFF"
|
|
366
|
+
fillType5: "#63E6BE"
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
## Timeline / mindmap / kanban
|
|
370
|
+
|
|
371
|
+
All three take the `cScale` palette (timeline periods, mindmap branches, kanban columns),
|
|
372
|
+
but Mermaid 11.16's Kanban renderer has the version-specific offset documented below.
|
|
373
|
+
Three traps make the default output ugly:
|
|
374
|
+
|
|
375
|
+
1. **Unset `cScaleInv` auto-derives the hue-opposite of each `cScale` color** and paints it on
|
|
376
|
+
the accent underline of every timeline box — sky gets an orange underline, amber gets blue,
|
|
377
|
+
green gets magenta, red gets cyan (verified by rendering). Pin every `cScaleInv` to the ink
|
|
378
|
+
border so accents stay uniform.
|
|
379
|
+
2. **The renderer tints large fills lighter** (timeline event rows, kanban column backgrounds),
|
|
380
|
+
so pastel tokens wash out. Use the strong palette here.
|
|
381
|
+
3. **Mindmap ignores pinned `cScaleLabel` values** — node label colors are auto-derived per
|
|
382
|
+
section instead, and on dark theme-following pages several sections come out low-contrast
|
|
383
|
+
to unreadable (observed 2026-07 on GitHub dark mode). Do not rely on `cScaleLabel` to fix
|
|
384
|
+
mindmap contrast; on theme-varying hosts use the flowchart catalog pattern from the
|
|
385
|
+
theme-following-hosts section instead of a mindmap.
|
|
386
|
+
|
|
387
|
+
```yaml
|
|
388
|
+
cScale0: "#339AF0"
|
|
389
|
+
cScale1: "#FAB005"
|
|
390
|
+
cScale2: "#40C057"
|
|
391
|
+
cScale3: "#FA5252"
|
|
392
|
+
cScale4: "#9775FA"
|
|
393
|
+
cScale5: "#20C997"
|
|
394
|
+
cScaleLabel0: "#111111"
|
|
395
|
+
cScaleLabel1: "#111111"
|
|
396
|
+
cScaleLabel2: "#111111"
|
|
397
|
+
cScaleLabel3: "#111111"
|
|
398
|
+
cScaleLabel4: "#111111"
|
|
399
|
+
cScaleLabel5: "#111111"
|
|
400
|
+
cScaleInv0: "#444444"
|
|
401
|
+
cScaleInv1: "#444444"
|
|
402
|
+
cScaleInv2: "#444444"
|
|
403
|
+
cScaleInv3: "#444444"
|
|
404
|
+
cScaleInv4: "#444444"
|
|
405
|
+
cScaleInv5: "#444444"
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
Set as many `cScale*`/`cScaleLabel*`/`cScaleInv*` slots as the diagram has sections
|
|
409
|
+
(12 slots, indexed 0 through 11).
|
|
410
|
+
When a timeline has **no sections** (or the periods carry no meaning worth color-coding),
|
|
411
|
+
avoid the per-period rainbow entirely — one hue reads calmer:
|
|
412
|
+
|
|
413
|
+
```yaml
|
|
414
|
+
config:
|
|
415
|
+
timeline:
|
|
416
|
+
disableMulticolor: true
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
### Kanban specifics
|
|
420
|
+
|
|
421
|
+
Mermaid 11.16 assigns its first Kanban column to `section-1`, while its generated style sheet
|
|
422
|
+
maps `section-1` to `cScale2`. The isolated render therefore uses `cScale2` for column one,
|
|
423
|
+
`cScale3` for column two, and so on. This is renderer behavior, not the intuitive zero-based
|
|
424
|
+
order; recheck it when upgrading Mermaid.
|
|
425
|
+
|
|
426
|
+
```yaml
|
|
427
|
+
# Mermaid 11.16 Kanban column 1..4 compatibility mapping
|
|
428
|
+
cScale2: "#339AF0"
|
|
429
|
+
cScale3: "#FAB005"
|
|
430
|
+
cScale4: "#40C057"
|
|
431
|
+
cScale5: "#9775FA"
|
|
432
|
+
cScaleLabel2: "#111111"
|
|
433
|
+
cScaleLabel3: "#111111"
|
|
434
|
+
cScaleLabel4: "#111111"
|
|
435
|
+
cScaleLabel5: "#111111"
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
The renderer lightens these colors by 10%, so the strong inputs remain readable. Ticket cards
|
|
439
|
+
stay on a neutral fill by design; convey urgency with documented `priority` metadata instead
|
|
440
|
+
of fighting it:
|
|
441
|
+
|
|
442
|
+
```
|
|
443
|
+
kanban
|
|
444
|
+
todo[Todo]
|
|
445
|
+
t1[Fix login timeout]@{ priority: 'Very High' }
|
|
446
|
+
t2[Write API spec]@{ priority: 'Low' }
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
`priority` accepts `'Very High'`, `'High'`, `'Low'`, `'Very Low'` and colors the card edge
|
|
450
|
+
red → orange → blue → light blue. Use `Very High`/`High` for risky or bug-suspect work so the
|
|
451
|
+
board pinpoints hot items at a glance.
|
|
452
|
+
|
|
453
|
+
## Quadrant chart
|
|
454
|
+
|
|
455
|
+
```yaml
|
|
456
|
+
quadrant1Fill: "#8CE99A"
|
|
457
|
+
quadrant2Fill: "#8ECAFF"
|
|
458
|
+
quadrant3Fill: "#FFF9DB"
|
|
459
|
+
quadrant4Fill: "#FF8787"
|
|
460
|
+
quadrant1TextFill: "#111111"
|
|
461
|
+
quadrant2TextFill: "#111111"
|
|
462
|
+
quadrant3TextFill: "#111111"
|
|
463
|
+
quadrant4TextFill: "#111111"
|
|
464
|
+
quadrantPointFill: "#111111"
|
|
465
|
+
quadrantPointTextFill: "#111111"
|
|
466
|
+
quadrantXAxisTextFill: "#111111"
|
|
467
|
+
quadrantYAxisTextFill: "#111111"
|
|
468
|
+
quadrantInternalBorderStrokeFill: "#444444"
|
|
469
|
+
quadrantExternalBorderStrokeFill: "#444444"
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
## XY chart
|
|
473
|
+
|
|
474
|
+
`xyChart` variables are a nested object:
|
|
475
|
+
|
|
476
|
+
```yaml
|
|
477
|
+
xyChart:
|
|
478
|
+
backgroundColor: "#FFFFFF"
|
|
479
|
+
titleColor: "#111111"
|
|
480
|
+
xAxisLabelColor: "#111111"
|
|
481
|
+
xAxisTitleColor: "#111111"
|
|
482
|
+
xAxisTickColor: "#444444"
|
|
483
|
+
xAxisLineColor: "#444444"
|
|
484
|
+
yAxisLabelColor: "#111111"
|
|
485
|
+
yAxisTitleColor: "#111111"
|
|
486
|
+
yAxisTickColor: "#444444"
|
|
487
|
+
yAxisLineColor: "#444444"
|
|
488
|
+
plotColorPalette: "#339AF0, #FD7E14, #40C057, #FA5252, #9775FA, #20C997"
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
Bars and lines have no border, so pastel fills look anemic at bar size — the palette above
|
|
492
|
+
uses the strong tokens, and its first pair (blue bars, orange line) stays distinguishable
|
|
493
|
+
for colorblind readers. Colors assign to plots in order of appearance: put the series you
|
|
494
|
+
want blue first. For bar charts also turn on the value labels (v11.14+):
|
|
495
|
+
|
|
496
|
+
```yaml
|
|
497
|
+
config:
|
|
498
|
+
xyChart:
|
|
499
|
+
showDataLabel: true
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
## Git graph
|
|
503
|
+
|
|
504
|
+
```yaml
|
|
505
|
+
git0: "#8ECAFF"
|
|
506
|
+
git1: "#FFD43B"
|
|
507
|
+
git2: "#8CE99A"
|
|
508
|
+
git3: "#FF8787"
|
|
509
|
+
gitBranchLabel0: "#111111"
|
|
510
|
+
gitBranchLabel1: "#111111"
|
|
511
|
+
gitBranchLabel2: "#111111"
|
|
512
|
+
gitBranchLabel3: "#111111"
|
|
513
|
+
commitLabelColor: "#111111"
|
|
514
|
+
commitLabelBackground: "#FFF9DB"
|
|
515
|
+
tagLabelColor: "#111111"
|
|
516
|
+
tagLabelBackground: "#D0BFFF"
|
|
517
|
+
tagLabelBorder: "#444444"
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
## Sankey — config.sankey (v11.15+)
|
|
521
|
+
|
|
522
|
+
Sankey colors live in `config.sankey`, not themeVariables. `nodeColors` keys are the
|
|
523
|
+
node names from the CSV rows; unlisted nodes keep the default scheme:
|
|
524
|
+
|
|
525
|
+
```yaml
|
|
526
|
+
config:
|
|
527
|
+
theme: base
|
|
528
|
+
themeVariables:
|
|
529
|
+
fontFamily: cascadia mono, consolas, noto sans mono, menlo, monospace
|
|
530
|
+
fontSize: 15px
|
|
531
|
+
textColor: "#111111"
|
|
532
|
+
sankey:
|
|
533
|
+
linkColor: gradient
|
|
534
|
+
labelStyle: outlined
|
|
535
|
+
nodeColors:
|
|
536
|
+
Traffic: "#8ECAFF"
|
|
537
|
+
Signup: "#8CE99A"
|
|
538
|
+
Bounce: "#FF8787"
|
|
539
|
+
Paid: "#FFD43B"
|
|
540
|
+
Free: "#D0BFFF"
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
`linkColor: gradient` blends each flow between its endpoint colors;
|
|
544
|
+
`labelStyle: outlined` puts a stroke behind labels so they stay readable on the flows.
|
|
545
|
+
|
|
546
|
+
## TreeView — nested treeView themeVariables
|
|
547
|
+
|
|
548
|
+
```yaml
|
|
549
|
+
treeView:
|
|
550
|
+
labelColor: "#111111"
|
|
551
|
+
lineColor: "#444444"
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
`iconColor` also exists, but icons are unreliable: with `showIcons: true` the icon
|
|
555
|
+
symbols land in the SVG `<defs>` yet never get instanced (verified v11.16) — rows just
|
|
556
|
+
reserve empty indent space. Leave icons off.
|
|
557
|
+
|
|
558
|
+
## Venn — style statements
|
|
559
|
+
|
|
560
|
+
Venn ignores themeVariables colors; style each set with `style` lines. The default
|
|
561
|
+
fill-opacity is so low the fills look white — raise it to 0.6 so the palette shows
|
|
562
|
+
while overlaps stay readable:
|
|
563
|
+
|
|
564
|
+
```
|
|
565
|
+
style Frontend fill:#8ECAFF,stroke:#444444,color:#111111,fill-opacity:0.6
|
|
566
|
+
style Backend fill:#8CE99A,stroke:#444444,color:#111111,fill-opacity:0.6
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
Write the `title` unquoted — quotes render as literal characters.
|
|
570
|
+
|
|
571
|
+
## C4 diagrams — UpdateElementStyle macros
|
|
572
|
+
|
|
573
|
+
C4 ignores themeVariables colors; use its own macros after the last `Rel`.
|
|
574
|
+
Map elements to palette roles: person → accent, internal system → step,
|
|
575
|
+
external system → external.
|
|
576
|
+
|
|
577
|
+
```
|
|
578
|
+
UpdateElementStyle(customer, $bgColor="#D0BFFF", $fontColor="#111111", $borderColor="#444444")
|
|
579
|
+
UpdateElementStyle(bank, $bgColor="#8ECAFF", $fontColor="#111111", $borderColor="#444444")
|
|
580
|
+
UpdateElementStyle(mail, $bgColor="#FFA94D", $fontColor="#111111", $borderColor="#444444")
|
|
581
|
+
UpdateRelStyle(customer, bank, $textColor="#111111", $lineColor="#444444", $offsetY="-20")
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
`$offsetY="-20"` on each `UpdateRelStyle` lifts the label off the line (default overlaps).
|
|
585
|
+
|
|
586
|
+
## Coverage — all 31 diagram types (mermaid v11.16)
|
|
587
|
+
|
|
588
|
+
The 30 types on the docs sidebar plus railroad (documented but not listed there).
|
|
589
|
+
Every type renders with the universal block; what else applies differs per type
|
|
590
|
+
(all verified by rendering):
|
|
591
|
+
|
|
592
|
+
| Styling mechanism | Diagram types |
|
|
593
|
+
| ----------------- | ------------- |
|
|
594
|
+
| classDef roles + universal block | flowchart, state, block |
|
|
595
|
+
| type-specific themeVariables (sections above) | sequence, pie, gantt, journey, timeline, mindmap, kanban (columns via `cScale`), quadrant, xychart, gitgraph, treeView (`treeView-beta`) |
|
|
596
|
+
| universal block only — primary/cluster colors apply | class, ER, swimlanes (`swimlane-beta`), requirement, railroad (`railroad-ebnf-beta`) |
|
|
597
|
+
| `cScale0..n` palette (same block as timeline/mindmap) | radar (`radar-beta`, curve fills), treemap (`treemap-beta`, section colors) |
|
|
598
|
+
| `config.sankey` — `nodeColors` / `linkColor` (section above) | sankey |
|
|
599
|
+
| `style` lines per set (section above) | venn (`venn-beta`) |
|
|
600
|
+
| C4 macros — `UpdateElementStyle` / `UpdateRelStyle` (section above) | C4 |
|
|
601
|
+
| own fixed palette — universal block styles font/ink only | packet, architecture (`architecture-beta`), event modeling (`eventmodeling`), ishikawa (`ishikawa-beta`), wardley (`wardley-beta`), cynefin (`cynefin-beta`) |
|
|
602
|
+
| external plugin required | zenuml — register `@mermaid-js/mermaid-zenuml` first; plain mermaid errors "No diagram type detected". Ignores themeVariables (its header clips ~50px with any container stack — pre-existing plugin issue, measured against the sans baseline) |
|
|
603
|
+
|
|
604
|
+
The own-palette types are already legible out of the box (cynefin domain tints,
|
|
605
|
+
event-modeling entity colors); do not fight them with overrides. Specifics verified
|
|
606
|
+
by rendering: packet's documented theme variables are a no-op (upstream bug — blocks
|
|
607
|
+
stay `#efefef`); architecture exposes only layout knobs (`randomize`, fcose tuning),
|
|
608
|
+
no colors; wardley and zenuml expose no color config at all.
|
|
609
|
+
|
|
610
|
+
## Legibility checklist (before returning the diagram)
|
|
611
|
+
|
|
612
|
+
- [ ] `fontFamily` is the default mono stack at 15px (or the documented sans option at 16px); no `font-weight` in any classDef.
|
|
613
|
+
- [ ] Every node has an explicit class (flowchart/state) or the type's themeVariables are set.
|
|
614
|
+
- [ ] No light text on light fill anywhere.
|
|
615
|
+
- [ ] Same role ⇒ same color across the whole diagram.
|
|
616
|
+
- [ ] Labels ≤ 6 words; edge labels ≤ 3 words.
|
|
617
|
+
- [ ] Direction fits the story: `TD` for processes, `LR` for pipelines/timelines.
|
|
618
|
+
- [ ] Theme-following host (GitHub README): no frontmatter `title:`, no mindmap, and no text
|
|
619
|
+
on the bare canvas — every label sits on an explicitly filled shape or the white
|
|
620
|
+
edge-label pill.
|