Browse Source

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

* remove useless fixing line-height

* update snapshot
pull/21312/head
二货机器人 5 years ago
committed by GitHub
parent
commit
06afc9cd9c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 71
      components/button/__tests__/__snapshots__/demo.test.js.snap
  2. 39
      components/button/demo/legacy-group.md
  3. 2
      components/button/style/mixin.less

71
components/button/__tests__/__snapshots__/demo.test.js.snap

@ -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

39
components/button/demo/legacy-group.md

@ -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,
);
```

2
components/button/style/mixin.less

@ -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;
}

Loading…
Cancel
Save