PlotDirector/PlotLine/wwwroot/js/public-auth-theme.js

16 lines
717 B
JavaScript

// Authentication uses the public brand in browsers and installed windows alike.
// The authenticated shell independently restores the user's saved application theme.
(() => {
const apply = () => {
const root = document.documentElement;
document.getElementById('public-auth-base')?.setAttribute('media', 'not all');
delete root.dataset.appTheme;
root.dataset.siteTheme = 'public';
root.dataset.theme = root.dataset.bsTheme = 'light';
document.querySelector('meta[name="theme-color"]')?.setAttribute('content', '#f8f5ee');
};
apply();
window.addEventListener('plotdirector:pwa-mode-changed', apply);
window.addEventListener('pageshow', apply);
})();