You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Mermaid diagrams are unreadable in dark mode #4814
Describe the bug
The background of the mermaid diagrams is transparent and the drawing color is a rather darkish gray. On the dark mode, the diagrams are almost impossible to read/see.
To Reproduce
Steps to reproduce the behavior:
Enable dark mode
Open a text document
Insert a mermaid text block
Example:
sequenceDiagram
actor A
actor B
A -> B : Somesthing
activate B
B --> A : Answer
deactivate B
Loading
Expected behavior
More contrast would be essential. Either make the drawing color of mermaid light or put a white background to it.
Screenshots
If applicable, add screenshots to help explain your problem.
Server details:
Current instance on cloud.nextcloud.com
Same issue here. Will this be planned anytime in reasonable future?
Any work-around with custom CSS?
My wish would be that support for plantuml would be added (with config option to specify own network-internal plantuml server).
Edit: found a temporary work-around. Add the following in front of each diagram: %%{init: {'theme': 'dark' } }%%
I did a few experiments on how we can improve the theme handling of mermaid in text.
While ideally we could try to inject css variables we have into the theme, i think the easiest quick win is to just set the dark theme if we detect dark mode.
Activity
burrima commentedon Oct 5, 2024
Same issue here. Will this be planned anytime in reasonable future?
Any work-around with custom CSS?
My wish would be that support for plantuml would be added (with config option to specify own network-internal plantuml server).
Edit: found a temporary work-around. Add the following in front of each diagram:
%%{init: {'theme': 'dark' } }%%juliusknorr commentedon Nov 6, 2024
I did a few experiments on how we can improve the theme handling of mermaid in text.
While ideally we could try to inject css variables we have into the theme, i think the easiest quick win is to just set the dark theme if we detect dark mode.
According to https://mermaid.js.org/config/theming.html#available-themes there is a
darkModetheme variable, but I didn't see any noticable impact of setting this, so for now something like this should work:Just trying to figure out the most reliable way to detect Nextcloud dark/light mode before opening a pr.
juliusknorr commentedon Nov 6, 2024
Needs nextcloud-libraries/nextcloud-vue#5698
fix(mermaid): Use dark theme if appropriate
fix(mermaid): Use dark theme if appropriate
fix(mermaid): Use dark theme if appropriate
fix(mermaid): Use dark theme if appropriate
fix(mermaid): Use dark theme if appropriate
fix(mermaid): Use dark theme if appropriate