ZONOS3-Mini / studio /theme-boot.js
Gatozu35's picture
Deploy ZONOS3 714a9cb-dirty
127a1e8 verified
Raw History Blame Contribute Delete
532 Bytes
// The saved theme before the first paint (no dark flash on the light theme). A classic script every page loads in
// its <head>, before any stylesheet applies.
try {
var stored = localStorage.getItem('zvs.theme');
var light = stored ? JSON.parse(stored) === 'light' : matchMedia('(prefers-color-scheme: light)').matches;
if (light) {
document.documentElement.dataset.theme = 'light';
var meta = document.querySelector('meta[name="theme-color"]');
if (meta) meta.setAttribute('content', '#f5f3ee');
}
} catch {}