Help Me to Customize my Mermaid CSS Snippet

Help Me to Customize my Mermaid CSS Snippet

  • I am using obsidian on an android mobile. The CSS snippet which I am using now currently is perfect for me on mermaid diagrams. But while I use I feel that I want some extra customizations. I need help on that:
    1. I want it not to be scrolled
    2. You can see the space between the heading and mermaid diagram. I get that when diagram become big.

Please be kind enough money assist me on this…

CSS Snippet

/*mermaid*/

svg[id^="m"][width][height][viewBox] {
    max-width: 95%;
    max-height: 95%;
}

div.mermaid {
    margin-left: 0 !important;
    text-align: center;
    resize:both;
    overflow:auto;
    margin-bottom: 2px;
    position:relative;
    max-height: 600px;
    max-width: 100%;
}

div.mermaid::after {
    content:'';
    display:block;
    width:10px;
    height:10px;
    background-color:yellowgreen;
    position:absolute;
    right:0;
    bottom:0;
}

Mermaid Diagram Code

graph TD 
A ===> B --> C
A ===> D --> E
A ===> F --> G
C-->H-->I-->J-->K-->L
G-->M-->N-->O-->P-->Q
D --> R
A(Testing Testing)
B(Testing Testing)
C(Testing Testing)
D(Testing Testing)
E(Testing Testing)
F(Testing Testing)
G(Testing Testing)
H(Testing Testing)
I(Testing Testing)
J(Testing Testing)
K(Testing Testing)
L(Testing Testing)
M(Testing Testing)
N(Testing Testing)
O(Testing Testing)
P(Testing Testing)
Q(Testing Testing)
R(Testing Testing)

Result I got

It is Sorted.
I was able to solve it myself and this is to show what I did.


/*mermaid*/

svg[id^="m"][width][height][viewBox] {
    max-width: 100%;
    /*max-height: 50%;*/
    height: 250px;
}

div.mermaid {
    margin-left: 0 !important;
    text-align: center;
    resize:auto;
    /*overflow:auto;*/
    margin-bottom: 2px;
    position:relative;
    /*max-height: 600px;*/
    max-width: 100%;
}

div.mermaid::after {
    content:'';
    display:block;
    width:10px;
    height:10px;
    background-color:yellowgreen;
    position:absolute;
    right:0;
    bottom:0;
}

Result I Got

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.