mirror of
https://github.com/hunvreus/basecoat.git
synced 2026-11-11 04:38:18 +00:00
Working on docs
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
(() => {
|
||||
document.body.addEventListener('click', (event) => {
|
||||
const toggleButton = event.target.closest('[data-action="toggle-dark-mode"]');
|
||||
|
||||
if (!toggleButton) return;
|
||||
|
||||
const isDark = document.documentElement.classList.toggle('dark');
|
||||
localStorage.setItem('darkMode', isDark ? 'dark' : 'light');
|
||||
});
|
||||
})();
|
||||
Reference in New Issue
Block a user