mylloon.fr/static/js/libs/mermaid.js
Mylloon c6a1f3efcb
Some checks are pending
ci/woodpecker/push/publish Pipeline is pending
add dark/light theme for mermaid and hljs
2023-04-25 02:32:43 +02:00

13 lines
390 B
JavaScript

import mermaid from "https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs";
window.addEventListener("load", async () => {
const theme = window.matchMedia("(prefers-color-scheme: dark)").matches
? "dark" // dark
: "default"; // light
mermaid.initialize({ startOnLoad: false, theme: theme });
await mermaid.run({
querySelector: ".language-mermaid",
});
});