Make darkmode the default
This commit is contained in:
parent
65dd6eec72
commit
87f6f6a461
2 changed files with 5 additions and 5 deletions
|
@ -14,9 +14,9 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||
|
||||
// Load Dark Mode preference from cache
|
||||
const theme = localStorage.getItem("theme");
|
||||
if (theme === "dark"){
|
||||
body.classList.remove("light-mode");
|
||||
darkModeButton.textContent = "🌙";
|
||||
if (theme === "light"){
|
||||
body.classList.add("light-mode");
|
||||
darkModeButton.textContent = "☀️";
|
||||
}
|
||||
|
||||
darkModeButton.addEventListener("click", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue