Skip to content

Custom styling of diagrams #19

Description

@ulfschneider

Hi Remco, thank you for your package. I´m using it to render mermaid charts during the build process of a static blog. This is working pretty well. There is one issue I cannot get around, and that is custom styling. I do not see the slightest trace of the styles I´m putting into the transformation process within the resulting charts. I suppose I´m doing something wrong. Maybe you can help me with that.

I´m doing it so:

const renderOutput = await renderer([chartDefinition], {
      mermaidOptions: {  
          "theme": "base",
         "securityLevel": "loose",
         "themeVariables": {
            "fontSize": "16px",
            "fontFamily": "system-ui,sans-serif",
            "primaryColor": "#B3D7FF",
            "noteBkgColor": "#FFDD40",
            "noteTextColor": "#262626",
            "noteBorderColor": "#FFDD40"
            }
         },
       css: import.meta.resolve('./tmp/theme.css')
   });

The theme.css does exist and is valid, I´ve used it in a different context already. Even without the css, I would expect to see the setting for the primaryColor that comes out of the mermaidOptions in the charts, but it´s not there.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions