Skip to content

Commit

Permalink
fix mermaid dark theme (#1122)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Mar 22, 2024
1 parent 311cd58 commit 03e20b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/client/stdlib/mermaid.js
@@ -1,7 +1,7 @@
import mer from "npm:mermaid";

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

export default async function mermaid() {
Expand Down

0 comments on commit 03e20b3

Please sign in to comment.