mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2025-02-27 02:56:04 +01:00
14 lines
329 B
JavaScript
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();
|