KT-personal-website/public/assets/js/app-min.js
2024-10-22 12:26:08 +02:00

1 line
No EOL
475 B
JavaScript

function switchTheme(e){let t=document.documentElement.getAttribute("data-theme");return null===t||"light"===t?(document.documentElement.setAttribute("data-theme","dark"),localStorage.setItem("theme","dark")):(document.documentElement.setAttribute("data-theme","light"),localStorage.setItem("theme","light")),!1}const currentTheme=localStorage.getItem("theme")?localStorage.getItem("theme"):null;currentTheme&&document.documentElement.setAttribute("data-theme",currentTheme);