Mordoc

Diagrams

Style the canvas, lightbox, and participant colors used by Mordoc's diagrams.

1 MIN READ

This page covers diagram appearance. For the Markdown syntax used to draw a diagram, see Diagrams instead.

Open the override file

Text
config/styles/diagram.css

Canvas and controls

TokenWhat it controls
--diagram-grid-spacingSpacing of the dotted grid drawn behind every diagram.
--diagram-grid-dotThe dotted-grid background image itself. Defaults to a radial gradient using --color-border.
--diagram-radiusCorner radius of the inline diagram figure.
--diagram-overlay-bgBackdrop behind the full-screen lightbox.
--diagram-lightbox-radiusCorner radius of the lightbox panel.
--diagram-button-radiusCorner radius of the lightbox's close button and zoom-controls pill.
--diagram-zoom-button-radiusCorner radius of the +/ buttons inside the zoom-controls pill.

Diagram ink

These color the diagram's own drawing: labels, lifelines, arrows, and up to eight participant colors. Today only sequence diagrams use them, but they're shared primitives any future diagram type can draw from too.

TokenWhat it controls
--diagram-labelText color for labels. Tracks --color-fg, so there's usually no need to set it separately.
--diagram-label-bgBackground behind a label, erasing the dotted grid locally. Tracks --color-surface.
--diagram-lifelineColor of a participant's vertical lifeline.
--diagram-arrowColor of message arrows between participants.
--diagram-activation-1--diagram-activation-8Eight participant colors, assigned in order as participants appear in the diagram.

Example diagram.css

A config/styles/diagram.css that sets every token on this page, for both light and dark mode:

Css
:root {
  --diagram-grid-spacing: 20px;
  --diagram-grid-dot: radial-gradient(circle, #e5e5e5 1px, transparent 1px);
  --diagram-radius: 6px;
  --diagram-overlay-bg: rgba(0, 0, 0, 0.82);
  --diagram-lightbox-radius: 8px;
  --diagram-button-radius: 6px;
  --diagram-zoom-button-radius: 4px;

  --diagram-label: #1c1c1c;
  --diagram-label-bg: #fafafa;
  --diagram-lifeline: #757575;
  --diagram-arrow: #52514e;
  --diagram-activation-1: #2563eb;
  --diagram-activation-2: #16a34a;
  --diagram-activation-3: #db2777;
  --diagram-activation-4: #ca8a04;
  --diagram-activation-5: #0d9488;
  --diagram-activation-6: #ea580c;
  --diagram-activation-7: #6d28d9;
  --diagram-activation-8: #dc2626;
}

.dark {
  --diagram-grid-dot: radial-gradient(circle, #2e2e2e 1px, transparent 1px);
  --diagram-label: #ebebeb;
  --diagram-label-bg: #161616;
  --diagram-lifeline: #4f4e46;
  --diagram-arrow: #b0afaa;
  --diagram-activation-1: #60a5fa;
  --diagram-activation-2: #4ade80;
  --diagram-activation-3: #f472b6;
  --diagram-activation-4: #facc15;
  --diagram-activation-5: #2dd4bf;
  --diagram-activation-6: #fb923c;
  --diagram-activation-7: #a78bfa;
  --diagram-activation-8: #f87171;
}

Next step

© 2026 MordocPowered by Mordoc