Skip to content

Commit 96cccc6

Browse files
committed
chore: updated mermaid.tsx
1 parent 259fdb0 commit 96cccc6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/components/mdx/mermaid.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

3-
import { useTheme } from "next-themes";
43
import { use, useEffect, useId, useState } from "react";
4+
import { useTheme } from "next-themes";
55

66
export function Mermaid({ chart }: { chart: string }) {
77
const [mounted, setMounted] = useState(false);
@@ -40,7 +40,7 @@ function MermaidContent({ chart }: { chart: string }) {
4040
securityLevel: "loose",
4141
fontFamily: "inherit",
4242
themeCSS: "margin: 1.5rem auto 0;",
43-
theme: "default",
43+
theme: resolvedTheme === "dark" ? "dark" : "default",
4444
});
4545

4646
const { svg, bindFunctions } = use(

0 commit comments

Comments
 (0)