# Automatic Mermaid Theming

**URL:** <https://community.supernotes.app/t/automatic-mermaid-theming/2322>\
**Category:** Feature Requests\
**Tags:** Implemented\
**Created:** [March 11, 2024, 2:07pm UTC](https://community.supernotes.app/t/automatic-mermaid-theming/2322 "2024-03-11T14:07:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![JamesT](https://community.supernotes.app/user_avatar/community.supernotes.app/jamest/32/2213_2.png) [@JamesT](https://community.supernotes.app/u/JamesT)\
**Post date:** [March 11, 2024, 2:07pm UTC](https://community.supernotes.app/t/automatic-mermaid-theming/2322/1 "2024-03-11T14:07:51Z")

</div>

New request (hopefully a real one this time)! 😳

The inline diagrams look great in light mode:

 ![SCR-20240311-njdc](https://community.supernotes.app/uploads/default/original/2X/9/9d58ad8bd8b0df82a41b74cd1e6264eda355b342.png)

But are pretty unreadable in dark mode (my preferred setting):

 ![SCR-20240311-njfr](https://community.supernotes.app/uploads/default/original/2X/7/7a24c20b164e02f2e3ecc84ad02fa2da133cf259.png)

Is there any possibility to make the lines and text white in dark mode (and shift the other colours to be darker to increase legibility)?

---

<div class="post-metadata">

**Author:** ![isaiur](https://community.supernotes.app/user_avatar/community.supernotes.app/isaiur/32/2356_2.png) [@isaiur](https://community.supernotes.app/u/isaiur)\
**Post date:** [March 11, 2024, 2:18pm UTC](https://community.supernotes.app/t/automatic-mermaid-theming/2322/2 "2024-03-11T14:18:35Z")

</div>

You can try to add this line above:

`%%{init: {'theme':'dark'}}%%` and there are more themes on [Theme Configuration | Mermaid](https://mermaid.js.org/config/theming.html)

---

<div class="post-metadata">

**Author:** ![JamesT](https://community.supernotes.app/user_avatar/community.supernotes.app/jamest/32/2213_2.png) [@JamesT](https://community.supernotes.app/u/JamesT)\
**Post date:** [March 11, 2024, 2:24pm UTC](https://community.supernotes.app/t/automatic-mermaid-theming/2322/3 "2024-03-11T14:24:08Z")

</div>

Worked like a charm—thank you! 🙂

 ![SCR-20240311-npyt](https://community.supernotes.app/uploads/default/original/2X/e/ed8ef37b3aa5ab8fa0149e99d11de780fc3cb693.png)

---

<div class="post-metadata">

**Author:** ![JamesT](https://community.supernotes.app/user_avatar/community.supernotes.app/jamest/32/2213_2.png) [@JamesT](https://community.supernotes.app/u/JamesT)\
**Post date:** [March 11, 2024, 2:38pm UTC](https://community.supernotes.app/t/automatic-mermaid-theming/2322/4 "2024-03-11T14:38:43Z")

</div>

@Tobias Would it be possible to add some “magic” behind-the-scenes in Supernotes, so that adding `%%{init: {'theme':'dark'}}%%` isn’t necessary, and switching back and forth between light and dark mode just works?

---

<div class="post-metadata">

**Author:** ![tobias](https://community.supernotes.app/user_avatar/community.supernotes.app/tobias/32/1181_2.png) [@tobias](https://community.supernotes.app/u/tobias)\
**Post date:** [March 11, 2024, 3:43pm UTC](https://community.supernotes.app/t/automatic-mermaid-theming/2322/5 "2024-03-11T15:43:20Z")

</div>

Hi @JamesT, on it, we’ll see what we can do 🙂

And thanks for mentioning that workaround in the meantime @isaiur, great idea!

---

<div class="post-metadata">

**Author:** ![connor](https://community.supernotes.app/user_avatar/community.supernotes.app/connor/32/1657_2.png) [@connor](https://community.supernotes.app/u/connor)\
**Post date:** [December 17, 2024, 4:22am UTC](https://community.supernotes.app/t/automatic-mermaid-theming/2322/6 "2024-12-17T04:22:17Z")

</div>

Finally got around to doing this in [Supernotes 3.1.8](https://community.supernotes.app/t/supernotes-3-1-8/2969). The solution we went with is a bit more hacky than using native Mermaid themes, in the interest of getting the best possible performance. Please let us know if you have any issues with dark mode diagrams and we can improve further.

---

<div class="post-metadata">

**Author:** ![JamesT](https://community.supernotes.app/user_avatar/community.supernotes.app/jamest/32/2213_2.png) [@JamesT](https://community.supernotes.app/u/JamesT)\
**Post date:** [December 17, 2024, 8:33am UTC](https://community.supernotes.app/t/automatic-mermaid-theming/2322/7 "2024-12-17T08:33:21Z")

</div>

@Connor It works flawlessly and looks incredible! 😍

 ![SCR-20241217-ivhp](https://community.supernotes.app/uploads/default/original/2X/a/af2ab885ccd3d79e0366e1547578d2cab2ed9dcf.jpeg)

Thank you! ❤
