ant-design/components/notification/style/index.less

150 lines
2.8 KiB
Plaintext
Raw Normal View History

@import "../../style/themes/default";
@import "../../style/mixins/index";
2015-07-28 15:40:28 +08:00
@notification-prefix-cls: ant-notification;
@notification-width: 335px;
@notification-padding: 16px;
@notification-margin-bottom: 10px;
2015-07-28 15:40:28 +08:00
2015-08-20 16:55:42 +08:00
.@{notification-prefix-cls} {
2015-07-28 15:40:28 +08:00
position: fixed;
2016-03-28 16:01:37 +08:00
z-index: @zindex-notification;
width: @notification-width;
2015-08-03 15:17:12 +08:00
margin-right: 24px;
2015-07-28 15:40:28 +08:00
&-notice {
padding: @notification-padding;
2015-07-28 15:40:28 +08:00
border-radius: @border-radius-base;
2016-04-17 18:19:22 +08:00
box-shadow: @shadow-2;
2015-12-28 11:42:53 +08:00
border: 1px solid @border-color-base;
2016-07-21 15:02:24 +08:00
background: #fff;
2015-07-28 15:40:28 +08:00
line-height: 1.5;
position: relative;
margin-bottom: @notification-margin-bottom;
2015-07-28 15:40:28 +08:00
overflow: hidden;
2016-04-10 13:08:56 +08:00
&-message {
font-size: 14px;
color: @text-color;
margin-bottom: 4px;
}
&-description {
font-size: @font-size-base;
color: @legend-color;
}
&-with-icon &-message {
font-size: 14px;
color: @text-color;
margin-left: 51px;
margin-bottom: 4px;
2015-07-28 15:40:28 +08:00
}
2016-04-10 13:08:56 +08:00
&-with-icon &-description {
margin-left: 51px;
font-size: @font-size-base;
color: @legend-color;
}
&-icon {
position: absolute;
left: 16px;
top: 50%;
margin-top: -17px;
font-size: 34px;
&-success {
color: @success-color;
2015-07-28 15:40:28 +08:00
}
2016-04-10 13:08:56 +08:00
&-info {
color: @primary-color;
2015-07-28 15:40:28 +08:00
}
2016-04-10 13:08:56 +08:00
&-warning {
color: @warning-color;
}
&-error {
color: @error-color;
2015-07-28 15:40:28 +08:00
}
}
2015-07-29 20:08:16 +08:00
&-close-x:after {
font-size: 12px;
2015-11-12 22:59:25 +08:00
content: "\e62d";
2015-07-28 15:40:28 +08:00
font-family: "anticon";
cursor: pointer;
}
&-close {
position: absolute;
right: 16px;
top: 10px;
color: #999;
outline: none;
}
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-fill-mode: both;
animation-timing-function: @ease-in-out;
}
2015-11-26 19:32:55 +08:00
&-fade-enter,
&-fade-appear {
2015-07-28 15:40:28 +08:00
opacity: 0;
2015-08-24 00:50:22 +08:00
.notification-fade-effect();
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();
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% {
opacity: 0;
left: @notification-width;
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
2015-11-26 19:32:55 +08:00
@keyframes NotificationFadeOut {
0% {
opacity: 1;
margin-bottom: @notification-margin-bottom;
padding-top: @notification-padding;
padding-bottom: @notification-padding;
2015-11-26 19:32:55 +08:00
max-height: 150px;
}
100% {
opacity: 0;
margin-bottom: 0;
padding-top: 0;
padding-bottom: 0;
max-height: 0;
2015-07-28 15:40:28 +08:00
}
2015-08-04 15:16:10 +08:00
}