Skip to content

Commit 69dafb8

Browse files
authored
Merge pull request #1053 from CesiumGS/dark-mode-fix
Use Mermaid dark theme for dark mode
2 parents 6991589 + ae60562 commit 69dafb8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

doc/footer.html

+6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
<script type="text/javascript" src="$relpath^mingcute.json.js"></script>
33
<script type="text/javascript" src="$relpath^panzoom.js"></script>
44
<script type="text/javascript">
5+
let theme = "default";
6+
// Detect browser dark mode and use dark theme for Mermaid if enabled
7+
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
8+
theme = "dark";
9+
}
510
mermaid.initialize({
11+
theme: theme,
612
startOnLoad: true,
713
graph: {
814
useMaxWidth: true

0 commit comments

Comments
 (0)