From 42812162c46832ce4d3e332bd579c042309115bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=A0=E6=9C=A8?= Date: Wed, 21 Jul 2021 21:51:48 +0800 Subject: [PATCH] fix(dark-theme): disabled link `button` color MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复黑暗主题下禁用状态的link类型按钮的颜色 --- CHANGELOG.zh_CN.md | 1 + build/vite/plugin/theme.ts | 4 ++-- src/design/ant/btn.less | 23 ++++++++++++++++------- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.zh_CN.md b/CHANGELOG.zh_CN.md index eecbd1bd1..9678a7840 100644 --- a/CHANGELOG.zh_CN.md +++ b/CHANGELOG.zh_CN.md @@ -6,6 +6,7 @@ - **Dark Theme** 黑暗主题下的配色问题修正 - 修复`Tree`组件被选中节点的背景颜色 - 修复`Alert`组件的颜色配置 + - 修复禁用状态下的`link`类型的按钮颜色问题 ## 2.6.1(2021-07-19) diff --git a/build/vite/plugin/theme.ts b/build/vite/plugin/theme.ts index 2b8071d8e..48807b04e 100644 --- a/build/vite/plugin/theme.ts +++ b/build/vite/plugin/theme.ts @@ -45,8 +45,8 @@ export function configThemePlugin(isBuild: boolean): Plugin[] { }), antdDarkThemePlugin({ preloadFiles: [ - //path.resolve(process.cwd(), 'node_modules/ant-design-vue/dist/antd.less'), - path.resolve(process.cwd(), 'node_modules/ant-design-vue/dist/antd.dark.less'), + path.resolve(process.cwd(), 'node_modules/ant-design-vue/dist/antd.less'), + //path.resolve(process.cwd(), 'node_modules/ant-design-vue/dist/antd.dark.less'), path.resolve(process.cwd(), 'src/design/index.less'), ], filter: (id) => (isBuild ? !id.endsWith('antd.less') : true), diff --git a/src/design/ant/btn.less b/src/design/ant/btn.less index 68778b0e0..f8bde2823 100644 --- a/src/design/ant/btn.less +++ b/src/design/ant/btn.less @@ -50,15 +50,15 @@ border-color: @button-cancel-hover-border-color; } - &[disabled], - &[disabled]:hover { - color: fade(@button-cancel-color, 40%); - background: fade(@button-cancel-bg-color, 40%); - border-color: fade(@button-cancel-border-color, 40%); - } + //&[disabled], + //&[disabled]:hover { + // color: fade(@button-cancel-color, 40%); + // background: fade(@button-cancel-bg-color, 40%); + // border-color: fade(@button-cancel-border-color, 40%); + //} } - &.ant-btn-link.is-disabled { + [data-theme='light'] &.ant-btn-link.is-disabled { color: rgba(0, 0, 0, 0.25); text-shadow: none; cursor: not-allowed !important; @@ -67,6 +67,15 @@ box-shadow: none; } + [data-theme='dark'] &.ant-btn-link.is-disabled { + color: rgba(255, 255, 255, 0.25) !important; + text-shadow: none; + cursor: not-allowed !important; + background-color: transparent !important; + border-color: transparent !important; + box-shadow: none; + } + // color: @white; &-success.ant-btn-link:not([disabled='disabled']) {