Hook0 Documentation
Diagrams — Mermaid Design System (dark/light mode)
- NEVER use ASCII art in documentation. Always use Mermaid diagrams.
- Docusaurus has
@docusaurus/theme-mermaidconfigured with{ light: 'base', dark: 'dark' }. - NEVER use
style NodeX fill:#hexin mermaid blocks. UseclassDef+:::classsyntax instead. classDeflines in .md files set light mode colors inline (fill, stroke, color). This makes light mode work out of the box.- Dark mode is handled by a JS client module (
documentation/src/mermaid/theme-switcher.js) that mutates inline SVG styles on theme change. CSS!importantcannot reliably override Mermaid's inlinestyleattributes, so JS is required. - CSS variables for mermaid colors are kept in
documentation/src/css/custom.cssfor reference but are NOT used for node styling. - Prefer
flowchart LRfor data flows,stateDiagram-v2for state machines.
Semantic node classes
| Class | Semantic role | Light mode | Dark mode |
|---|---|---|---|
:::external | External systems, inputs, API clients | Blue (#dbeafe bg) | Deep blue (#1e3a5f bg) |
:::hook0 | Hook0 components, infrastructure | Green (#dcfce7 bg) | Deep green (#052e16 bg) |
:::customer | User/customer endpoints, outputs | Orange (#ffedd5 bg) | Deep orange (#431407 bg) |
:::processing | Internal processing, middleware | Purple (#ede9fe bg) | Deep purple (#2e1065 bg) |
:::danger | Error/failure states | Red (#fee2e2 bg) | Deep red (#450a0a bg) |
Template for new mermaid blocks
flowchart LR
A["Input"]:::external --> B["Hook0"]:::hook0
B --> C["Output"]:::customer
B -.- D["Internal"]:::processing
classDef external fill:#dbeafe,stroke:#60a5fa,color:#1e3a5f
classDef hook0 fill:#dcfce7,stroke:#4ade80,color:#14532d
classDef customer fill:#ffedd5,stroke:#fb923c,color:#7c2d12
classDef processing fill:#ede9fe,stroke:#a78bfa,color:#3b0764
classDef danger fill:#fee2e2,stroke:#f87171,color:#7f1d1d
Rules
- ALWAYS add
classDeflines at the bottom of the mermaid block (beforeclicklines). - ALWAYS apply
:::classto every node definition. - The
classDefvalues are the light-mode colors. The JS client module (src/mermaid/theme-switcher.js) handles dark mode by mutating inline styles. - For subgraph-level styling, use
class SubgraphName hook0syntax. - Only include the
classDeflines for classes actually used in the diagram.