Skip to content

Suggestions to improve theming #7340

@alexewerlof

Description

@alexewerlof

Proposal

I use Mermaid extensively to communicate complex topics on my blog.
For consistency, I had to create my own theme. I've been following mermaid theming config only to realize that some stuff can ONLY be done in CSS. Even then, there's no consistency and some elements e.g. some <path> and <span> miss semantic classes so I had to resort to ugly workarounds like using path:nth-child(2) (example) just to get basic theming working.

Unless I'm missing something important, here are a few suggestions:

  1. Follow the basic mermaid config for ALL diagrams (you can see my config here) so the CSS workarounds aren't needed (e.g. having the actor man the same color as actor <rect> required a workaround)
  2. Use semantic class names on all elements that the user may want to theme.
  3. Simplify the generated SVG. There's no reason what could essentially be a <circle> to be implemented using multiple <path> elements (see the screenshot below from an example state diagram):
Image

Colors

  • this is irrelevant as my theme is personal. These are suggestions for the theming systems not to create a new theme

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions