next-theme / hexo-theme-next

🎉 Elegant and powerful theme for Hexo.
https://theme-next.js.org
Other
2.36k stars 417 forks source link

mermaid 在暗黑模式下的线条完全看不清 #331

Closed fightinggg closed 2 years ago

fightinggg commented 2 years ago

Please follow this Issue template to provide relevant information, such as source code repository, website URL and screenshots, which will help us investigate. 请按照此 Issue 模版提供相关信息,例如源码仓库、网站链接和屏幕截图,这将有助于我们进行调查。

Issue Checklist


Expected behavior

Actual behavior

mermaid 在暗黑模式下的线条完全看不清,我自己的Blog,甚至文档中的例子也是看不清

Steps to reproduce the behavior

Look this , https://theme-next.js.org/docs/tag-plugins/mermaid.html

122988863-c36a8e80-d3d4-11eb-9612-fb6cbb684abe

Environment Information

Node.js and NPM Information

Package dependencies Information

Hexo Configuration

NexT Configuration

Other Information

stevenjoezhang commented 2 years ago

这个是已知问题 https://github.com/theme-next/hexo-theme-next/issues/1651

需要等Mermaid解决 https://github.com/mermaid-js/mermaid/issues/1544

fightinggg commented 2 years ago

这个是已知问题 theme-next/hexo-theme-next#1651

需要等Mermaid解决 mermaid-js/mermaid#1544

那个问题也是我提的,我看没人回复以为那个仓库不用了,就来这了

ljcbaby commented 2 years ago

这个是已知问题 theme-next/hexo-theme-next#1651 需要等Mermaid解决 mermaid-js/mermaid#1544

那个问题也是我提的,我看没人回复以为那个仓库不用了,就来这了

那个仓库确实不用了

fightinggg commented 2 years ago

done

问题我解决了,最近突然发现了这个东西,你只需要在你的source/_data/styles.styl中加入下面的代码即可


.mermaid {
  text-align: center;
}

@media (prefers-color-scheme: dark) {
  .mermaid {
    background: #505050;
  }
}

效果可以参考我这里

浅色

image

深色

image

stevenjoezhang commented 2 years ago

还是把这个 issue 开着吧,未来可能还会优化 mermaid 的配色方案,讨论见 https://github.com/next-theme/hexo-theme-next/issues/270

stevenjoezhang commented 2 years ago

Fixed in https://github.com/next-theme/hexo-theme-next/commit/debbe5bdc9b523b84071c0e421210b0c620b3d65 配置文件有变化,现在需要为暗色模式单独选择一个 Mermaid 主题

github-actions[bot] commented 1 year ago

This thread has been automatically locked since there has not been any recent activity after it was closed. It is possible issue was solved or at least outdated. Feel free to open new for related bugs.