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 () {
|
(function () {
|
||||||
var element = document.body;
|
let element = document.body;
|
||||||
var theme = localStorage.getItem("colorscheme");
|
let theme = localStorage.getItem("colorscheme");
|
||||||
if (theme === null) {
|
if (theme === null) {
|
||||||
localStorage.setItem("colorscheme", "dark")
|
localStorage.setItem("colorscheme", "dark")
|
||||||
}
|
}
|
||||||
|
@ -10,8 +10,8 @@
|
||||||
})();
|
})();
|
||||||
|
|
||||||
function themeToggle() {
|
function themeToggle() {
|
||||||
var theme = localStorage.getItem("colorscheme");
|
let theme = localStorage.getItem("colorscheme");
|
||||||
var element = document.body;
|
let element = document.body;
|
||||||
if (theme === "dark") {
|
if (theme === "dark") {
|
||||||
element.classList.toggle("light-mode");
|
element.classList.toggle("light-mode");
|
||||||
localStorage.setItem("colorscheme", "light")
|
localStorage.setItem("colorscheme", "light")
|
||||||
|
|
Loading…
Reference in a new issue