enh: mermaid dark theme

This commit is contained in:
Timothy J. Baek 2024-08-19 19:42:31 +02:00
parent 1e8abea753
commit d79d3f1352

View File

@ -241,6 +241,22 @@ __builtins__.input = input`);
debounceTimeout = setTimeout(highlightCode, 10);
}
}
onMount(async () => {
if (document.documentElement.classList.contains('dark')) {
mermaid.initialize({
startOnLoad: true,
theme: 'dark',
securityLevel: 'loose'
});
} else {
mermaid.initialize({
startOnLoad: true,
theme: 'default',
securityLevel: 'loose'
});
}
});
</script>
<div class="my-2" dir="ltr">