adapt mermaid to dark mode (#1476)

Co-authored-by: binary-husky <96192199+binary-husky@users.noreply.github.com>
This commit is contained in:
Keldos 2024-01-16 00:32:12 +08:00 committed by GitHub
parent 0e43b08837
commit 8a78d7b89f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -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) {

View File

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