Skip to content

Commit 49ae6b4

Browse files
authored
Merge pull request #124 from filips123/restore-accent-colors
Restore normal accent colors
2 parents 9120c0b + a294964 commit 49ae6b4

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

website/src/App.vue

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ import NavigationMobile from '@/components/NavigationMobile.vue'
2121
import { useSnackbarStore } from '@/composables/snackbar'
2222
import { useSessionStore } from '@/stores/session'
2323
import { ThemeType, useSettingsStore } from '@/stores/settings'
24+
import { accentColors } from '@/utils/colors'
2425
import { updateAllData } from '@/utils/update'
2526
2627
const router = useRouter()
2728
const { mobile } = useDisplay()
2829
const theme = useTheme()
2930
3031
const { currentEntityList } = storeToRefs(useSessionStore())
31-
const { themeType, enablePullToRefresh } = storeToRefs(useSettingsStore())
32+
const { themeType, accentColor, enablePullToRefresh } = storeToRefs(useSettingsStore())
3233
3334
const routerTitle = computed(() => router.currentRoute.value.meta.title)
3435
@@ -74,6 +75,23 @@ watch(
7475
{ immediate: true },
7576
)
7677
78+
watch(
79+
accentColor,
80+
accentColor => {
81+
const color = accentColors.find(color => color.name === accentColor)!
82+
83+
theme.themes.value.light.colors.primary = color.primary
84+
theme.themes.value.light.colors.secondary = color.secondaryLight
85+
theme.themes.value.light.variables['current-time-color'] = color.currentTime
86+
87+
theme.themes.value.dark.colors.primary = color.primary
88+
theme.themes.value.dark.colors.secondary = color.secondaryDark
89+
90+
document.querySelector('meta[name="theme-color"]')?.setAttribute('content', color.theme)
91+
},
92+
{ immediate: true },
93+
)
94+
7795
const pages: { title: string; link: string; icon: string }[] = [
7896
{ title: 'Viri', link: 'sources', icon: mdiFileDocumentOutline },
7997
{ title: 'Naročanje', link: 'subscribe', icon: mdiRss },

website/src/plugins/vuetify.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { sl } from 'vuetify/locale'
88

99
import { AccentColorName, accentColors } from '@/utils/colors'
1010

11-
const accentColor = accentColors.find(color => color.name === AccentColorName.Black)!
11+
const accentColor = accentColors.find(color => color.name === AccentColorName.Green)!
1212

1313
const lightTheme: ThemeDefinition = {
1414
dark: false,

0 commit comments

Comments
 (0)