Replaced "var" with "let"
This commit is contained in:
parent
8831d8c346
commit
abf3fe7351
1 changed files with 4 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
|||
(function () {
|
||||
var element = document.body;
|
||||
var theme = localStorage.getItem("colorscheme");
|
||||
let element = document.body;
|
||||
let theme = localStorage.getItem("colorscheme");
|
||||
if (theme === null) {
|
||||
localStorage.setItem("colorscheme", "dark")
|
||||
}
|
||||
|
@ -10,8 +10,8 @@
|
|||
})();
|
||||
|
||||
function themeToggle() {
|
||||
var theme = localStorage.getItem("colorscheme");
|
||||
var element = document.body;
|
||||
let theme = localStorage.getItem("colorscheme");
|
||||
let element = document.body;
|
||||
if (theme === "dark") {
|
||||
element.classList.toggle("light-mode");
|
||||
localStorage.setItem("colorscheme", "light")
|
||||
|
|
Loading…
Reference in a new issue