Skip to content
Snippets Groups Projects
Select Git revision
  • d781c874aa8743cff22e0e78a7457f1ef4178e19
  • main default protected
2 results

theme.js

Blame
  • theme.js 308 B
    document.body.dataset.theme = getCookie("theme");
    
    // https://stackoverflow.com/questions/10730362/get-cookie-by-name
    function getCookie(name) {
        const value = `; ${document.cookie}`;
        const parts = value.split(`; ${name}=`);
        if (parts.length === 2)
            return parts.pop().split(';').shift();
    }