fix: Mermaid diagrams do not respect dark mode (#4564)

* wip

* Move event binding
This commit is contained in:
Tom Moor
2022-12-11 11:33:17 -08:00
committed by GitHub
parent e4da92a359
commit 80780eedda
5 changed files with 50 additions and 7 deletions

View File

@@ -23,8 +23,12 @@ const Theme: React.FC = ({ children }) => {
: resolvedTheme;
React.useEffect(() => {
window.dispatchEvent(new Event("theme-changed"));
}, [theme]);
window.dispatchEvent(
new CustomEvent("theme-changed", {
detail: { isDark: ui.resolvedTheme === "dark" },
})
);
}, [ui.resolvedTheme]);
return (
<ThemeProvider theme={theme}>