Diagrams¶
"A diagram should feel like a note on a whiteboard — clear, calm, informative. Not a neon billboard."
Philosophy¶
Diagrams are light islands on a dark page — like a whiteboard pinned to a dark wall. White nodes, soft grey borders, thin muted connectors. Semantic colours only where meaningful (green=success, red=error). No emojis in nodes.
Reference: Stripe Docs — Quotes
🔴 Guardrails (Non-negotiable)¶
- No inline
styleorclassDefin Mermaid markdown — the theme handles all colours - No emojis in node labels — text only, clean and scannable
- No neon colours —
#66ffff,#ff66ff,#39ff14are permanently banned - Light canvas always — diagrams are light even on dark pages (whiteboard effect)
- All diagrams must look identical — same container, same node style, same connector weight
How It Works (Implemented)¶
Mermaid Theme (baseof.html)¶
The theme produces white nodes with dark grey text on any page:
Nodes: white fill (#FFFFFF), subtle border (#E5E5E5), dark text (#414552)
Lines: light grey (#C4C8D0), smooth curves (basis)
Clusters: light grey fill (#F5F5F5), subtle border (#E5E5E5)
Labels: dark text (#414552) on #FAFAFA background
Container CSS¶
Every .mermaid element gets a light dot-grid canvas:
.mermaid {
background: radial-gradient(circle, #D4D4D4 1px, transparent 1px);
background-size: 24px 24px;
background-color: #FAFAFA;
border: 1px solid #E5E5E5;
border-radius: 10px;
padding: 2rem;
}
/* Rounded node corners — soft pills */
.mermaid .node rect,
.mermaid .node polygon {
rx: 12 !important;
ry: 12 !important;
}
Fullscreen Button¶
Every diagram gets a subtle ⛶ button (bottom-right, appears on hover). Uses native requestFullscreen() with iOS CSS fallback. Script: static/js/zt-diagram.js.
CSS Files¶
| Selector | File | Covers |
|---|---|---|
.content-body .mermaid |
style.css |
Default single pages |
.lic-single-content pre.mermaid |
licensing.css |
Licensing plan pages |
.zt-reading-body .mermaid |
zt-reading.css |
Blog reading layout |
All three must stay in sync — same light canvas, same rounded corners.
Writing Mermaid Diagrams¶
Do¶
` ` `mermaid
flowchart LR
A[Draft] --> B[Review]
B --> C{Approved?}
C -->|Yes| D[Published]
C -->|No| E[Revise]
E --> B
` ` `
- Use
flowchart TDfor hierarchies,flowchart LRfor processes - Keep nodes short — 3-5 words max
- Use
<br/>for line breaks (not\n) - Keep diagrams compact — 6-10 nodes ideal
- Split complex flows into multiple smaller diagrams
Don't¶
- ❌
style A fill:#... stroke:#... color:#...— theme handles this - ❌
classDefdefinitions — not needed - ❌ Emojis in node labels:
["🔐 Security"]→["Security"] - ❌
\nfor line breaks → use<br/>instead - ❌ Diagrams with 15+ nodes — break them up
- ❌
color:#ffffffor any inline colour overrides
Result¶
White rounded nodes, thin grey arrows, on a light dot-grid canvas. Calm, scannable, professional — like Stripe Docs.