Spec

Theme manifest spec

The theme contract keeps generated Excalidraw diagrams portable across agents, renderers, and brand styles. A theme is both machine-readable tokens and agent-readable instructions.

Files in a theme package

FileRequiredPurpose
theme.jsonyesManifest: name, version, inheritance, metadata, semantic roles.
palette.jsonyesMachine-readable color tokens used by renderers and MCP tools.
palette.mdyesAgent-readable guidance explaining when to use each token.
typography.jsonnoFont family, sizes, line height, and emphasis policy.
elements/*.jsonnoPer-element defaults such as box, arrow, and callout styles.
layouts/*.mdnoComposition presets such as concept cards, pipelines, and layered stacks.
preview.pngrecommendedPreview image for registries and docs.

Minimal manifest

{
  "name": "my-brand",
  "version": "0.1.0",
  "description": "Brand theme for ACME Co.",
  "extends": "default-sketchy"
}

Full manifest

{
  "name": "my-brand",
  "version": "1.2.0",
  "description": "Brand theme for ACME Co.",
  "extends": "default-sketchy",
  "author": "Jane Doe <jane@acme.com>",
  "homepage": "https://github.com/acme/excalidraw-theme-my-brand",
  "license": "MIT",
  "preview": "preview.png",
  "roles": {
    "ink": "#1a1a1a",
    "paper": "#fff8f3",
    "accent": "#ff5722",
    "accent_alt": "#ffa000",
    "evidence_bg": "#f5f5f5",
    "evidence_text": "#212121",
    "muted": "#9e9e9e"
  }
}

Required fields

FieldTypeConstraint
namestringkebab-case; should match the npm package suffix after theme-.
versionstringsemver.

Semantic roles

RoleMeaningRequired
inkPrimary text and strokes.yes
paperMain background.yes
accentThe argument color. Use one accent per diagram.yes
mutedSecondary text, grid lines, dividers.yes
accent_altSecondary accent for explicit comparison diagrams.no
evidence_bgBackground for code, JSON, and concrete evidence artifact boxes.no
evidence_textText inside evidence artifacts.no
warningSoft warning state.no
dangerHard error state.no

Inheritance

A child theme can extend default-sketchy or another theme. Resolution merges in this order, with child values winning:

  1. palette.json deep-merged key by key.
  2. typography.json deep-merged key by key.
  3. elements/*.json replaced file by file.
  4. layouts/*.md replaced file by file.

Versioning

ChangeBump
Typo fix in palette.md, no token value changed.PATCH
Add a semantic role, layout, or element override.MINOR
Change existing colors or typography in a way that shifts renders.MAJOR

Pin theme versions in CI golden-image pipelines when exact render reproducibility matters.