fix: theme color
This commit is contained in:
1 parent
083f7224da
commit
18b110a269
5 files changed
+29
-7
No files matched your search
@@ -0,0 +1,15 @@
|
||||
const ThemeColor = () => (
|
||||
<script
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `
|
||||
try {
|
||||
if (localStorage.theme === 'dark' || ((!('theme' in localStorage) || localStorage.theme === 'system') && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
||||
document.querySelector('meta[name="theme-color"]').setAttribute('content', 'hsl(222.2 84% 4.9%)')
|
||||
}
|
||||
} catch (_) {}
|
||||
`
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
export default ThemeColor;
|
||||
Reference in new issue
Block a user