mirror of
https://github.com/thegeeklab/hugo-geekblog.git
synced 2024-11-21 20:50:40 +00:00
chore: use mermaid default light and dark theme (#254)
This commit is contained in:
parent
a6bdd2e0dc
commit
ee28edec26
@ -5,22 +5,21 @@ document.addEventListener("DOMContentLoaded", function (event) {
|
|||||||
let lstore = Storage.namespace(THEME)
|
let lstore = Storage.namespace(THEME)
|
||||||
let currentMode = lstore.get("color-mode")
|
let currentMode = lstore.get("color-mode")
|
||||||
let darkModeQuery = window.matchMedia("(prefers-color-scheme: dark)")
|
let darkModeQuery = window.matchMedia("(prefers-color-scheme: dark)")
|
||||||
let primaryColor = "#ececff"
|
|
||||||
let darkMode = false
|
let darkMode = false
|
||||||
|
let theme = "default"
|
||||||
|
|
||||||
if (currentMode === DARK_MODE || (currentMode === AUTO_MODE && darkModeQuery.matches)) {
|
if (currentMode === DARK_MODE || (currentMode === AUTO_MODE && darkModeQuery.matches)) {
|
||||||
primaryColor = "#6C617E"
|
|
||||||
darkMode = true
|
darkMode = true
|
||||||
|
theme = "dark"
|
||||||
}
|
}
|
||||||
|
|
||||||
import("mermaid")
|
import("mermaid")
|
||||||
.then(({ default: md }) => {
|
.then(({ default: md }) => {
|
||||||
md.initialize({
|
md.initialize({
|
||||||
flowchart: { useMaxWidth: true },
|
flowchart: { useMaxWidth: true },
|
||||||
theme: "base",
|
theme: theme,
|
||||||
themeVariables: {
|
themeVariables: {
|
||||||
darkMode: darkMode,
|
darkMode: darkMode
|
||||||
primaryColor: primaryColor
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
:root,
|
:root,
|
||||||
:root[color-mode="light"] {
|
:root[color-mode="light"] {
|
||||||
--code-max-height: auto;
|
--code-max-height: none;
|
||||||
|
|
||||||
@include light_mode;
|
@include light_mode;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user