fix(theme): incorrect appearance scripts in head, close #211 (#213)

This commit is contained in:
pengzhanbo 2024-09-24 22:53:36 +08:00 committed by GitHub
parent c8089f54a5
commit 52c954a27a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,7 +18,6 @@ export function resolvePageHead(page: Page, localeOptions: PlumeThemeLocaleOptio
const sm = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
const isDark = um === 'dark' || (um !== 'light' && sm);
document.documentElement.dataset.theme = isDark ? 'dark' : 'light';
}
})();`.replace(/^\s+|\s+$/gm, '').replace(/\n/g, ''),
])
}