Hand-authored, theme-aware vector art that scales crisply and respects dark/light. For relationship diagrams, reach for 🧜 MermaidGuru first.

1. 🎯 When

Pick SVGPick Mermaid
Precise custom shapes, icons, badgesAuto-laid flow / sequence / state
Exact pixel control / brand marks”Just show the relationship”
Annotated diagrams, gauges, legendsGraph that changes often
Non-graph illustrationER / mindmap structure

Rule of thumb: if a layout engine should place the boxes, use 🧜 MermaidGuru. If you place every point, use SVG.

2. πŸ“ viewBox

viewBox defines the coordinate space; width/height (or CSS) define the rendered size. Use viewBox for resolution independence β€” never bake in pixel width/height alone.

<svg viewBox="0 0 100 100" role="img" aria-labelledby="t d">
  <title id="t">Status badge</title>
  <desc id="d">Green check inside a ring</desc>
  <circle cx="50" cy="50" r="44" fill="none" stroke="currentColor" stroke-width="6" />
  <path
    d="M30 52 L45 67 L72 36"
    fill="none"
    stroke="currentColor"
    stroke-width="8"
    stroke-linecap="round"
    stroke-linejoin="round"
  />
</svg>

3. πŸŒ— Theme

The site is theme-adaptive β€” make SVG follow suit instead of freezing colors (same spirit as πŸ“œ SSOT Bible Β§4 for Mermaid).

  • 🎨 fill="currentColor" / stroke="currentColor" inherits the surrounding text color, so the art flips with the theme automatically.
  • πŸ§ͺ For accents, reference site CSS variables: fill="var(--secondary)", stroke="var(--tertiary)". Provide a sane literal fallback only where a var may be absent.
  • 🚫 Avoid hardcoded #fff/#000 β€” they break in one of the two themes.

4. β™Ώ A11y

  • 🏷️ Add role="img" + <title> (and <desc> for detail), wired via aria-labelledby="t d".
  • πŸ™ˆ Purely decorative SVG β†’ aria-hidden="true" and drop the title.
  • πŸ”€ Keep real labels as <text> (selectable, themeable) rather than outlined paths.

5. 🩹 Fixes

  • Invisible in light mode β†’ hardcoded dark fill; switch to currentColor/var().
  • Blurry when scaled β†’ missing viewBox; add it, drop fixed pixel sizing.
  • Clipped edges β†’ content exceeds viewBox; widen the box, not the element.
  • No screen-reader text β†’ add role="img" + <title>.

Need flow, not freehand? β†’ 🧜 MermaidGuru. Spatial maps β†’ πŸ—ΊοΈ CanvasGuru.