From 7096b7f6c1462932a016433539011feadb7c2f73 Mon Sep 17 00:00:00 2001 From: cfq Date: Mon, 26 Jan 2026 15:17:41 +0800 Subject: [PATCH] =?UTF-8?q?feat(theme):=20=E5=AE=9E=E7=8E=B0=E5=AE=8C?= =?UTF-8?q?=E6=95=B4=E7=9A=84=E6=B7=B1=E8=89=B2=E4=B8=BB=E9=A2=98=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在多个组件中使用 CSS 变量替代硬编码颜色值 - 更新 useTheme 组合式函数以支持完整的深色主题变量 - 修改编辑器组件以根据主题动态切换样式 - 统一应用中的颜色使用方式,确保主题切换的一致性 --- src/App.vue | 4 +-- src/components/Editor.vue | 32 +++++++++++++++++++-- src/components/GitPanel.vue | 4 ++- src/components/HomeTab.vue | 16 +++++------ src/components/ImageTab.vue | 4 +-- src/components/Preview.vue | 31 +++++++++++++------- src/components/SearchPanel.vue | 10 +++---- src/components/StatusBar.vue | 5 ++-- src/components/TabBar.vue | 16 ++++++----- src/components/TabContainer.vue | 4 +-- src/components/Toolbar.vue | 8 +++--- src/composables/useTheme.js | 19 ++++++++++++ src/main.css | 51 ++++++++++++++------------------- 13 files changed, 130 insertions(+), 74 deletions(-) diff --git a/src/App.vue b/src/App.vue index 6fa7c74..b83226a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -275,7 +275,7 @@ const { state } = useFileTree(); // 需要获取 rootPath 用于保存 } .color-block.active { - border-color: #000; - box-shadow: 0 0 4px rgba(0,0,0,0.2); + border-color: var(--text-color); + box-shadow: 0 0 0 2px var(--primary-color-bg); } diff --git a/src/components/Editor.vue b/src/components/Editor.vue index 93a91a3..e5f852f 100644 --- a/src/components/Editor.vue +++ b/src/components/Editor.vue @@ -13,11 +13,12 @@