portails/assets/js/app.js

9 lines
296 B
JavaScript
Raw Normal View History

2020-04-15 15:48:16 +02:00
document.getElementById('mode').addEventListener('click', () => {
document.body.classList.toggle('dark');
localStorage.setItem('theme', document.body.classList.contains('dark') ? 'dark' : 'light');
});
if (localStorage.getItem('theme') === 'dark') {
document.body.classList.add('dark');
}