We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 311cd58 commit 03e20b3Copy full SHA for 03e20b3
src/client/stdlib/mermaid.js
@@ -1,7 +1,7 @@
1
import mer from "npm:mermaid";
2
3
let nextId = 0;
4
-const theme = matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "neutral";
+const theme = getComputedStyle(document.body).getPropertyValue("color-scheme") === "dark" ? "dark" : "neutral";
5
mer.initialize({startOnLoad: false, securityLevel: "loose", theme});
6
7
export default async function mermaid() {
0 commit comments