1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-02-27 02:56:04 +01:00
CommandStation-EX/_static/dark_mode_js/default_dark.js

14 lines
329 B
JavaScript

const loadTheme = () => {
let theme = localStorage.getItem('theme');
if (theme !== null) {
if (theme === 'dark')
document.documentElement.setAttribute('data-theme', 'dark');
} else {
localStorage.setItem('theme', 'dark');
document.documentElement.setAttribute('data-theme', 'dark');
}
};
loadTheme();