Mermaid resets some of the page CSS styles
See original GitHub issue<head>
<!-- ... -->
<link rel="stylesheet" href="/assets/css/all.css">
<link rel="stylesheet" href="https://cdn.rawgit.com/knsv/mermaid/7.0.0/dist/mermaid.css">
<script src="https://cdn.rawgit.com/knsv/mermaid/7.0.0/dist/mermaid.min.js"></script>
<script>mermaid.initialize({startOnLoad: true;});</script>
</head>
<body>
<div class="mermaid">
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
</div>
<h1>Foo</h1>
The page is deployed on a local Jekyll server. The h1
styling set by all.css
is displayed correctly up until the point when the graph is rendered. The behavior is hard to reproduce: I was not able to reproduce it outside of my own blog served locally via Jekyll. Given this, can you please suggest a quick fix that would guarantee that mermaid will have absolutely no effect beyond a tag I have specified? I do not want it to influence anything else but the contents of the tag I am trying to render.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6
Top Results From Across the Web
Mermaid resets some of the page CSS styles #482 - GitHub
The page is deployed on a local Jekyll server. The h1 styling set by all.css is displayed correctly up until the point when...
Read more >CSS not running in mermaid JS, - Stack Overflow
I am just learning mermaid.js and this is some simple code. I declare a cssClass in the div to add do some styles,...
Read more >CSS Tools: Reset CSS - meyerweb.com
The goal of a reset stylesheet is to reduce browser inconsistencies in things like default line heights, margins and font sizes of headings,...
Read more >Markdown syntax for wikis - Azure DevOps - Microsoft Learn
Learn how to share information and add tables & mathematical notation using Markdown within wikis.
Read more >Making Mermaid Diagrams in Markdown - CSS-Tricks
Mermaid diagrams pair well with Jamstack and static site generators, which continue ... theme changes the styling of the rendered diagrams.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Passing in option
cloneCssStyles: false
in the configure object passed tomermaid.initialize()
fixes a similar problem for me:The issue has been fixed. Now all mermaid CSS are scoped within its own ID so it won’t pollute global CSS.