Skip to content

Set mermaid dark theme automatically #1042

@BernatBC

Description

@BernatBC

This theme has mermaid support. As we can check in the toha guide's mermaid post, when setting the site theme to dark, graphs are unreadable.

Image

Describe the solution you'd like

The solution that I thought would be to set up the following:

  • For site light theme: Use default mermaid theme
  • For site dark theme: Use dark mermaid theme

Of course, there should be the option to override them.

Globally:

flowchart:
      enable: true
      services:
        # Uncomment for `mermaid` shortcode.
        mermaid:
          # For config options, see: https://mermaid-js.github.io/mermaid/#/Setup?id=configuration
          theme: default
          darkTheme: dark

Per graph:

{{< mermaid align="center" >}}
%%{init: {'theme':'default', 'darkTheme':'dark'}}%%
  # your mermaid content here
{{< /mermaid >}}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions