mirror of
https://github.com/SebastianStork/kita.git
synced 2026-01-21 13:21:35 +01:00
feat: re-render mermaid when theme changed
This commit is contained in:
parent
44acba4041
commit
be0ec891a0
4 changed files with 39 additions and 6 deletions
|
|
@ -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);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue