Skip to content

Commit

Permalink
feat(projects): Grayscale mode is added
Browse files Browse the repository at this point in the history
  • Loading branch information
Li-0221 committed Apr 23, 2024
1 parent 302fef6 commit d9020cf
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/layouts/modules/theme-drawer/modules/dark-mode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const showSiderInverted = computed(() => !themeStore.darkMode && themeStore.layo
<NSwitch v-model:value="themeStore.sider.inverted" />
</SettingItem>
</Transition>
<SettingItem label="灰度模式">
<SettingItem :label="$t('theme.themeSchema.grayscale')">
<NSwitch v-model:value="themeStore.grayscale" />
</SettingItem>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/locales/langs/en-us.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ const local: App.I18n.Schema = {
title: 'Theme Schema',
light: 'Light',
dark: 'Dark',
auto: 'Follow System'
auto: 'Follow System',
grayscale: 'Grayscale'
},
layoutMode: {
title: 'Layout Mode',
Expand Down
3 changes: 2 additions & 1 deletion src/locales/langs/zh-cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ const local: App.I18n.Schema = {
title: '主题模式',
light: '亮色模式',
dark: '暗黑模式',
auto: '跟随系统'
auto: '跟随系统',
grayscale: '灰度模式'
},
layoutMode: {
title: '布局模式',
Expand Down
2 changes: 1 addition & 1 deletion src/typings/app.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ declare namespace App {
tokenExpired: string;
};
theme: {
themeSchema: { title: string } & Record<UnionKey.ThemeScheme, string>;
themeSchema: { title: string } & Record<UnionKey.ThemeScheme | UnionKey.Grayscale, string>;
layoutMode: { title: string } & Record<UnionKey.ThemeLayoutMode, string>;
themeColor: {
title: string;
Expand Down
3 changes: 3 additions & 0 deletions src/typings/union-key.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ declare namespace UnionKey {
/** Theme scheme */
type ThemeScheme = 'light' | 'dark' | 'auto';

/** Grayscale mode */
type Grayscale = 'grayscale';

/**
* The layout mode
*
Expand Down

0 comments on commit d9020cf

Please sign in to comment.