Skip to content

Commit

Permalink
feat(#132): dark/light theming
Browse files Browse the repository at this point in the history
  • Loading branch information
jannis-baum committed Aug 26, 2024
1 parent bfaa72b commit 1d24c15
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/routes/viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ router.get(/.*/, async (req: Request, res: Response) => {
<script type="module">
import mermaid from '/static/mermaid/mermaid.esm.min.mjs';
mermaid.initialize({ startOnLoad: true });
const darkModePreference = window.matchMedia("(prefers-color-scheme: dark)");
mermaid.initialize({ startOnLoad: true, theme: darkModePreference.matches ? 'dark' : 'default' })
</script>
<script type="text/javascript" src="/static/client.js"></script>
</html>
Expand Down

0 comments on commit 1d24c15

Please sign in to comment.