2021-05-27 14:16:14 +00:00
|
|
|
(() => {
|
|
|
|
const root = document.documentElement;
|
|
|
|
if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
2021-05-27 14:17:27 +00:00
|
|
|
root.classList.add('theme-dark');
|
2021-05-27 14:16:14 +00:00
|
|
|
} else {
|
2021-05-27 14:17:27 +00:00
|
|
|
root.classList.remove('theme-dark');
|
2021-05-27 14:16:14 +00:00
|
|
|
}
|
2021-05-27 14:17:27 +00:00
|
|
|
})();
|