-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.vue
46 lines (37 loc) · 976 Bytes
/
app.vue
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
45
46
<script setup lang="ts">
import { Toaster } from 'vue-sonner';
import { darkTheme } from 'naive-ui';
const colorMode = useColorMode()
const themeString = computed(() => {
if (colorMode.preference === 'system')
return 'light'
return colorMode.preference === 'dark' ? 'dark' : 'light'
})
const themeForNaive = computed(() => {
if (colorMode.preference === 'system')
return undefined
return colorMode.preference === 'dark' ? darkTheme : undefined
})
</script>
<template>
<NConfigProvider :theme="themeForNaive">
<NuxtLoadingIndicator />
<NuxtLayout>
<NuxtPage />
<UNotifications class="z-50" />
<ClientOnly>
<Toaster class="z-50" position="top-left" :theme="themeString" rich-colors close-button :visible-toasts="5" />
</ClientOnly>
</NuxtLayout>
</NConfigProvider>
</template>
<style>
body {
background-color: #fff;
color: #000;
}
.dark-mode body {
background-color: #000;
color: #fff;
}
</style>