🐛 Fix circle button is not circle

close #18509
This commit is contained in:
afc163 2019-08-28 11:48:34 +08:00
parent be5760d8ef
commit 4d0bd6b7da
3 changed files with 20 additions and 1 deletions

View File

@ -518,6 +518,14 @@ exports[`renders ./components/button/demo/icon.md correctly 1`] = `
</svg>
</i>
</button>
<button
class="ant-btn ant-btn-primary ant-btn-circle"
type="button"
>
<span>
A
</span>
</button>
<button
class="ant-btn ant-btn-primary"
type="button"

View File

@ -23,6 +23,9 @@ import { Button } from 'antd';
ReactDOM.render(
<div>
<Button type="primary" shape="circle" icon="search" />
<Button type="primary" shape="circle">
A
</Button>
<Button type="primary" icon="search">
Search
</Button>

View File

@ -252,9 +252,17 @@
}
// circle button: the content only contains icon
.btn-circle(@btnClassName: btn) {
min-width: @btn-height-base;
padding-right: 0;
padding-left: 0;
text-align: center;
border-radius: 50%;
&.@{btnClassName}-lg,
&.@{btnClassName}-lg {
min-width: @btn-height-lg;
border-radius: 50%;
}
&.@{btnClassName}-sm {
min-width: @btn-height-sm;
border-radius: 50%;
}
}