Mermaid has a few themes in their repo, which I imagine you’d be able to select either with a site setting or something. My wild guess would be that this turns into
mermaid.init({ theme: 'dark' }, $mermaid)
Unfortunately none of the current ones (options are ‘dark’, ‘forest’, and ‘neutral’) really look good with DIscourse’s dark theme (they all have black text labels), so my recommendation here for someone willing to work on this (not me sorry )
- Write a new theme for MermaidJS based on one of the the existing ones and PR it
- Update the plugin to pass in a theme parameter somehow, like they do in the live editor