diff --git a/components/button/__tests__/__snapshots__/demo.test.ts.snap b/components/button/__tests__/__snapshots__/demo.test.ts.snap index 83333b2081..b3b96ffd83 100644 --- a/components/button/__tests__/__snapshots__/demo.test.ts.snap +++ b/components/button/__tests__/__snapshots__/demo.test.ts.snap @@ -109,12 +109,20 @@ Array [ Dashed , + + + Text + + , - link + Link , ] @@ -176,6 +184,24 @@ exports[`renders ./components/button/demo/disabled.md correctly 1`] = ` + + + Text + + + + + Text(disabled) + + + - Text + Danger Default - Text(disabled) + Danger Default(disabled) - Danger Link + Danger Text - Danger Link(disabled) + Danger Text(disabled) - Danger Default + Danger Link - Danger Default(disabled) + Danger Link(disabled) Dashed + + Text + - link + Link >, mountNode, diff --git a/components/button/demo/disabled.md b/components/button/demo/disabled.md index 9242859f67..150511d443 100644 --- a/components/button/demo/disabled.md +++ b/components/button/demo/disabled.md @@ -31,14 +31,26 @@ ReactDOM.render( Dashed(disabled) + Text + + Text(disabled) + + Link Link(disabled) - Text - - Text(disabled) + Danger Default + + Danger Default(disabled) + + + + Danger Text + + + Danger Text(disabled) @@ -47,11 +59,6 @@ ReactDOM.render( Danger Link(disabled) - - Danger Default - - Danger Default(disabled) - Ghost diff --git a/components/button/style/index.less b/components/button/style/index.less index 5b92a3490f..3921840521 100644 --- a/components/button/style/index.less +++ b/components/button/style/index.less @@ -22,7 +22,7 @@ line-height: @line-height-base; .btn; .btn-default; - + // Fix loading button animation // https://github.com/ant-design/ant-design/issues/24323 > span { @@ -95,6 +95,10 @@ .btn-danger-link; } + &-dangerous&-text { + .btn-danger-text; + } + &-icon-only { .btn-square(@btn-prefix-cls); vertical-align: -0.5px; diff --git a/components/button/style/mixin.less b/components/button/style/mixin.less index 7ddc6fc09a..cbf8b5571b 100644 --- a/components/button/style/mixin.less +++ b/components/button/style/mixin.less @@ -375,6 +375,29 @@ .button-disabled(@disabled-color; transparent; transparent); } +.btn-danger-text() { + .button-variant-other(@error-color, transparent, transparent); + box-shadow: none; + &:hover, + &:focus { + & when (@theme = dark) { + .button-color(~`colorPalette('@{error-color}', 7) `; @btn-text-hover-bg; transparent); + } + & when not (@theme = dark) { + .button-color(~`colorPalette('@{error-color}', 5) `; @btn-text-hover-bg; transparent); + } + } + + &:active { + & when (@theme = dark) { + .button-color(~`colorPalette('@{error-color}', 5) `; fadein(@btn-text-hover-bg, 1%); transparent); + } + & when not (@theme = dark) { + .button-color(~`colorPalette('@{error-color}', 7) `; fadein(@btn-text-hover-bg, 1%); transparent); + } + } + .button-disabled(@disabled-color; transparent; transparent); +} // round button .btn-round(@btnClassName: btn) { .button-size(@btn-circle-size; @btn-circle-size / 2; @font-size-base; @btn-circle-size);