mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 22:36:31 +08:00
Auto adjust notification style for singleline message, close #5846
This commit is contained in:
parent
f5fa64c17b
commit
12a9f1e5b5
@ -124,7 +124,10 @@ function notice(args) {
|
||||
content: (
|
||||
<div className={iconNode ? `${prefixCls}-with-icon` : ''}>
|
||||
{iconNode}
|
||||
<div className={`${prefixCls}-message`}>{args.message}</div>
|
||||
<div className={`${prefixCls}-message`}>
|
||||
<span className={`${prefixCls}-message-single-line-auto-margin`} />
|
||||
{args.message}
|
||||
</div>
|
||||
<div className={`${prefixCls}-description`}>{args.description}</div>
|
||||
{args.btn ? <span className={`${prefixCls}-btn`}>{args.btn}</span> : null}
|
||||
</div>
|
||||
|
@ -38,6 +38,21 @@
|
||||
color: @heading-color;
|
||||
margin-bottom: 4px;
|
||||
line-height: 20px;
|
||||
display: inline-block;
|
||||
|
||||
// https://github.com/ant-design/ant-design/issues/5846#issuecomment-296244140
|
||||
&-single-line-auto-margin {
|
||||
width: ~"calc(@{notification-width} - @{notification-padding} * 2 - 24px - 48px - 100%)";
|
||||
background-color: transparent;
|
||||
pointer-events: none;
|
||||
display: block;
|
||||
max-width: 4px;
|
||||
&:before {
|
||||
content: '';
|
||||
display: block;
|
||||
padding-bottom: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-description {
|
||||
@ -60,7 +75,7 @@
|
||||
}
|
||||
|
||||
&-icon {
|
||||
float: left;
|
||||
position: absolute;
|
||||
font-size: 32px;
|
||||
line-height: 32px;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user