From 2b1f5f2c7033eebee97de472b5f6195d95516b80 Mon Sep 17 00:00:00 2001 From: LiuHao <liuhaoai545@gmail.com> Date: 星期五, 27 十二月 2024 11:45:33 +0800 Subject: [PATCH] 优化 主题色在深色模式下显示亮度 --- src/layout/components/TagsView/index.vue | 4 ++-- src/assets/styles/variables.module.scss | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/assets/styles/variables.module.scss b/src/assets/styles/variables.module.scss index 36a8df6..4405b97 100644 --- a/src/assets/styles/variables.module.scss +++ b/src/assets/styles/variables.module.scss @@ -21,7 +21,12 @@ // ele --brder-color: #e8e8e8; + + // 娣诲姞 tag 鐩稿叧鍙橀噺 + --tags-view-active-bg: var(--el-color-primary); + --tags-view-active-border-color: var(--el-color-primary); } + html.dark { --menuBg: #1d1e1f; --menuColor: #bfcbd9; @@ -41,6 +46,20 @@ .el-tree-node__content { --el-color-primary-light-9: #262727; } + + .el-button--primary { + --el-button-bg-color: var(--el-color-primary-dark-6); + --el-button-border-color: var(--el-color-primary-light-2); + } + + .el-switch { + --el-switch-on-color: var(--el-color-primary-dark-6); + --el-switch-border-color: var(--el-color-primary-light-2); + } + + // 鍦ㄦ繁鑹叉ā寮忎笅浣跨敤鏇存繁鐨勯鑹� + --tags-view-active-bg: var(--el-color-primary-dark-6); + --tags-view-active-border-color: var(--el-color-primary-light-2); // vxe-table 涓婚 --vxe-font-color: #98989e; --vxe-primary-color: #2c7ecf; diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue index 0812feb..9bcf285 100644 --- a/src/layout/components/TagsView/index.vue +++ b/src/layout/components/TagsView/index.vue @@ -70,8 +70,8 @@ const activeStyle = (tag: RouteLocationNormalized) => { if (!isActive(tag)) return {}; return { - 'background-color': theme.value, - 'border-color': theme.value + 'background-color': 'var(--tags-view-active-bg)', + 'border-color': 'var(--tags-view-active-border-color)' }; }; const isAffix = (tag: RouteLocationNormalized) => { -- Gitblit v1.9.3