Skip to content

Commit 03e20b3

Browse files
authored
fix mermaid dark theme (#1122)
1 parent 311cd58 commit 03e20b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/client/stdlib/mermaid.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import mer from "npm:mermaid";
22

33
let nextId = 0;
4-
const theme = matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "neutral";
4+
const theme = getComputedStyle(document.body).getPropertyValue("color-scheme") === "dark" ? "dark" : "neutral";
55
mer.initialize({startOnLoad: false, securityLevel: "loose", theme});
66

77
export default async function mermaid() {

0 commit comments

Comments
 (0)