Authoring

Reactive styling

A style block maps a visual property to an expression. The expression is re-evaluated whenever state, selection, or structure changes.

Node styles#

mantou
style node {
background: node.on ? chili : node.parent.on ? bamboo : cream
border: node.selected ? chili : border
opacity: node.hidden ? 0 : node.dimmed ? 0.25 : 1
pulse: node.status == "running"
shape: node.type == "database" ? database : rounded
}

Supported node properties: background, border, text, opacity, pulse, icon, and shape (one of rounded, circle, database, diamond).

Edge styles#

mantou
style edge {
color: edge.active ? chili : bamboo
width: edge.active ? 3 : 1
opacity: edge.dimmed ? 0.2 : 1
}

Theme tokens#

Colors are written as bare theme tokens that resolve to the Mantou palette: chili, cream, scallion, bamboo, soy, danger, border, muted. Raw CSS colors work too.

✺

Live recompute

In the diagram below, set a node's status to running in the panel — pulse turns on instantly because the style rule re-runs.

🥟

Reactive styles

Mini Map
🥟

Nothing selected

Click a node or edge to inspect it. Connected nodes light up, the rest dim.