extractify.zip/plugins/vuetify.ts

19 lines
476 B
TypeScript
Raw Normal View History

2023-05-15 03:32:16 +03:00
import { createVuetify } from 'vuetify'
import * as components from 'vuetify/components'
import * as directives from 'vuetify/directives'
export default defineNuxtPlugin(nuxtApp => {
2023-06-06 03:59:48 +03:00
// get system dark mode
const darkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
2023-05-15 03:32:16 +03:00
const vuetify = createVuetify({
2023-05-15 16:30:59 +03:00
ssr: false,
2023-05-15 03:32:16 +03:00
components,
2023-06-06 03:59:48 +03:00
directives,
theme: {
defaultTheme: darkMode ? 'dark' : 'light',
}
2023-05-15 03:32:16 +03:00
})
nuxtApp.vueApp.use(vuetify)
})