fix: favicon dark mode (#359)

This commit is contained in:
ハン / Han authored and GitHub committed 2022-05-16 11:07:37 +08:00
1 parent 0a8ef07345
commit 2c29e41d52
5 files changed
+15 -11

No files matched your search

+8 -1
View File
@@ -2,7 +2,7 @@
// https://github.com/vueuse/head
// you can use this to manipulate the document head in any components,
// they will be rendered correctly in the html results with vite-ssg
import { isDark } from '~/composables'
import { isDark, preferredDark } from '~/composables'
useHead({
title: 'Vitesse',
@@ -13,6 +13,13 @@ useHead({
content: computed(() => isDark.value ? '#00aba9' : '#ffffff'),
},
],
link: [
{
rel: 'icon',
type: 'image/svg+xml',
href: computed(() => preferredDark.value ? '/favicon-dark.svg' : '/favicon.svg'),
},
],
})
</script>
+1
View File
@@ -1,3 +1,4 @@
// these APIs are auto-imported from @vueuse/core
export const isDark = useDark()
export const toggleDark = useToggle(isDark)
export const preferredDark = usePreferredDark()