mirror of
https://github.com/thegeneralist01/archivr
synced 2026-12-04 18:56:44 +01:00
9 lines
357 B
JavaScript
9 lines
357 B
JavaScript
(function () {
|
|
try {
|
|
var stored = localStorage.getItem('archivr-theme');
|
|
var isDark = stored === 'dark' || (stored !== 'light' && window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches);
|
|
document.documentElement.dataset.theme = isDark ? 'dark' : 'light';
|
|
} catch (e) {
|
|
/* ignore storage access error */
|
|
}
|
|
})();
|