diff --git a/components/button/style/mixin.less b/components/button/style/mixin.less index dedb1913f6..cd38bd290e 100644 --- a/components/button/style/mixin.less +++ b/components/button/style/mixin.less @@ -281,15 +281,33 @@ .button-color(@error-color, @btn-default-bg, @error-color); &:hover, &:focus { - .button-color( - ~`colorPalette('@{error-color}', 5) `; @btn-default-bg; ~`colorPalette('@{error-color}', 5) ` - ); + & when (@theme = dark) { + .button-color( + ~`colorPalette('@{error-color}', 7) `; @btn-default-bg; ~`colorPalette('@{error-color}', 7) + ` + ); + } + & when not (@theme = dark) { + .button-color( + ~`colorPalette('@{error-color}', 5) `; @btn-default-bg; ~`colorPalette('@{error-color}', 5) + ` + ); + } } &:active, &.active { - .button-color( - ~`colorPalette('@{error-color}', 7) `; @btn-default-bg; ~`colorPalette('@{error-color}', 7) ` - ); + & when (@theme = dark) { + .button-color( + ~`colorPalette('@{error-color}', 5) `; @btn-default-bg; ~`colorPalette('@{error-color}', 5) + ` + ); + } + & when not (@theme = dark) { + .button-color( + ~`colorPalette('@{error-color}', 7) `; @btn-default-bg; ~`colorPalette('@{error-color}', 7) + ` + ); + } } .button-disabled(); } @@ -299,10 +317,20 @@ box-shadow: none; &:hover, &:focus { - .button-color(~`colorPalette('@{error-color}', 5) `; transparent; transparent); + & when (@theme = dark) { + .button-color(~`colorPalette('@{error-color}', 7) `; transparent; transparent); + } + & when not (@theme = dark) { + .button-color(~`colorPalette('@{error-color}', 5) `; transparent; transparent); + } } &:active { - .button-color(~`colorPalette('@{error-color}', 7) `; transparent; transparent); + & when (@theme = dark) { + .button-color(~`colorPalette('@{error-color}', 5) `; transparent; transparent); + } + & when not (@theme = dark) { + .button-color(~`colorPalette('@{error-color}', 7) `; transparent; transparent); + } } .button-disabled(@disabled-color; transparent; transparent); }