diff --git a/src/_includes/base.njk b/src/_includes/base.njk index 8db9eb0..15bd190 100644 --- a/src/_includes/base.njk +++ b/src/_includes/base.njk @@ -71,9 +71,6 @@ set: (obj, key, value) => { obj[key] = value; localStorage.setItem(key, value); - document.querySelectorAll(`[type="radio"][name="${key}"]`).forEach(radio => { - radio.checked = radio.value === value; - }); document.body.setAttribute(`data-${key}`, value); return true; @@ -88,7 +85,7 @@ radio.addEventListener('change', onRadioChange); radio.checked = data[radio.name] == radio.value; }); - document.body.setAttribute(`data-color-scheme`, data['color-scheme']); + document.body.setAttribute(`data-color-scheme`, localStorage.getItem('color-scheme'));