Pimp My IDE / garage dispatch
Back to garage
Pele 1.6.0 / themeable SVG / 17 Oct 2026

Change the paint. Keep the wiring.

Pele renders Mermaid text as SVG and lets CSS variables change its colors without another render. That clean split is useful only if syntax, layout, and embedding policy stay visible too.

Treat source, geometry, paint, and host policy as four separate parts of the diagram.
Three connected diagram nodes inside a paint boothTEXTSVGCSS
Same nodes / same edges
new custom properties

The useful part is the separation

Pele is an open-source renderer from Obsidian. It accepts Mermaid syntax and returns SVG. Its documentation says the main entry supports every diagram type built into Mermaid 12.1.0. It also has smaller entry points for selected diagram types and lazy loading.

Pele reports a 230 kilobyte gzip bundle, no runtime dependencies, and render times between 0.05 and 0.3 milliseconds in its comparison table. Those are publisher measurements. This dispatch did not reproduce them.

The useful change is not a prettier diagram. Its colors can change without rebuilding its geometry.

CSS can own the paint

Pele exposes variables for the diagram background, text, edges, node surfaces, borders, accents, critical states, fonts, and corner radius. A parent element can set them. Light and dark themes can switch without another render.

This fits the browser well. SVG has presentation properties that CSS can control. MDN also recommends custom properties when styles need to pass through referenced SVG elements. The result can follow the surrounding interface instead of arriving as a fixed-color screenshot.

Fonts need more care. Pele measures labels when it sizes nodes. Its guide says to use the same font for measurement and display, then call refresh() after a font change. A color swap is paint. A font swap can change geometry.

Compatible syntax does not mean identical output

Pele targets Mermaid 12.1.0 syntax, but it uses its own layout engine and visual style. The compatibility guide says node positions, spacing, and edge paths can differ. Mermaid theme variables do not carry over. External Mermaid plugins, including ZenUML, are not supported.

A renderer can accept the same source without promising the same pixels. If a diagram is documentation, test whether the important route survives the new layout. Check narrow containers too. Pele can adapt a wide diagram instead of shrinking every label.

The host still owns trust

Pele escapes diagram text, filters links and styles, and sets default source, output, and edge limits. Its security guide says JavaScript callbacks in click statements are ignored. It always blocks javascript:, data:, and vbscript: URLs.

The host application still has work. Images can make network requests. Error messages can contain source text and should be inserted with textContent. Custom icon markup is trusted input. Internal links still need the host's navigation policy. The guide also tells applications not to hand render options directly to diagram authors.

  1. Pin the Mermaid syntax version you accept.
  2. Compare the route and labels after switching renderers.
  3. Set theme variables in one parent scope.
  4. Test the narrowest supported container.
  5. Disable links and images unless the diagram needs them.
  6. Display parse errors as text.
Interactive makeover / CSS theme switchboard

Diagram paint booth

A static diagram preview hides the relationship between structure and theme. This booth keeps one SVG in place while native controls feed it new CSS variables. The checklist records the checks that still belong to the host.

SourceLayoutThemeEmbed

Feed the paint line

These radios change the palette only. They do not replace the SVG nodes or edges.

Theme preset
Host release checks

Inspect the settled SVG

The native radio value drives every color mirror. The diagram source stays mounted.

Theme feedGARAGE PAPER
Diagram rendering contractMermaid source enters a renderer. SVG structure and CSS theme remain separate before host policy checks.ONE MOUNTED SVG / CSS VARIABLE FEEDMERMAIDSOURCESVGSTRUCTURERENDERED ONCECSSPAINT FEEDHOST POLICY CHECKS
SVG children18 retained
Theme updates0 variable feeds
Runtime claimNot exercised here
RELEASE CHECKS OPEN0 of 4 host checks selected. No renderer run attached.

What this component proves. It changes one mounted SVG through CSS variables and keeps the host checks visible. It does not run Pele, validate Mermaid compatibility, approve contrast, or prove that any diagram is safe to embed.

Sources read / 17 Oct 2026

Evidence bay

Project documentation

Pele introduction

Supplies the render model, supported Mermaid baseline, publisher size and speed comparisons, package command, and Obsidian origin.

Read the introduction
Project documentation

Pele theming guide

Defines CSS variables, class hooks, font measurement, refresh behavior, and fixed styles inside diagram source.

Read the theming guide
Project documentation

Compatibility and security

Separates syntax support from layout identity. It also states URL, image, icon, error, and size boundaries.

Read compatibility / Read security
Web platform reference

MDN SVG and CSS

Documents CSS styling for SVG and the use of custom properties with referenced SVG elements.

Read the SVG guide
Immutable package intake

npm package pele 1.6.0

The npm registry reported version 1.6.0 at 14:23 UTC on October 17. The exact archive was 822,883 bytes with 416 members and SHA-256 0945cbff58d4c9c4959a15e18b1e6743c76ab40525de856fc478fdc4ed989a63. Its manifest declares Node 20 or newer, MIT licensing, and package exports for the full, core, lazy, per-diagram, and global builds. Archive inspection proves distribution contents, not installation or runtime behavior.

Inspect the exact archive / Inspect the repository / Read Hacker News item 50132193