<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/pele-mermaid-diagrams-as-themeable-svg-tsmiyab5v" -->

---
title: Pele – Mermaid diagrams as themeable SVG | daily.dev
description: Pele is a lightweight open source library that renders Mermaid diagrams to SVG, themed with CSS variables. It has zero dependencies and is 6 times smaller and...
canonical: https://daily.dev/posts/pele-mermaid-diagrams-as-themeable-svg-tsmiyab5v
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Pele – Mermaid diagrams as themeable SVG | daily.dev
og:description: Pele is a lightweight open source library that renders Mermaid diagrams to SVG, themed with CSS variables. It has zero dependencies and is 6 times smaller and...
og:url: https://daily.dev/posts/pele-mermaid-diagrams-as-themeable-svg-tsmiyab5v
og:image: https://api.daily.dev/og/posts/TsMIYaB5v.png
og:image:alt: Pele – Mermaid diagrams as themeable SVG
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Pele – Mermaid diagrams as themeable SVG

**[Hacker News](https://daily.dev/sources/hn)** · 2 min read · 279 upvotes · 8 comments

## Summary

Pele is a lightweight open source library that renders Mermaid diagrams to SVG, themed with CSS variables. It has zero dependencies and is 6 times smaller and up to 500 times faster than Mermaid.js. Gzip bundle size is 230 kB versus 1.6 MB for Mermaid.js, and render time is 0.05 to 0.3 ms versus 6 to 82 ms. It supports every diagram type built into Mermaid 12.1.0 and is developed for Obsidian.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://pele.run/>

## Questions this post answers

### Is there a faster, lighter alternative to Mermaid.js for rendering diagrams to SVG?

Pele is a zero-dependency library that renders Mermaid diagram syntax to SVG with a gzipped bundle around 230 kB versus Mermaid.js's 1.6 MB, and render times of 0.05-0.3 ms compared to 6-82 ms for Mermaid.js. It supports every diagram type built into Mermaid 12.1.0 and is themed using CSS variables instead of theme configuration objects.

_Compare lightweight diagram renderers like this on daily.dev before picking one for your app._

### How do you theme Mermaid-style diagrams without re-rendering them?

Pele applies theming through CSS variables such as --pele-bg, --pele-fg, --pele-muted, --pele-line, --pele-surface, --pele-surface-alt, and --pele-border, so color changes take effect without re-rendering the SVG. This differs from Mermaid.js, which requires passing a theme configuration at render time.

_Developers picking a diagram theming approach can track options like this on daily.dev._

## Community take

How the wider developer community reacted, aggregated from 1 discussion and 37 comments across hackernews (as of 2026-10-20).

**TL;DR:** Developers are impressed by the layout quality and CSS-variable theming, especially for dark mode and server-side rendering, though the broader conversation also drifts into general gripes about Mermaid's graph-layout problems and alternative tools.

**Sentiment:** 55% positive · 35% mixed · 10% skeptical

**The case for**

- Layout quality is seen as a big improvement over Mermaid.js's often messy auto-layout.
- Theming with CSS variables finally makes dark/light mode theming of diagrams practical.
- The ability to change colors without re-rendering is appreciated.
- Specific syntax details, like subgraphs keeping their own direction, were enough to convince some to switch.

**The pushback**

- Some examples aren't very dark-mode friendly.
- A flash-of-unstyled-content issue was noted in one of the larger examples.
- The playground's mermaid preview was reported broken by at least one commenter.
- One person questioned why this wasn't contributed back into Mermaid itself rather than built separately.

**By community**

- hackernews (positive): Enthusiastic reception focused on layout quality and theming, with a side tangent about the word 'pele' in various languages and general discussion of graph-layout tools.

**Open questions**

- Will there be support for visual diffing of diagrams alongside source diffs?
- Does the official Mermaid library still require a browser environment for layout, making Pele notable for embedding elsewhere?

**Highlights**

> I strongly agree, and that's why I designed Pele to only follow its syntax not its layout. See the examples https://pele.run/examples The playground also has a Compare mode https://pele.run/playground
> — [kepano on hackernews · 2 comments](https://news.ycombinator.com/item?id=50134925)

> > A flowchart subgraph keeps its own direction even when it links to nodes outside the subgraph. This, in and of itself, is sufficient reason for me to switch, even if it were slower than Mermaid.js. I’ve not even made it through the list yet and I’m sold.
> — [Ancapistani on hackernews](https://news.ycombinator.com/item?id=50137419)

> To quote another reply regarding mermaid by @kepano: > Mermaid.js has transitioned to "mermaid.ai" and is losing its original vision. Take a look at their new site. > The latest version of Mermaid (12.1) ships with yet another layout engine (three now), and has a questionable safety record (see CVEs). In Obsidian 1.13 we had to introduce a new toggle/warning because of potential unsafe Mermaid diagrams. https://x.com/kepano/status/2111575190081847776
> — [blazarquasar on hackernews](https://news.ycombinator.com/item?id=50138731)

> The examples are not very dark-mode friendly
> — [shellerik on hackernews](https://news.ycombinator.com/item?id=50136733)

> Noting that the mermaid preview in the playground is broken.
> — [kinduff on hackernews · 1 comments](https://news.ycombinator.com/item?id=50136029)

**Source threads**

- [hackernews](https://news.ycombinator.com/item?id=50132193) · 379 points · 37 comments

## Community discussion

Top comments from developers on daily.dev.

**@skepagent** · 7 upvotes

> The part that stands out to me is theming entirely through CSS variables — with regular Mermaid, matching diagrams to a site's dark mode means re-initializing with a different theme config, while here the diagram just inherits your theme, transitions included. The open question is syntax drift: parity with 12.1.0 is great today, but a from-scratch renderer has to chase every upstream Mermaid release. Is there a plan to track supported Mermaid versions explicitly?

**@arkmob** · 1 upvotes

> awesome framework for Claude to document code

**@ristotoldsep** · 1 upvotes

> CSS variables for Mermaid diagrams? Finally, a diagram that understands dark mode.

**@ragu** · 0 upvotes

> You can now theme your flowcharts to match company colors or choose a design that is more aesthetically pleasing than the standard flowchart palette.

**@youssofk** · 0 upvotes

> I've been looking recently into the idea of mermaid diagrams and their central role in making system design easier with agents and AI overall, and at a certain level this helps make things better for masses especially that they are widely used by AI a lot lately. Imagine building the building blocks through mermaid diagrams on multiple levels with AI before starting to implement.

## Similar posts on daily.dev

- [lukilabs/beautiful-mermaid](https://daily.dev/posts/lukilabs-beautiful-mermaid-mnq05qf1z) · Hacker News · 6 upvotes · 0 comments
- [This tool replaced every diagramming app I've ever used](https://daily.dev/posts/this-tool-replaced-every-diagramming-app-i-ve-ever-used-bp8r9djhw) · XDA Developers · 1 upvotes · 3 comments
- [Introducing <mermaid-element>, a custom element to display Mermaid diagrams](https://daily.dev/posts/introducing-mermaid-element-a-custom-element-to-display-mermaid-diagrams-n0bvsfcxr) · Bram.us · 12 upvotes · 1 comments
- [Animated, interactive And visuals Mermaid Diagrams](https://daily.dev/posts/animated-interactive-and-visuals-mermaid-diagrams-dvfqnnec7) · Hacker News · 1 upvotes · 0 comments
- [Diagrams as Code: Mermaid Support on the new Foojay](https://daily.dev/posts/diagrams-as-code-mermaid-support-on-the-new-foojay-onkdjmmjl) · Foojay.io · 2 upvotes · 0 comments

---

Tags: [#css](https://daily.dev/tags/css), [#mermaid](https://daily.dev/tags/mermaid), [#open-source](https://daily.dev/tags/open-source), [#svg](https://daily.dev/tags/svg)

[View this post on daily.dev](https://daily.dev/posts/pele-mermaid-diagrams-as-themeable-svg-tsmiyab5v)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Pele – Mermaid diagrams as themeable SVG","url":"https://daily.dev/posts/pele-mermaid-diagrams-as-themeable-svg-tsmiyab5v","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/pele-mermaid-diagrams-as-themeable-svg-tsmiyab5v"},"datePublished":"2026-10-17T19:02:49.076Z","dateModified":"2026-11-19T02:14:16.599Z","description":"Pele is a lightweight open source library that renders Mermaid diagrams to SVG, themed with CSS variables. It has zero dependencies and is 6 times smaller and...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e875586d75adeacddf4a4b05e1c6bf04?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e875586d75adeacddf4a4b05e1c6bf04?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Hacker News","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Hacker News","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/hn","url":"https://daily.dev/sources/hn"},"commentCount":8,"discussionUrl":"https://daily.dev/posts/pele-mermaid-diagrams-as-themeable-svg-tsmiyab5v","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":279},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":8}],"keywords":"css,mermaid,open-source,svg","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Hacker News","item":"https://daily.dev/sources/hn"},{"@type":"ListItem","position":3,"name":"Pele – Mermaid diagrams as themeable SVG"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/pele-mermaid-diagrams-as-themeable-svg-tsmiyab5v","comment":[{"@type":"Comment","text":"The part that stands out to me is theming entirely through CSS variables — with regular Mermaid, matching diagrams to a site’s dark mode means re-initializing with a different theme config, while here the diagram just inherits your theme, transitions included. The open question is syntax drift: parity with 12.1.0 is great today, but a from-scratch renderer has to chase every upstream Mermaid release. Is there a plan to track supported Mermaid versions explicitly?","datePublished":"2026-10-18T03:22:04.573Z","url":"https://daily.dev/posts/TsMIYaB5v#c-KLku2CUJW","author":{"@type":"Person","name":"kris gu","url":"https://daily.dev/skepagent","image":"https://lh3.googleusercontent.com/a/ACg8ocJnnwFKNx7PJNhb7W6mFWr2k2SV_VHW_9ainY71DX_dv79frQ=s96-c"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":7}},{"@type":"Comment","text":"awesome framework for Claude to document code","datePublished":"2026-10-22T03:31:41.367Z","url":"https://daily.dev/posts/TsMIYaB5v#c-NACQNT5HX","author":{"@type":"Person","name":"Dan","url":"https://daily.dev/arkmob","image":"https://lh3.googleusercontent.com/a/ACg8ocKCo-HLknsFcRm2wKXOy7ipK4ngNWqTIL_4lc4lZqyt4uqOGww=s96-c"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"CSS variables for Mermaid diagrams? Finally, a diagram that understands dark mode.","datePublished":"2026-10-19T13:41:13.345Z","url":"https://daily.dev/posts/TsMIYaB5v#c-Ye21tMRtn","author":{"@type":"Person","name":"Risto Tõldsep","url":"https://daily.dev/ristotoldsep","image":"https://media.daily.dev/image/upload/s--i6RRoxB7--/f_auto,pg_1/v1794383659/avatars/avatar_ryDlbifZ1EuRuh3g51ryC?_a=BAMAMiiw0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"You can now theme your flowcharts to match company colors or choose a design that is more aesthetically pleasing than the standard flowchart palette.","datePublished":"2026-11-04T03:43:02.247Z","url":"https://daily.dev/posts/TsMIYaB5v#c-nDdKBsxDY","author":{"@type":"Person","name":"Ragunathan Maniraj","url":"https://daily.dev/ragu","image":"https://avatars.githubusercontent.com/u/13572570?v=4"}},{"@type":"Comment","text":"I’ve been looking recently into the idea of mermaid diagrams and their central role in making system design easier with agents and AI overall, and at a certain level this helps make things better for masses especially that they are widely used by AI a lot lately. Imagine building the building blocks through mermaid diagrams on multiple levels with AI before starting to implement.","datePublished":"2026-10-18T22:25:20.370Z","url":"https://daily.dev/posts/TsMIYaB5v#c-VlCCGEqL7","author":{"@type":"Person","name":"Youssof. K.","url":"https://daily.dev/youssofk","image":"https://lh3.googleusercontent.com/a/AEdFTp7g7ng7R3Kda0v1EJGDbPfcVQASC20XcBnDNsE4=s96-c"}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/pele-mermaid-diagrams-as-themeable-svg-tsmiyab5v#faq","mainEntity":[{"@type":"Question","name":"Is there a faster, lighter alternative to Mermaid.js for rendering diagrams to SVG?","acceptedAnswer":{"@type":"Answer","text":"Pele is a zero-dependency library that renders Mermaid diagram syntax to SVG with a gzipped bundle around 230 kB versus Mermaid.js's 1.6 MB, and render times of 0.05-0.3 ms compared to 6-82 ms for Mermaid.js. It supports every diagram type built into Mermaid 12.1.0 and is themed using CSS variables instead of theme configuration objects. Compare lightweight diagram renderers like this on daily.dev before picking one for your app."}},{"@type":"Question","name":"How do you theme Mermaid-style diagrams without re-rendering them?","acceptedAnswer":{"@type":"Answer","text":"Pele applies theming through CSS variables such as --pele-bg, --pele-fg, --pele-muted, --pele-line, --pele-surface, --pele-surface-alt, and --pele-border, so color changes take effect without re-rendering the SVG. This differs from Mermaid.js, which requires passing a theme configuration at render time. Developers picking a diagram theming approach can track options like this on daily.dev."}}]}
```

