functional a11y toggle and css

This commit is contained in:
sefaria
2026-05-26 23:46:05 +02:00
parent 430602caa3
commit 13632637a9
6 changed files with 15 additions and 2 deletions
+8 -2
View File
@@ -58,8 +58,10 @@
}
});
// accessibility toggle
// accessibility toggle
{
const STORAGE_KEY = 'extra-css-enabled';
function applyOverrideState(enabled) {
@@ -79,9 +81,12 @@
localStorage.setItem(STORAGE_KEY, String(nextState));
applyOverrideState(nextState);
});
}
// light-dark toggle
{
const STORAGE_KEY = 'theme-preference';
const root = document.documentElement;
const mq = window.matchMedia('(prefers-color-scheme: dark)');
@@ -150,4 +155,5 @@
document.addEventListener('DOMContentLoaded', initThemeToggle);
} else {
initThemeToggle();
}
}
}