//(function() {
    var theme = "dark"; //default to light

    //local storage is used to override OS theme settings
    if (localStorage.getItem("theme")) {
        if (localStorage.getItem("theme") == "dark") {
            theme = "dark";
        } else if (localStorage.getItem("theme") == "light") {
            theme = "light";
			
        }
    } else if (!window.matchMedia) {
        //matchMedia method not supported

    } else if (window.matchMedia("(prefers-color-scheme: light)").matches) {
        //OS theme setting detected as dark
        theme = "light";
    } else if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
        theme = "dark";
    }

    //dark theme preferred, set document with a `data-theme` attribute
    if (theme == "light") {
        document.documentElement.setAttribute("data-theme", "light");

    document.documentElement.classList.add("light")
		

    }
    if (theme == 'dark') {
        document.documentElement.setAttribute("data-theme", "dark");

    document.documentElement.classList.add("dark")

    }
//})();