adapt mermaid to dark mode (#1476)

Co-authored-by: binary-husky <96192199+binary-husky@users.noreply.github.com>
这个提交包含在:
Keldos
2024-01-16 00:32:12 +08:00
提交者 GitHub
父节点 0e43b08837
当前提交 8a78d7b89f
共有 2 个文件被更改,包括 5 次插入0 次删除

查看文件

@@ -102,6 +102,10 @@ const uml = async className => {
messageFontSize: "16px"
}
}
if (document.body.classList.contains("dark")) {
defaultConfig.theme = "dark"
}
const Module = await import('./file=themes/mermaid_editor.js');
function do_render(block, code, codeContent) {

查看文件

@@ -111,6 +111,7 @@ js_code_for_toggle_darkmode = """() => {
} else {
document.querySelector('body').classList.add('dark');
}
document.querySelectorAll('code2').forEach(code => {code.remove();})
}"""