<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Pravin Paratey</title>
    <description>The latest articles on DEV Community by Pravin Paratey (@pravin_paratey_0ceb48aa90).</description>
    <link>https://dev.to/pravin_paratey_0ceb48aa90</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1874743%2F51f49bf4-15b0-4eb8-a346-be05d50b0a1a.jpg</url>
      <title>DEV Community: Pravin Paratey</title>
      <link>https://dev.to/pravin_paratey_0ceb48aa90</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pravin_paratey_0ceb48aa90"/>
    <language>en</language>
    <item>
      <title>Mermaid diagrams look dated? Not anymore!</title>
      <dc:creator>Pravin Paratey</dc:creator>
      <pubDate>Tue, 24 Nov 2026 18:43:14 +0000</pubDate>
      <link>https://dev.to/pravin_paratey_0ceb48aa90/mermaid-diagrams-look-dated-not-anymore-4k2k</link>
      <guid>https://dev.to/pravin_paratey_0ceb48aa90/mermaid-diagrams-look-dated-not-anymore-4k2k</guid>
      <description>&lt;p&gt;Mermaid is everywhere now: READMEs, design docs, wikis, and whatever diagram your AI assistant just generated for you. It's a great tool, but the default output looks like it's from 2012. Flat outlines, tiny text, cramped spacing. The built-in themes only change colours.&lt;/p&gt;

&lt;p&gt;I wanted Mermaid diagrams I'd be happy to put in a slide deck, so I built &lt;strong&gt;prettymaids&lt;/strong&gt;: modern themes plus an SVG post-processor, wrapped around stock Mermaid.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1b99wa1tum51mrci0yo9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1b99wa1tum51mrci0yo9.png" alt="Stock Mermaid next to prettymaids, shown half light and half dark" width="800" height="230"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can try it right now, with nothing to install: &lt;strong&gt;&lt;a href="https://pravin.github.io/prettymaids/" rel="noopener noreferrer"&gt;pravin.github.io/prettymaids&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The approach: keep Mermaid, restyle the output
&lt;/h2&gt;

&lt;p&gt;The obvious way to get nicer diagrams is to write a new renderer. I decided against that. Mermaid's parser and layout engine handle a huge range of diagram types, and anyone with existing diagrams (or an AI tool that emits Mermaid) can keep their source unchanged.&lt;/p&gt;

&lt;p&gt;So prettymaids leaves Mermaid alone and restyles in three layers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Theme variables and CSS&lt;/strong&gt;: fonts, colours, borders, spacing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Per-diagram config&lt;/strong&gt;: padding, node and rank spacing, label wrapping.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A post-processor on the rendered SVG&lt;/strong&gt;: the things CSS can't do.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That third layer is where most of the look comes from:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stacked soft drop shadows via an SVG filter&lt;/li&gt;
&lt;li&gt;Rounded corners on class and ER boxes, which Mermaid draws as sketch-style paths that CSS can't round&lt;/li&gt;
&lt;li&gt;Donut charts instead of pies, done by clipping each slice to a ring&lt;/li&gt;
&lt;li&gt;XMind-style mindmaps, with smooth S-curve branches that get thinner with depth and take the colour of their main topic&lt;/li&gt;
&lt;li&gt;An optional dot-grid canvas behind everything&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Finosodxnnfx9xd0hziak.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Finosodxnnfx9xd0hziak.gif" alt="Tuning a diagram live in the playground" width="800" height="475"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Three things that went wrong
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. My "connector style" setting did nothing
&lt;/h3&gt;

&lt;p&gt;I added a setting to switch edges between rounded, elbow, straight and curved. In the playground, all four looked identical.&lt;/p&gt;

&lt;p&gt;It turns out Mermaid 12's default layout routes its own rounded orthogonal edges and ignores the &lt;code&gt;flowchart.curve&lt;/code&gt; option entirely. Only the dagre layout honours it. So the setting now switches layout engine when you pick anything other than the default.&lt;/p&gt;

