mirror of
https://github.com/thegeeklab/hugo-geekdoc.git
synced 2024-11-04 20:30:40 +00:00
24 lines
582 B
JavaScript
24 lines
582 B
JavaScript
|
document.addEventListener("DOMContentLoaded", function (event) {
|
||
|
let currentMode = localStorage.getItem(THEME);
|
||
|
let darkModeQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
||
|
let primaryColor = "#ececff";
|
||
|
let darkMode = false;
|
||
|
|
||
|
if (
|
||
|
currentMode === DARK_MODE ||
|
||
|
(currentMode === AUTO_MODE && darkModeQuery.matches)
|
||
|
) {
|
||
|
primaryColor = "#6C617E";
|
||
|
darkMode = true;
|
||
|
}
|
||
|
|
||
|
mermaid.initialize({
|
||
|
flowchart: { useMaxWidth: true },
|
||
|
theme: "base",
|
||
|
themeVariables: {
|
||
|
darkMode: darkMode,
|
||
|
primaryColor: primaryColor,
|
||
|
},
|
||
|
});
|
||
|
});
|