mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 19:50:05 +08:00
refactor card extra style
This commit is contained in:
parent
5443e79329
commit
f46112d385
@ -108,16 +108,11 @@ export default class Card extends Component<CardProps, {}> {
|
||||
}
|
||||
|
||||
let head;
|
||||
if (!title) {
|
||||
head = null;
|
||||
} else {
|
||||
head = typeof title === 'string' ? (
|
||||
if (title || extra) {
|
||||
head = (
|
||||
<div className={`${prefixCls}-head`}>
|
||||
<h3 className={`${prefixCls}-head-title`}>{title}</h3>
|
||||
</div>
|
||||
) : (
|
||||
<div className={`${prefixCls}-head`}>
|
||||
<div className={`${prefixCls}-head-title`}>{title}</div>
|
||||
{title ? <div className={`${prefixCls}-head-title`}>{title}</div> : null}
|
||||
{extra ? <div className={`${prefixCls}-extra`}>{extra}</div> : null}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@ -125,7 +120,6 @@ export default class Card extends Component<CardProps, {}> {
|
||||
return (
|
||||
<div {...others} className={classString} ref={this.saveRef}>
|
||||
{head}
|
||||
{extra ? <div className={`${prefixCls}-extra`}>{extra}</div> : null}
|
||||
<div className={`${prefixCls}-body`} style={bodyStyle}>{children}</div>
|
||||
</div>
|
||||
);
|
||||
|
@ -28,23 +28,22 @@
|
||||
border-bottom: @border-width-base @border-style-base @border-color-split;
|
||||
padding: 0 @card-padding-base;
|
||||
border-radius: @border-radius-sm @border-radius-sm 0 0;
|
||||
.clearfix;
|
||||
|
||||
&-title {
|
||||
font-size: @font-size-lg;
|
||||
display: inline-block;
|
||||
text-overflow: ellipsis;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
color: @card-head-color;
|
||||
font-weight: 500;
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
|
||||
&-extra {
|
||||
position: absolute;
|
||||
right: @card-padding-base;
|
||||
top: 14px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
&-body {
|
||||
|
Loading…
Reference in New Issue
Block a user