&lt;p&gt;I only noticed because I diffed the rendered SVG instead of trusting my eyes. If a style option "works" but you've never compared the output, check it.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Fonts bite you twice
&lt;/h3&gt;

&lt;p&gt;Mermaid measures label text when it renders, then sizes the boxes to fit. I rendered with a font that wasn't installed locally, then viewed the result on a machine that had it. The real font was wider, and labels got clipped ("Receive reques").&lt;/p&gt;

&lt;p&gt;The fixes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Let labels overflow their container instead of clipping&lt;/li&gt;
&lt;li&gt;In the browser playground, wait for the font to load before the first render&lt;/li&gt;
&lt;li&gt;Install the font in CI, so the gallery renders with the real metrics&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you generate Mermaid SVGs on one machine and view them on another, this will happen to you too.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Different shapes need different padding
&lt;/h3&gt;

&lt;p&gt;I wanted pills (terminal nodes) and decision nodes to be sized differently from ordinary boxes. But CSS can't change the box size after Mermaid has measured the text.&lt;/p&gt;

&lt;p&gt;So flowcharts render twice. The first pass finds which nodes are pills or decisions. The second pass adds a class to each of them, so my CSS applies while Mermaid is measuring. That keeps the edges attached to the right places.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ways to use it
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;In the browser&lt;/strong&gt;: the &lt;a href="https://pravin.github.io/prettymaids/" rel="noopener noreferrer"&gt;playground&lt;/a&gt; has a live editor, three themes, about 28 parameters you can tune, and SVG or PNG export. The &lt;a href="https://pravin.github.io/prettymaids/gallery/" rel="noopener noreferrer"&gt;comparison gallery&lt;/a&gt; shows stock Mermaid next to each theme for every diagram type.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;As a CLI:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx prettymaids-cli diagram.mmd -o diagram.png
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;As a library:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm install prettymaids mermaid
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;mermaid&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'mermaid'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;render&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'prettymaids'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Full look, including SVG post-processing:&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;svg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'maid'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mermaid&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Or just the colours and typography, as a plain Mermaid config:&lt;/span&gt;
&lt;span class="n"&gt;mermaid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;config&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'maid'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are three themes: &lt;code&gt;maid&lt;/code&gt; (light), &lt;code&gt;maid-dark&lt;/code&gt;, and &lt;code&gt;maid-flat&lt;/code&gt;, a lower-contrast flat look.&lt;/p&gt;

&lt;h2&gt;
  
  
  Honest limits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Decision diamonds stay square.&lt;/strong&gt; Mermaid builds them that way, and changing it means writing a custom shape.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The CLI needs Chrome&lt;/strong&gt;, because Mermaid needs a real browser to measure text. Installing the package downloads a Chromium for you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub, Obsidian and Notion render Mermaid themselves&lt;/strong&gt;, so prettymaids can't restyle diagrams inside them. Render with the CLI and commit the image.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nine diagram types are styled so far&lt;/strong&gt;: flowchart, sequence, class, state, ER, gantt, pie, mindmap and git graph. Journey, timeline, quadrant and XY charts are unstyled for now.&lt;/li&gt;
&lt;li&gt;It's tested against Mermaid 12.3.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it, and tell me what's next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Playground: &lt;a href="https://pravin.github.io/prettymaids/" rel="noopener noreferrer"&gt;https://pravin.github.io/prettymaids/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Repo (MIT): &lt;a href="https://github.com/pravin/prettymaids" rel="noopener noreferrer"&gt;https://github.com/pravin/prettymaids&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you try it on a diagram that comes out wrong, please open an issue and paste the Mermaid source. And if you have a view on which diagram type or look I should do next, I'd like to hear it in the comments.&lt;/p&gt;

</description>
      <category>mermaid</category>
      <category>opensource</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
