diff --git a/locales/en.yml b/locales/en.yml index 23a074e..9deffcd 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -162,3 +162,9 @@ not-found: Not found notifications: empty: No notifications + +customize: + title: Customize + theme: Theme + color: Color + layout: Layout diff --git a/locales/fa.yml b/locales/fa.yml index 30503af..0d3db80 100644 --- a/locales/fa.yml +++ b/locales/fa.yml @@ -156,3 +156,9 @@ userMenu: notifications: empty: هیچ اعلانی وجود ندارد + +customize: + title: سفارشی سازی + theme: پوسته + color: رنگ + layout: چیدمان diff --git a/src/App.vue b/src/App.vue index 7b83aac..ff3eae1 100644 --- a/src/App.vue +++ b/src/App.vue @@ -22,6 +22,8 @@ const rtlStyles = [ tagRtl, ] +const customTheme = ref({ ...themeOverrides }) + watch(() => layout.activeLanguage, () => { const body = document.querySelector('body') as HTMLElement if (layout.isRtl) @@ -38,11 +40,16 @@ watch(() => layout.isDark, (newValue) => { else document.documentElement.classList.remove('dark') }, { immediate: true }) + +watch(() => layout.themeColor, (newValue) => { + if (customTheme.value.common && newValue !== '') + customTheme.value.common.primaryColor = newValue +}, { immediate: true })