fix: correct linking of theme colors (#2524)

zio/stable
Sebastian Di Luzio 2023-12-22 13:25:34 +01:00 committed by GitHub
parent c0bb6e293c
commit 07042b9f31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,7 @@ import type { ThemeColors } from '~/composables/settings'
const themes = await import('~/constants/themes.json').then(r => r.default) as [string, ThemeColors][] const themes = await import('~/constants/themes.json').then(r => r.default) as [string, ThemeColors][]
const settings = $(useUserSettings()) const settings = $(useUserSettings())
const currentTheme = $computed(() => settings.themeColors?.['--theme-color-name'] || themes[0][0]) const currentTheme = $computed(() => settings.themeColors?.['--theme-color-name'] || themes[0][1]['--theme-color-name'])
function updateTheme(theme: ThemeColors) { function updateTheme(theme: ThemeColors) {
settings.themeColors = theme settings.themeColors = theme
@ -19,8 +19,8 @@ function updateTheme(theme: ThemeColors) {
'background': key, 'background': key,
'--local-ring-color': key, '--local-ring-color': key,
}" }"
:class="currentTheme === key ? 'ring-2' : 'scale-90'" :class="currentTheme === theme['--theme-color-name'] ? 'ring-2' : 'scale-90'"
:title="key" :title="theme['--theme-color-name']"
w-8 h-8 rounded-full transition-all w-8 h-8 rounded-full transition-all
ring="$local-ring-color offset-3 offset-$c-bg-base" ring="$local-ring-color offset-3 offset-$c-bg-base"
@click="updateTheme(theme)" @click="updateTheme(theme)"