Hide theme switcher by default, only show it if javascript is enabled

This commit is contained in:
Julien Dessaux 2023-01-28 14:47:03 +01:00
parent 6ad4e164af
commit 9ab3804aec
Signed by: adyxax
GPG key ID: F92E51B86E07177E
2 changed files with 4 additions and 1 deletions

View file

@ -41,6 +41,7 @@ header nav ol li a:hover {
background-color: var(--bg-0); background-color: var(--bg-0);
border: none; border: none;
color: var(--fg-1); color: var(--fg-1);
display: none;
font-size: 1.25rem; font-size: 1.25rem;
margin: 0; margin: 0;
padding: 0; padding: 0;

View file

@ -8,7 +8,9 @@
const themeName = localStorage.getItem('theme'); const themeName = localStorage.getItem('theme');
if (themeName) { if (themeName) {
document.documentElement.className = themeName; document.documentElement.className = themeName;
document.getElementById('themes').value = themeName; const elt = document.getElementById('themes');
elt.style.display = "block";
elt.value = themeName;
} }
})(); })();
</script> </script>