chore: use mermaid default light and dark theme (#254)

This commit is contained in:
Robert Kaussow 2022-05-30 21:49:13 +02:00 committed by GitHub
parent a6bdd2e0dc
commit ee28edec26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View File

@ -5,22 +5,21 @@ document.addEventListener("DOMContentLoaded", function (event) {
let lstore = Storage.namespace(THEME)
let currentMode = lstore.get("color-mode")
let darkModeQuery = window.matchMedia("(prefers-color-scheme: dark)")
let primaryColor = "#ececff"
let darkMode = false
let theme = "default"
if (currentMode === DARK_MODE || (currentMode === AUTO_MODE && darkModeQuery.matches)) {
primaryColor = "#6C617E"
darkMode = true
theme = "dark"
}
import("mermaid")
.then(({ default: md }) => {
md.initialize({
flowchart: { useMaxWidth: true },
theme: "base",
theme: theme,
themeVariables: {
darkMode: darkMode,
primaryColor: primaryColor
darkMode: darkMode
}
})
})

View File

@ -1,6 +1,6 @@
:root,
:root[color-mode="light"] {
--code-max-height: auto;
--code-max-height: none;
@include light_mode;
}