hugo-theme-minima/minima.1635437052.js
2021-10-28 16:04:13 +00:00

1 line
445 B
JavaScript

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