fix: more bad references

This commit is contained in:
Cory Dransfeldt 2024-02-28 13:34:22 -08:00 committed by GitHub
parent 3bd71a6acc
commit ac005e6d13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -89,18 +89,19 @@
<script> <script>
(() => { (() => {
const currentTheme = sessionStorage?.getItem('theme'); const currentTheme = sessionStorage?.getItem('theme');
if (!currentTheme) sessionStorage?.setItem('theme', (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')) const prefersDarkScheme = window.matchMedia('(prefers-color-scheme: dark)').matches;
if (!currentTheme) sessionStorage?.setItem('theme', (prefersDarkScheme ? 'dark' : 'light'))
if (currentTheme === 'dark') { if (currentTheme === 'dark') {
document.body.classList.add('theme__dark') document.body.classList.add('theme__dark')
} else if (currentTheme === 'light') { } else if (currentTheme === 'light') {
document.body.classList.add('theme__light') document.body.classList.add('theme__light')
} else if (this.prefersDarkScheme) { } else if (prefersDarkScheme) {
document.body.classList.add('theme__dark') document.body.classList.add('theme__dark')
} else if (!this.prefersDarkScheme) { } else if (!prefersDarkScheme) {
document.body.classList.add('theme__light') document.body.classList.add('theme__light')
} }
})(); })();
</script> </script>
{{ content }} {{ content }}
</body> </body>
</html> </html>