We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0d52932 commit 1b5187dCopy full SHA for 1b5187d
otterwiki/templates/snippets/renderer_js.html
@@ -3,11 +3,13 @@
3
<script id="MathJax-script" async src="{{ url_for("static", filename="mathjax/tex-chtml.js") }}"></script>
4
<script src="{{ url_for("static", filename="js/[email protected]") }}"></script>
5
<script type="text/javascript">
6
- mermaid.initialize({
7
-{%- if request.cookies.get('halfmoon_preferredMode') == "dark-mode" %}
8
- theme: 'dark',
9
-{%- else %}
10
- theme: 'neutral',
11
-{%- endif %}
+ document.addEventListener("DOMContentLoaded", function(event) {
+ let theme = 'neutral';
+ if (document.querySelector("body").classList.contains("dark-mode")) {
+ theme = 'dark';
+ }
+ mermaid.initialize({
12
+ theme: theme,
13
+ });
14
});
15
</script>
0 commit comments