8 lines
317 B
JavaScript
8 lines
317 B
JavaScript
// Set data-theme before first paint so the stored theme never flashes.
|
|
try {
|
|
const theme = window.localStorage.getItem('mosaic-theme') || 'dark';
|
|
document.documentElement.setAttribute('data-theme', theme === 'light' ? 'light' : 'dark');
|
|
} catch {
|
|
document.documentElement.setAttribute('data-theme', 'dark');
|
|
}
|