Hide theme switcher by default, only show it if javascript is enabled
This commit is contained in:
parent
6ad4e164af
commit
9ab3804aec
2 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Add table
Reference in a new issue