goldmark-mermaid icon indicating copy to clipboard operation
goldmark-mermaid copied to clipboard

dark and light mode support

Open jtarchie opened this issue 2 years ago • 0 comments

This is a placeholder issue for me and others.

My site currently supports light and dark modes. MermaidJS does not support that natively, so I am seeking an alternative.

I was thinking of having two renders per backtick mermaidjs.

For example,

   ```mermaid
       ....
   \```

Would render to:

<pre class="mermaid mermaid-light">
   <!--- light theme render -->
</pre>
<pre class="mermaid mermaid-dark">
   <!--- dark theme render -->
</pre>
<style>
 @media (prefers-color-scheme: light) {
    .mermaid.mermaid-dark { display: none; }
    .mermaid.mermaid-light { display: block; }
  }
 @media (prefers-color-scheme: dark) {
    .mermaid.mermaid-dark { display: block; }
    .mermaid.mermaid-light { display: none; }
  }
</style>

I'd like to explore this with the plugin.

jtarchie avatar Jan 27 '24 15:01 jtarchie