mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2025-02-27 11:06:03 +01:00
14 lines
331 B
JavaScript
14 lines
331 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', 'light');
|
|
document.documentElement.setAttribute('data-theme', 'light');
|
|
}
|
|
};
|
|
|
|
loadTheme();
|