Bump nuxt version (#1093)

* Bump nuxt version

* tests

* bump again

* fix modals
This commit is contained in:
Geometrically
2023-04-13 15:27:41 -07:00
committed by GitHub
parent 5fd3a45c64
commit 4398563b85
8 changed files with 507 additions and 393 deletions

View File

@@ -1,24 +1,24 @@
export default defineNuxtPlugin((nuxtApp) => {
const themeStore = useTheme()
// nuxtApp.hook('app:mounted', () => {
// if (process.client && themeStore.value.preference === 'system') {
// const colorSchemeQueryList = window.matchMedia('(prefers-color-scheme: light)')
//
// const setColorScheme = (e) => {
// if (themeStore.value.preference === 'system') {
// if (e.matches) {
// updateTheme('light')
// } else {
// updateTheme('dark')
// }
// }
// }
//
// setColorScheme(colorSchemeQueryList)
// colorSchemeQueryList.addEventListener('change', setColorScheme)
// }
// })
nuxtApp.hook('app:mounted', () => {
if (process.client && themeStore.value.preference === 'system') {
const colorSchemeQueryList = window.matchMedia('(prefers-color-scheme: light)')
const setColorScheme = (e) => {
if (themeStore.value.preference === 'system') {
if (e.matches) {
updateTheme('light')
} else {
updateTheme('dark')
}
}
}
setColorScheme(colorSchemeQueryList)
colorSchemeQueryList.addEventListener('change', setColorScheme)
}
})
nuxtApp.provide('colorMode', themeStore.value)
})