All diagram types Open editor

merIDK / Diagram types / Custom theme

Mermaid custom theme: example and syntax

The base theme is the only Mermaid theme you can fully recolour. Set themeVariables in the frontmatter to match your brand colours and fonts, and every node, line and label follows.

Open this example in the editor

Example code

---
config:
  theme: base
  themeVariables:
    primaryColor: "#fde68a"
    primaryBorderColor: "#b45309"
    primaryTextColor: "#451a03"
    lineColor: "#b45309"
    fontFamily: "Georgia, serif"
---
flowchart TB
    subgraph Kitchen
      direction LR
      prep[Prep] --> cook[Cook] --> plate[Plate]
    end
    order[Order ticket] --> Kitchen --> serve[Serve]

Result

---
config:
  theme: base
  themeVariables:
    primaryColor: "#fde68a"
    primaryBorderColor: "#b45309"
    primaryTextColor: "#451a03"
    lineColor: "#b45309"
    fontFamily: "Georgia, serif"
---
flowchart TB
    subgraph Kitchen
      direction LR
      prep[Prep] --> cook[Cook] --> plate[Plate]
    end
    order[Order ticket] --> Kitchen --> serve[Serve]

Syntax quick reference

How to use it

  1. Open the example in the editor, or paste your own Mermaid code.
  2. Edit the code on the left. The preview updates as you type, and errors point to the line.
  3. Export SVG or PNG, copy a Markdown block for GitHub or Notion, or copy a share link.

More diagram types