-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Mermaid resets some of the page CSS styles #482
Comments
I have created a repository that reproduces this bug. Steps to reproduce:
Relevant lines of code: 3 lines here, 2 lines here. Also: if you remove this line that requests CSS and reload the page, the page will not be styled, but the graph will not change the styling on load. Any ideas on why this happens and how to fix it? |
Removing |
Glad to hear that it now works for you. I can't say that I see any obvious reason for why it failed without digging deeper.
Get Outlook for iOS
On Thu, Feb 23, 2017 at 8:58 PM +0100, "Anatolii Kmetiuk" <notifications@github.com> wrote:
Removing body, div, span from this line seems to have solved the issue. Strange.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Passing in option <script>mermaid.initialize({
startOnLoad: true,
cloneCssStyles: false
});
</script> |
I had a different element style collision with bootstrap - bootstrap was overriding the styles used by the rendered svg. I ended up commenting out the bootstrap.less styles that I didnt need and run a gulp-less on that. |
The issue has been fixed. Now all mermaid CSS are scoped within its own ID so it won't pollute global CSS. |
The page is deployed on a local Jekyll server. The
h1
styling set byall.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.The text was updated successfully, but these errors were encountered: