// Theme bootstrap: runs synchronously in to avoid a flash of the // wrong theme. The server renders data-default-theme from the user profile; // localStorage wins so the choice applies before login too. (function () { var el = document.documentElement; var saved = null; try { saved = localStorage.getItem('theme'); } catch (e) { /* private mode */ } var theme = saved || el.dataset.defaultTheme || 'light'; if (theme !== 'light' && theme !== 'dark') theme = 'light'; el.dataset.theme = theme; })();