-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathuse-diffr-head.ts
More file actions
44 lines (44 loc) · 1.01 KB
/
Copy pathuse-diffr-head.ts
File metadata and controls
44 lines (44 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
export function useDiffrHead() {
useHead({
title: 'Diffr',
link: [
{
rel: 'icon',
href: useAbsoluteUrl('favicon.ico'),
},
{
rel: 'icon',
type: 'image/svg+xml',
href: useAbsoluteUrl('favicon.svg'),
},
{
rel: 'apple-touch-icon',
sizes: '180x180',
href: useAbsoluteUrl('apple-touch-icon.png'),
},
{
rel: 'mask-icon',
color: '#FAFBFC',
href: useAbsoluteUrl('maskable.svg'),
},
],
script: [
{
innerHTML: `if (
localStorage.theme === 'dark' ||
(
(
!('theme' in localStorage) ||
localStorage.theme === 'auto'
) &&
window.matchMedia('(prefers-color-scheme: dark)').matches
)
) {
document.documentElement.classList.add('dark')
} else {
document.documentElement.classList.remove('dark')
}`,
},
],
})
}