This commit is contained in:
David G. Simmons 2024-10-21 16:51:16 -04:00
parent 502aaa7148
commit 56787e0963
No known key found for this signature in database
GPG key ID: 3E0F418F1D0ABB96
2 changed files with 0 additions and 13 deletions

View file

@ -1,6 +1,4 @@
let theme = localStorage.getItem('theme-scheme') || localStorage.getItem('darkmode:color-scheme') || 'light'
const b = 'bollocks!';
console.log(b);
if (theme === 'system') {
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
theme = 'dark'

View file

@ -11,17 +11,6 @@
<!--================= add analytics if enabled =========================-->
{{- partial "analytics.html" . -}}
<script>
theme = localStorage.getItem('theme-scheme') || localStorage.getItem('darkmode:color-scheme') || 'light';
if (theme == 'system') {
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
theme = 'dark';
} else {
theme = 'light';
}
}
document.documentElement.setAttribute('data-theme', theme);
</script>
</head>
<body class="type-{{ .Page.Type }} kind-{{ .Page.Kind }}" data-bs-spy="scroll" data-bs-target="#TableOfContents" data-bs-offset="80">