Skip to content

Commit

Permalink
Automatically use the dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Aug 22, 2023
1 parent ab0d5f6 commit 2d0e693
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions c2cwsgiutils/templates/index.html.mako
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@
</style>
</head>
<body>
<script>
(() => {
'use strict'
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.setAttribute('data-bs-theme', 'dark');
}
})()
</script>
<div class="container-fluid">
${ body | n }
</div>
Expand Down

0 comments on commit 2d0e693

Please sign in to comment.