We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3398f0c commit e2464afCopy full SHA for e2464af
docs/js/theme-toggle.js
@@ -18,7 +18,11 @@
18
function applyTheme(theme, skipSetStorage) {
19
document.documentElement.setAttribute('data-theme', theme);
20
if (!skipSetStorage) {
21
- localStorage.setItem(STORAGE_KEY, theme);
+ try {
22
+ localStorage.setItem(STORAGE_KEY, theme);
23
+ } catch (e) {
24
+ // Silently fail - theme will still work for current session
25
+ }
26
}
27
const isDark = theme === 'dark';
28
document.documentElement.classList.toggle(CODE_THEME_CLASS, isDark);
0 commit comments