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

The need for mermaid.css should be mentioned explicitly in the intro docs... #273

Closed
manor opened this issue Dec 28, 2015 · 4 comments
Closed

Comments

@manor
Copy link

manor commented Dec 28, 2015

The section introducing simple usage on a web page doesn't mention the need for mermaid.css, which means that if one is following the docs literally, the resulting network renders incorrectly... Maybe it is obvious that CSS will be necessary, but I, for one, had to generate this:

without CSS with CSS
without_css with_css

before realizing that there was something missing :-)

It's a shame that there is no way to package things such that the CSS file is rendered unnecessary by default, but I don't know if there is a way to do this without clobbering user-provided customization. At any rate, it is a little jarring to have the nodes appear black and the edges disappear entirely in the absence of mermaid.css.

<script src="https://cdn.rawgit.com/knsv/mermaid/0.5.6/dist/mermaid.min.js"></script>
<link rel="stylesheet" href="https://cdn.rawgit.com/knsv/mermaid/0.5.6/dist/mermaid.css">
<script>mermaid.initialize({startOnLoad:true});</script>
<div class="mermaid">
graph TD;
    A-->B(B)
    A-->C>C]
    B-->D((D))
    C-->D
classDef eco fill:green;
class A,B,C,D eco
</div>
@mniinio
Copy link

mniinio commented Jan 2, 2016

I also spent some time before I found 4 things related to the styling because they were not documented at all or clearly:

  • what was the latest version (had to understand to click the link "example mermaid x.x.x." in the docs, where the link was actually saying an old version
  • mermaid.css (finally found it in the list of files from the cdn)
  • how to solve issue with configuration where all html styles were copied which broke all other styles in my page Inline css by "mermaid" #157 cloneCssStyles: false
  • and here in this issue finally found the proper example of how to use my own styles with classDef - but none of the examples (even in this issue) are working for me (version 0.5.6) either with css-classes or classes. Using "style" works just like documented (edit: actually I got the classes to work when I figured out I had taken forest -theme together with the other css from the CDN. The theme was overriding everything else, so I think the fact that there is a theme available and that it overrides stuff should be mentioned in docs)

@knsv
Copy link
Collaborator

knsv commented Jan 2, 2016

Thanks, good feedback! Hard to know what is clear/unclear in the docs

@Jmuccigr
Copy link
Contributor

+1.

But what's the version of other css to use from my local install? There are three of mermaid.forest, for example:

./mermaid/dist/mermaid.forest.css
./mermaid/dist/www/stylesheets/mermaid.forest.css
./mermaid/docs/site/stylesheets/mermaid.forest.css

@nrfm
Copy link

nrfm commented Oct 6, 2016

+1

@knsv knsv closed this as completed in aa93860 Nov 6, 2016
knsv added a commit that referenced this issue Nov 6, 2016
sifb added a commit to sifb/mermaid that referenced this issue Nov 24, 2016
Issue mermaid-js#273 says "the need for mermaid.css should be mentioned explicitly in the intro docs" - I ran into this problem as well, because I read `mermaid.min.js This bundle contains everything you need to run mermaid` very literally, but it doesn't contain everything and it needs a stylesheet as well.

This edit tries to make that more clear.
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

No branches or pull requests

5 participants