// window.onload = function(){
//     document.documentElement.dataset.theme='dark';
// };

// light-dark mode 클릭
if(document.querySelector('.lightmode')){

    if(localStorage.getItem("lightmode") == 'on'){
        document.documentElement.dataset.theme='light';
        document.querySelector('#toggle-radio-light').checked = true;
    }

    //이벤트 클릭
    document.querySelector('.lightmode').addEventListener("click", e=>{
        if(e.target.classList.contains('tolight')){
            document.documentElement.dataset.theme='light';
            localStorage.setItem("lightmode", "on");
        }else if(e.target.classList.contains('todark')){
            document.documentElement.dataset.theme='dark';
            localStorage.setItem("lightmode", "off");
        }
    },false);

}else{
    localStorage.removeItem("lightmode");
}