Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme variables only applied to first diagram #33

Closed
dprothero opened this issue Feb 23, 2022 · 1 comment · May be fixed by X-oss-byte/next-auth#117
Closed

Theme variables only applied to first diagram #33

dprothero opened this issue Feb 23, 2022 · 1 comment · May be fixed by X-oss-byte/next-auth#117

Comments

@dprothero
Copy link
Contributor

Describe the bug
If you defined themeVariables to customize colors, fonts, etc., the customizations are only applied to the first diagram in the Markdown document. The second diagram is rendered with the default theme.

To Reproduce

  1. Setup themes variables:
     remarkPlugins: [
       [
         require("mdx-mermaid"),
         {
           mermaid: {
             theme: "base",
             themeVariables: {
               primaryColor: "lime",
             },
           },
         },
       ],
     ],
    
  2. Add two diagrams to a Markdown file:
    ```mermaid
    graph TD;
         A-->B;
         A-->C;
         B-->D;
         C-->D;
     ```
    
     ```mermaid
     graph TD;
         A-->B;
         A-->C;
         B-->D;
         C-->D;
     ```
    
  3. Build with yarn start
  4. See two diagrams with different colors. (see screenshot)

Expected behavior
All diagrams should share the same theme configuration.

Screenshots
image

Stack trace
N/A

Tool chain used:
Docusaurus 2.0.0-beta.9, mdx-mermaid 1.2.1

Additional context
When experimenting with different colors, you have to CTRL-C to break yarn start and then run it again to see the changes.

@ivorc
Copy link

ivorc commented Mar 9, 2022

Great to see this has been fixed. It would be lovely to see a tagged release with this fix if possible? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants