2019-05-06 12:04:39 +08:00
|
|
|
@import '../../style/themes/index';
|
2018-12-07 16:17:45 +08:00
|
|
|
@import '../../style/mixins/index';
|
2021-09-07 16:14:20 +08:00
|
|
|
|
|
|
|
.popover-customize-bg(@notification-prefix-cls, @popover-background);
|
2015-07-28 15:40:28 +08:00
|
|
|
|
2018-12-07 16:17:45 +08:00
|
|
|
@notification-prefix-cls: ~'@{ant-prefix}-notification';
|
2017-10-11 12:01:27 +08:00
|
|
|
@notification-width: 384px;
|
2017-12-06 10:19:50 +08:00
|
|
|
@notification-padding: @notification-padding-vertical @notification-padding-horizontal;
|
2017-10-11 12:01:27 +08:00
|
|
|
@notification-margin-bottom: 16px;
|
2020-10-16 16:07:56 +08:00
|
|
|
@notification-margin-edge: 24px;
|
2015-07-28 15:40:28 +08:00
|
|
|
|
2015-08-20 16:55:42 +08:00
|
|
|
.@{notification-prefix-cls} {
|
2020-12-22 11:08:12 +08:00
|
|
|
.reset-component();
|
2017-09-22 18:33:29 +08:00
|
|
|
|
2015-07-28 15:40:28 +08:00
|
|
|
position: fixed;
|
2016-03-28 16:01:37 +08:00
|
|
|
z-index: @zindex-notification;
|
2020-10-16 16:07:56 +08:00
|
|
|
margin-right: @notification-margin-edge;
|
2015-07-28 15:40:28 +08:00
|
|
|
|
2017-01-27 17:12:25 +08:00
|
|
|
&-topLeft,
|
|
|
|
&-bottomLeft {
|
|
|
|
margin-right: 0;
|
2020-10-16 16:07:56 +08:00
|
|
|
margin-left: @notification-margin-edge;
|
2017-01-27 17:12:25 +08:00
|
|
|
|
|
|
|
.@{notification-prefix-cls}-fade-enter.@{notification-prefix-cls}-fade-enter-active,
|
|
|
|
.@{notification-prefix-cls}-fade-appear.@{notification-prefix-cls}-fade-appear-active {
|
|
|
|
animation-name: NotificationLeftFadeIn;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-31 15:59:51 +08:00
|
|
|
&-close-icon {
|
|
|
|
font-size: @font-size-base;
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
|
2021-05-19 17:31:03 +08:00
|
|
|
&-hook-holder {
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
2015-07-28 15:40:28 +08:00
|
|
|
&-notice {
|
|
|
|
position: relative;
|
2020-06-23 11:40:33 +08:00
|
|
|
width: @notification-width;
|
2020-10-16 16:07:56 +08:00
|
|
|
max-width: ~'calc(100vw - @{notification-margin-edge} * 2)';
|
2016-04-27 20:44:36 +08:00
|
|
|
margin-bottom: @notification-margin-bottom;
|
2020-06-23 11:40:33 +08:00
|
|
|
margin-left: auto;
|
2021-05-19 17:31:03 +08:00
|
|
|
padding: @notification-padding;
|
2015-07-28 15:40:28 +08:00
|
|
|
overflow: hidden;
|
2021-05-19 17:31:03 +08:00
|
|
|
line-height: @line-height-base;
|
2020-10-22 15:19:04 +08:00
|
|
|
word-wrap: break-word;
|
2019-11-28 21:43:54 +08:00
|
|
|
background: @notification-bg;
|
2019-02-15 10:48:07 +08:00
|
|
|
border-radius: @border-radius-base;
|
|
|
|
box-shadow: @shadow-2;
|
2020-06-23 11:40:33 +08:00
|
|
|
|
|
|
|
.@{notification-prefix-cls}-topLeft &,
|
|
|
|
.@{notification-prefix-cls}-bottomLeft & {
|
|
|
|
margin-right: auto;
|
|
|
|
margin-left: 0;
|
|
|
|
}
|
2015-07-28 15:40:28 +08:00
|
|
|
|
2016-04-10 13:08:56 +08:00
|
|
|
&-message {
|
2017-10-11 12:01:27 +08:00
|
|
|
margin-bottom: 8px;
|
2019-02-15 10:48:07 +08:00
|
|
|
color: @heading-color;
|
|
|
|
font-size: @font-size-lg;
|
2017-10-11 12:01:27 +08:00
|
|
|
line-height: 24px;
|
2017-04-22 01:11:18 +08:00
|
|
|
|
|
|
|
// https://github.com/ant-design/ant-design/issues/5846#issuecomment-296244140
|
|
|
|
&-single-line-auto-margin {
|
2019-02-15 10:48:07 +08:00
|
|
|
display: block;
|
2018-12-07 16:17:45 +08:00
|
|
|
width: ~'calc(@{notification-width} - @{notification-padding-horizontal} * 2 - 24px - 48px - 100%)';
|
2019-02-15 10:48:07 +08:00
|
|
|
max-width: 4px;
|
2017-04-22 01:11:18 +08:00
|
|
|
background-color: transparent;
|
|
|
|
pointer-events: none;
|
2021-10-13 15:38:59 +08:00
|
|
|
|
2019-02-15 10:48:07 +08:00
|
|
|
&::before {
|
2017-04-22 01:11:18 +08:00
|
|
|
display: block;
|
2019-02-15 10:48:07 +08:00
|
|
|
content: '';
|
2017-04-22 01:11:18 +08:00
|
|
|
}
|
|
|
|
}
|
2016-04-10 13:08:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-description {
|
|
|
|
font-size: @font-size-base;
|
|
|
|
}
|
|
|
|
|
2016-08-28 17:45:27 +08:00
|
|
|
&-closable &-message {
|
2016-08-28 17:16:43 +08:00
|
|
|
padding-right: 24px;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-with-icon &-message {
|
2016-04-10 13:08:56 +08:00
|
|
|
margin-bottom: 4px;
|
2019-02-15 10:48:07 +08:00
|
|
|
margin-left: 48px;
|
|
|
|
font-size: @font-size-lg;
|
2015-07-28 15:40:28 +08:00
|
|
|
}
|
|
|
|
|
2016-08-28 17:16:43 +08:00
|
|
|
&-with-icon &-description {
|
|
|
|
margin-left: 48px;
|
2016-04-10 13:08:56 +08:00
|
|
|
font-size: @font-size-base;
|
|
|
|
}
|
|
|
|
|
2019-05-09 20:39:09 +08:00
|
|
|
// Icon & color style in different selector level
|
|
|
|
// https://github.com/ant-design/ant-design/issues/16503
|
|
|
|
// https://github.com/ant-design/ant-design/issues/15512
|
|
|
|
&-icon {
|
2017-04-22 01:11:18 +08:00
|
|
|
position: absolute;
|
2019-02-15 10:48:07 +08:00
|
|
|
margin-left: 4px;
|
2018-09-06 23:14:14 +08:00
|
|
|
font-size: 24px;
|
2017-09-27 22:32:49 +08:00
|
|
|
line-height: 24px;
|
2019-05-09 20:39:09 +08:00
|
|
|
}
|
2016-04-10 13:08:56 +08:00
|
|
|
|
2019-05-09 20:39:09 +08:00
|
|
|
.@{iconfont-css-prefix}&-icon {
|
2016-04-10 13:08:56 +08:00
|
|
|
&-success {
|
|
|
|
color: @success-color;
|
2015-07-28 15:40:28 +08:00
|
|
|
}
|
2021-10-13 15:38:59 +08:00
|
|
|
|
2016-04-10 13:08:56 +08:00
|
|
|
&-info {
|
2017-03-23 13:57:14 +08:00
|
|
|
color: @info-color;
|
2015-07-28 15:40:28 +08:00
|
|
|
}
|
2021-10-13 15:38:59 +08:00
|
|
|
|
2016-04-10 13:08:56 +08:00
|
|
|
&-warning {
|
|
|
|
color: @warning-color;
|
|
|
|
}
|
2021-10-13 15:38:59 +08:00
|
|
|
|
2016-04-10 13:08:56 +08:00
|
|
|
&-error {
|
|
|
|
color: @error-color;
|
2015-07-28 15:40:28 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&-close {
|
|
|
|
position: absolute;
|
2017-10-11 12:01:27 +08:00
|
|
|
top: 16px;
|
2019-02-15 10:48:07 +08:00
|
|
|
right: 22px;
|
2016-11-08 20:45:56 +08:00
|
|
|
color: @text-color-secondary;
|
2015-07-28 15:40:28 +08:00
|
|
|
outline: none;
|
2017-11-06 21:28:51 +08:00
|
|
|
|
2016-08-28 17:16:43 +08:00
|
|
|
&:hover {
|
2019-12-02 13:23:30 +08:00
|
|
|
& when (@theme = dark) {
|
|
|
|
color: fade(@white, 85%);
|
|
|
|
}
|
2019-12-03 15:39:32 +08:00
|
|
|
& when not (@theme = dark) {
|
|
|
|
color: shade(@text-color-secondary, 40%);
|
|
|
|
}
|
2016-08-28 17:16:43 +08:00
|
|
|
}
|
2015-07-28 15:40:28 +08:00
|
|
|
}
|
2015-08-04 15:16:10 +08:00
|
|
|
|
2016-04-10 13:08:56 +08:00
|
|
|
&-btn {
|
2015-07-28 15:40:28 +08:00
|
|
|
float: right;
|
|
|
|
margin-top: 16px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-26 19:32:55 +08:00
|
|
|
.notification-fade-effect {
|
2016-01-18 14:19:09 +08:00
|
|
|
animation-duration: 0.24s;
|
2015-08-12 18:08:06 +08:00
|
|
|
animation-timing-function: @ease-in-out;
|
2019-02-15 10:48:07 +08:00
|
|
|
animation-fill-mode: both;
|
2015-08-12 18:08:06 +08:00
|
|
|
}
|
|
|
|
|
2015-11-26 19:32:55 +08:00
|
|
|
&-fade-enter,
|
|
|
|
&-fade-appear {
|
2015-08-24 00:50:22 +08:00
|
|
|
.notification-fade-effect();
|
2019-04-15 10:52:00 +08:00
|
|
|
|
2021-02-23 10:45:11 +08:00
|
|
|
opacity: 0;
|
2015-08-12 18:08:06 +08:00
|
|
|
animation-play-state: paused;
|
2015-07-28 15:40:28 +08:00
|
|
|
}
|
|
|
|
|
2015-08-12 18:08:06 +08:00
|
|
|
&-fade-leave {
|
2015-08-24 00:50:22 +08:00
|
|
|
.notification-fade-effect();
|
2019-04-15 10:52:00 +08:00
|
|
|
|
2016-01-18 14:19:09 +08:00
|
|
|
animation-duration: 0.2s;
|
2015-08-12 18:08:06 +08:00
|
|
|
animation-play-state: paused;
|
2015-07-28 15:40:28 +08:00
|
|
|
}
|
|
|
|
|
2015-11-26 19:32:55 +08:00
|
|
|
&-fade-enter&-fade-enter-active,
|
|
|
|
&-fade-appear&-fade-appear-active {
|
2015-08-12 18:08:06 +08:00
|
|
|
animation-name: NotificationFadeIn;
|
|
|
|
animation-play-state: running;
|
2015-07-28 15:40:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-fade-leave&-fade-leave-active {
|
2015-08-12 18:08:06 +08:00
|
|
|
animation-name: NotificationFadeOut;
|
|
|
|
animation-play-state: running;
|
|
|
|
}
|
2015-11-26 19:32:55 +08:00
|
|
|
}
|
2015-08-12 18:08:06 +08:00
|
|
|
|
2015-11-26 19:32:55 +08:00
|
|
|
@keyframes NotificationFadeIn {
|
|
|
|
0% {
|
2016-04-27 20:44:36 +08:00
|
|
|
left: @notification-width;
|
2019-02-15 10:48:07 +08:00
|
|
|
opacity: 0;
|
2015-11-26 19:32:55 +08:00
|
|
|
}
|
2021-10-13 15:38:59 +08:00
|
|
|
|
2015-11-26 19:32:55 +08:00
|
|
|
100% {
|
|
|
|
left: 0;
|
|
|
|
opacity: 1;
|
2015-08-12 18:08:06 +08:00
|
|
|
}
|
2015-11-26 19:32:55 +08:00
|
|
|
}
|
2015-08-12 18:08:06 +08:00
|
|
|
|
2017-01-27 17:12:25 +08:00
|
|
|
@keyframes NotificationLeftFadeIn {
|
|
|
|
0% {
|
|
|
|
right: @notification-width;
|
2019-02-15 10:48:07 +08:00
|
|
|
opacity: 0;
|
2017-01-27 17:12:25 +08:00
|
|
|
}
|
2021-10-13 15:38:59 +08:00
|
|
|
|
2017-01-27 17:12:25 +08:00
|
|
|
100% {
|
|
|
|
right: 0;
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-26 19:32:55 +08:00
|
|
|
@keyframes NotificationFadeOut {
|
|
|
|
0% {
|
2019-02-15 10:48:07 +08:00
|
|
|
max-height: 150px;
|
2016-04-27 20:44:36 +08:00
|
|
|
margin-bottom: @notification-margin-bottom;
|
2019-02-15 10:48:07 +08:00
|
|
|
opacity: 1;
|
2015-11-26 19:32:55 +08:00
|
|
|
}
|
2021-10-13 15:38:59 +08:00
|
|
|
|
2015-11-26 19:32:55 +08:00
|
|
|
100% {
|
2019-02-15 10:48:07 +08:00
|
|
|
max-height: 0;
|
2015-11-26 19:32:55 +08:00
|
|
|
margin-bottom: 0;
|
|
|
|
padding-top: 0;
|
|
|
|
padding-bottom: 0;
|
2019-02-15 10:48:07 +08:00
|
|
|
opacity: 0;
|
2015-07-28 15:40:28 +08:00
|
|
|
}
|
2015-08-04 15:16:10 +08:00
|
|
|
}
|
2020-04-13 15:45:49 +08:00
|
|
|
|
|
|
|
@import './rtl';
|