hugo-theme-minima/minima.1630049232.js
2021-08-27 07:27:12 +00:00

1 line
451 B
JavaScript

(()=>{var r="🌝",l="🌚",t="light",m="dark",i=document.getElementById("theme-switcher");i.innerHTML=localStorage.theme===t?r:l;i.addEventListener("click",function(){let e=localStorage.theme,c=e===t?m:t,{classList:n}=document.querySelector("html"),o=c===t?r:l;n.remove(e),n.add(c),localStorage.theme=c,i.innerHTML=o});document.querySelectorAll(".md ul").forEach(e=>{/<li><input .+>.+<\/li>/.test(e.innerHTML)&&e.classList.add("ul-checkbox")});})();