-
DescriptionI am very encouraged to see a new approach to styling mermaid diagrams in Quarto 1.3! Thank you! My question is related to using ---
title: "Untitled"
format:
html:
mermaid:
theme: default
---
```{mermaid}
flowchart LR
classDef dark color:#fff,fill:#0d5caa
Lorem --> Ipsum --> Dolor
class Lorem,Dolor dark
```
Github rendering flowchart LR
classDef dark color:#fff,fill:#0d5caa
Lorem --> Ipsum --> Dolor
class Lorem,Dolor dark
Quarto rendering I came across mermaid-js/mermaid#1955 in mermaid, but I don't think it is related to that. What is more likely is that |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
You'll have to inspect the CSS with the developer tools in your browser and investigate, I'm afraid. Each mermaid diagram uses its own set of CSS rules and we don't have the cycles to track all of it. |
Beta Was this translation helpful? Give feedback.
-
While we are on it, can I please suggest an improvement to documentation? This page suggests that the properties are set as
When if fact they are set as
I don't think that |
Beta Was this translation helpful? Give feedback.
Thank you for the tip. I should have inspected it before writing, of course. The difference seems to be that github is using a different HTML construction to render the flowchart-label:
<foreignObject><div><span>...</span> </div></foreignObject>
<text><tspan>...</tspan></text>
The Mermaid CSS is very similar, but since
<text>
has its own styling, it overrides the style assigned at the container group<g>
(the customdark
class).In order to make Quarto use the same HTML construct one should add
This options is not currently exposed in YAML, but I feel like it should be: