From b36ebadcb87897e01b314b4a696a281d299085f5 Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Sun, 10 Nov 2024 00:13:43 +0800 Subject: [PATCH] feat(theme): optimize appearance transition, close #325 (#333) --- docs/notes/theme/config/主题配置.md | 7 +- .../client/components/VPSwitchAppearance.vue | 92 ++++++++++++++++++- theme/src/client/composables/dark-mode.ts | 9 +- theme/src/shared/base.ts | 4 +- 4 files changed, 101 insertions(+), 11 deletions(-) diff --git a/docs/notes/theme/config/主题配置.md b/docs/notes/theme/config/主题配置.md index 2b2ec3ad..e94436f3 100644 --- a/docs/notes/theme/config/主题配置.md +++ b/docs/notes/theme/config/主题配置.md @@ -711,10 +711,11 @@ interface SidebarItem { */ postList?: boolean /** - * 是否启用 深色/浅色 模式切换过渡动画 - * @default true + * 是否启用 深色/浅色 模式切换过渡动画, + * 或配置过渡动画类型 + * @default 'fade' */ - appearance?: boolean + appearance?: boolean | 'fade' | 'circle-clip' | 'horizontal-clip' | 'vertical-clip' | 'skew-clip' } ``` diff --git a/theme/src/client/components/VPSwitchAppearance.vue b/theme/src/client/components/VPSwitchAppearance.vue index 0e74f163..ff2c2163 100644 --- a/theme/src/client/components/VPSwitchAppearance.vue +++ b/theme/src/client/components/VPSwitchAppearance.vue @@ -1,13 +1,79 @@