diff --git a/static/main.css b/static/main.css index 1cdf037..e151d54 100644 --- a/static/main.css +++ b/static/main.css @@ -1459,9 +1459,8 @@ body { background-color: rgb(0 0 0 / var(--tw-bg-opacity)); } -.bg-white { - --tw-bg-opacity: 1; - background-color: rgb(255 255 255 / var(--tw-bg-opacity)); +.bg-inherit { + background-color: inherit; } .bg-white\/50 { diff --git a/templates/partials/header.html b/templates/partials/header.html index 2ee18a4..84524dc 100644 --- a/templates/partials/header.html +++ b/templates/partials/header.html @@ -34,7 +34,13 @@ // dark theme const setDark = (isDark) => { - htmlClass[isDark ? "add" : "remove"]("dark"); + if (isDark) { + document.body.dispatchEvent(new CustomEvent("set-theme", { detail: "dark" })); + htmlClass.add("dark"); + } else { + document.body.dispatchEvent(new CustomEvent("set-theme", { detail: "light" })); + htmlClass.remove("dark"); + } localStorage.setItem("dark", isDark); }; diff --git a/templates/partials/mermaid.html b/templates/partials/mermaid.html index a80863e..7065da2 100644 --- a/templates/partials/mermaid.html +++ b/templates/partials/mermaid.html @@ -1,4 +1,32 @@ diff --git a/templates/shortcodes/mermaid.html b/templates/shortcodes/mermaid.html index d53ecc6..d94eb1a 100644 --- a/templates/shortcodes/mermaid.html +++ b/templates/shortcodes/mermaid.html @@ -1,3 +1,3 @@ -
+
{{ body | trim_start_matches(pat="```mermaid") | trim_start_matches(pat="```") | trim_end_matches(pat="```") }}