Mermaid: Styling: classes aren't applied to elements.

Created on 1 Oct 2017  路  9Comments  路  Source: mermaid-js/mermaid

Styling: classDef and classes aren't applied to elements.
Example:

graph TD
A-->B
C-->D
classDef def fill:#00f
class A def

Element A is green, but should be blue.

All 9 comments

I have the some issue.

It's weird, because the demo: Larger flowchart with some styling works, but it does not when I try the same thing on the live editor.

Any Ideas?

@aaroncalderon same here...

Same here. I am being able to style each node individually:

screenshot_2

But when I try doing it with classDef nothing happens:

screenshot_1

Naming it default does nothing as well:

screenshot_3

I spent hours trying to get this to work in VS Code.
Hope it'll get fixed, because defining styles individually is a pita.

Same here. Looking at the generated HTML, nodes do get classes attributes, but I cannot find any css rules matching the class, nor find any occurence of my classname in the generated document. I believe there is a bug preventing the CSS rules to be set.

This regression seems to appear between releases 7.0.14 and 7.0.15 which lead me to commit 72493b7a8b0edc45b53884b443d690a9e68d8e1a.

   graph TD

     hello --> world;
     classDef someclass fill:#f96;
     class hello someclass;

Please note that the ordering do matter. Also this is processed by sphinx-mermaid but this is not relevant here.

Before (7.0.14) screenshot_20180305_204032

After (7.0.15) screenshot_20180305_202955

@tylerlong would be glad if you could shed us some light on this ? :upside_down_face:

Hi guys, I am here. I will take a look tonight.

@calve thank you for figuring out the commit which brought this regression.

@tylerlong thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lwalker-kforce picture lwalker-kforce  路  3Comments

gvlx picture gvlx  路  5Comments

chen4221 picture chen4221  路  3Comments

nickwynja picture nickwynja  路  3Comments

yk-liu picture yk-liu  路  4Comments