Skip to content

CustomTheme

Defined in: src/types/index.ts:466

A colour/typography theme for diagram rendering.

Every field is optional. Whatever is omitted comes from the built-in theme named by base ('light' unless set), so a theme that only changes fontSize, or one state type’s fill, is a one-line object. A fully specified theme still works as before.

const bigDark: CustomTheme = { base: 'dark', fontSize: 18 };
const greenTasks: CustomTheme = { nodeColors: { Task: { fill: '#e8f5e9' } } };
background?: string;

Defined in: src/types/index.ts:467


base?: "light" | "dark";

Defined in: src/types/index.ts:469

Built-in theme the omitted fields are taken from. Defaults to 'light'.


edgeColors?: Partial<{
choice: string;
default: string;
error: string;
normal: string;
retry?: string;
}>;

Defined in: src/types/index.ts:470


fontFamily?: string;

Defined in: src/types/index.ts:471


fontSize?: number;

Defined in: src/types/index.ts:472


nodeColors?: Partial<Record<StateType, Partial<{
fill: string;
stroke: string;
}>>>;

Defined in: src/types/index.ts:478

Per-state-type fill and stroke. Mermaid output rewrites comma-separated rgb()/hsl() colours to the space-separated form and leaves out, with a %% comment, any value it can’t draw on one style line.


textColor?: string;

Defined in: src/types/index.ts:479