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

Mermaid charts are vague when switch to dark theme #205

Closed
Minys233 opened this issue Jun 22, 2020 · 1 comment
Closed

Mermaid charts are vague when switch to dark theme #205

Minys233 opened this issue Jun 22, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@Minys233
Copy link

Minys233 commented Jun 22, 2020

Summary

I note when switching themes between dark/light, the background color is also changing, aka data-theme="dark". But things are different when it comes to mermaid charts. There is neither option to set mermaid color theme, nor dynamic reload when you change page theme from light to dark. This makes the black lines nearly disappear in the dark theme.

Description

Mermaid is introduced in file layouts/partials/third-party/mermaid.html. There should be an option to specify theme in one of four candidates: ["default", "forest", "dark", "neutral"], refer to mermaid source code. When MEME load mermaid, the chart will be displayed in default color theme, which will make the black lines almost vanish! For example, in my blog, the last chart in dark theme.

Suggestions

I did some Googling and tests in and find two ways to solve it. The first one is easy but kind of stupid, while the second one is superior but needs more coding.

Thank you for your time and this excellent theme!

@Minys233 Minys233 changed the title 切换页面主题时mermaid图表显示效果不佳 Mermaid charts are vague when switch to dark theme Jun 22, 2020
@reuixiy reuixiy added the enhancement New feature or request label Jun 23, 2020
@reuixiy
Copy link
Owner

reuixiy commented Jun 24, 2020

Thanks for your detailed feedback.

I'v looked into this and found the 2nd approach does not work with mermaid v8.5.2 anymore.

But I think I found a solution for this. :)

ulmefors pushed a commit to ulmefors/hugo-theme-meme that referenced this issue Nov 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants