Rename themes to standard names

This commit is contained in:
Wolfgang Huß 2024-04-23 14:20:10 +02:00
parent 790e5497be
commit 79e7cff04e
2 changed files with 8 additions and 10 deletions

View File

@ -8,7 +8,7 @@ import { createVueI18nAdapter } from 'vuetify/locale/adapters/vue-i18n'
import tokens from '#assets/sass/tokens.module.scss'
const ocelotStandardLightTheme: ThemeDefinition = {
const lightTheme: ThemeDefinition = {
dark: false,
colors: {
background: tokens.backgroundColorBase,
@ -25,10 +25,10 @@ const ocelotStandardLightTheme: ThemeDefinition = {
},
}
const ocelotStandardDarkTheme: ThemeDefinition = {
const darkTheme: ThemeDefinition = {
dark: true,
colors: {
...ocelotStandardLightTheme.colors,
...lightTheme.colors,
background: tokens.backgroundColorInverse,
surface: tokens.backgroundColorInverseSoft,
},
@ -45,11 +45,10 @@ export default (i18n: I18n<any, NonNullable<unknown>, NonNullable<unknown>, stri
},
ssr: true,
theme: {
defaultTheme: 'ocelotStandardLightTheme',
// defaultTheme: 'ocelotStandardDarkTheme',
defaultTheme: 'light',
themes: {
ocelotStandardLightTheme,
ocelotStandardDarkTheme,
light: lightTheme,
dark: darkTheme,
},
},
})

View File

@ -1,3 +1,4 @@
<!-- eslint-disable prettier/prettier -->
<template>
<v-app-bar flat>
<v-row>
@ -39,9 +40,7 @@ import LogoAvatar from './LogoAvatar.vue'
const theme = useTheme()
function toggleTheme() {
theme.global.name.value = theme.global.current.value.dark
? 'ocelotStandardLightTheme'
: 'ocelotStandardDarkTheme'
theme.global.name.value = theme.global.current.value.dark ? 'light' : 'dark'
}
const { current: locale } = useLocale()