summaryrefslogtreecommitdiffstats
path: root/template.html
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2024-03-31 21:54:22 +0300
committerJan Tuomi <jans.tuomi@gmail.com>2024-03-31 21:54:22 +0300
commit0de37a490cfdd7c846aeffcaa563a27d104a6ce0 (patch)
tree77ea9de518f11befbc2e2748c619fdd7b8f5c563 /template.html
parent7eb044672595946e0b360ff57128dad50892a2ee (diff)
Fix dark mode button HTML tag issue, add contrast to light mode links
Diffstat (limited to 'template.html')
-rw-r--r--template.html7
1 files changed, 5 insertions, 2 deletions
diff --git a/template.html b/template.html
index beefe84..eca5f3e 100644
--- a/template.html
+++ b/template.html
@@ -82,8 +82,11 @@ $endif$
$body$
<script>
-document.querySelector("#dark-mode-btn").tagName = "button";
-document.querySelector("#dark-mode-btn").innerHTML = "🌓";
+const b = document.createElement("button");
+b.innerHTML = "🌓";
+b.setAttribute("id", "dark-mode-btn");
+b.setAttribute("aria-label", "Toggle dark mode");
+document.querySelector("#dark-mode-btn").replaceWith(b);
const initialManualColorScheme = localStorage.getItem("colorScheme");
// If null, no manual color scheme is set