fix: Button.Group size style issue (#21307)

* remove useless fixing line-height

* update snapshot
This commit is contained in:
二货机器人 2020-02-10 11:32:37 +08:00 committed by GitHub
parent e8b81b5d31
commit 06afc9cd9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 110 additions and 2 deletions

View File

@ -509,6 +509,77 @@ exports[`renders ./components/button/demo/icon.md correctly 1`] = `
</div>
`;
exports[`renders ./components/button/demo/legacy-group.md correctly 1`] = `
<div>
<div>
<div
class="ant-btn-group ant-btn-group-sm"
>
<button
class="ant-btn ant-btn-primary"
type="button"
>
<span>
Button 1
</span>
</button>
<button
class="ant-btn ant-btn-primary"
type="button"
>
<span>
Button 2
</span>
</button>
</div>
</div>
<div>
<div
class="ant-btn-group"
>
<button
class="ant-btn ant-btn-primary"
type="button"
>
<span>
Button 1
</span>
</button>
<button
class="ant-btn ant-btn-primary"
type="button"
>
<span>
Button 2
</span>
</button>
</div>
</div>
<div>
<div
class="ant-btn-group ant-btn-group-lg"
>
<button
class="ant-btn ant-btn-primary"
type="button"
>
<span>
Button 1
</span>
</button>
<button
class="ant-btn ant-btn-primary"
type="button"
>
<span>
Button 2
</span>
</button>
</div>
</div>
</div>
`;
exports[`renders ./components/button/demo/loading.md correctly 1`] = `
<div>
<button

View File

@ -0,0 +1,39 @@
---
order: 99
title:
zh-CN: 废弃的 Block 组
en-US: Deprecated Button Group
debug: true
---
## zh-CN
Debug usage
## en-US
Debug usage
```jsx
import { Button } from 'antd';
function getGroup(props) {
return (
<div>
<Button.Group {...props}>
<Button type="primary">Button 1</Button>
<Button type="primary">Button 2</Button>
</Button.Group>
</div>
);
}
ReactDOM.render(
<div>
{getGroup({ size: 'small' })}
{getGroup()}
{getGroup({ size: 'large' })}
</div>,
mountNode,
);
```

View File

@ -185,7 +185,6 @@
&-lg > .@{btnClassName},
&-lg > span > .@{btnClassName} {
.button-size(@btn-height-lg; @btn-padding-horizontal-lg; @btn-font-size-lg; 0);
line-height: @btn-height-lg - 2px;
}
&-lg > .@{btnClassName}.@{btnClassName}-icon-only {
.square(@btn-height-lg);
@ -195,7 +194,6 @@
&-sm > .@{btnClassName},
&-sm > span > .@{btnClassName} {
.button-size(@btn-height-sm; @btn-padding-horizontal-sm; @font-size-base; 0);
line-height: @btn-height-sm - 2px;
> .@{iconfont-css-prefix} {
font-size: @font-size-base;
}