2019-04-30 11:11:25 +08:00
|
|
|
@keyframes bounceIn {
|
2019-12-06 09:58:08 +08:00
|
|
|
from,
|
|
|
|
20%,
|
|
|
|
40%,
|
|
|
|
60%,
|
|
|
|
80%,
|
|
|
|
to {
|
|
|
|
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
0% {
|
|
|
|
opacity: 0;
|
|
|
|
transform: scale3d(0.3, 0.3, 0.3);
|
|
|
|
}
|
|
|
|
|
|
|
|
20% {
|
|
|
|
transform: scale3d(1.1, 1.1, 1.1);
|
|
|
|
}
|
|
|
|
|
|
|
|
40% {
|
|
|
|
transform: scale3d(0.9, 0.9, 0.9);
|
|
|
|
}
|
|
|
|
|
|
|
|
60% {
|
|
|
|
opacity: 1;
|
|
|
|
transform: scale3d(1.03, 1.03, 1.03);
|
|
|
|
}
|
|
|
|
|
|
|
|
80% {
|
|
|
|
transform: scale3d(0.97, 0.97, 0.97);
|
|
|
|
}
|
|
|
|
|
|
|
|
to {
|
|
|
|
opacity: 1;
|
|
|
|
transform: scale3d(1, 1, 1);
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes bounceOut {
|
2019-12-06 09:58:08 +08:00
|
|
|
20% {
|
|
|
|
transform: scale3d(0.9, 0.9, 0.9);
|
|
|
|
}
|
2019-05-15 16:10:20 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
50%,
|
|
|
|
55% {
|
|
|
|
opacity: 1;
|
|
|
|
transform: scale3d(1.1, 1.1, 1.1);
|
|
|
|
}
|
2019-05-15 16:10:20 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
to {
|
|
|
|
opacity: 0;
|
|
|
|
transform: scale3d(0.3, 0.3, 0.3);
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.#{$ns}Toast {
|
2019-12-06 09:58:08 +08:00
|
|
|
&-wrap {
|
|
|
|
pointer-events: none;
|
|
|
|
position: fixed;
|
|
|
|
z-index: $zindex-toast;
|
|
|
|
}
|
|
|
|
|
2020-12-21 10:08:40 +08:00
|
|
|
width: var(--Toast-width);
|
2019-12-06 09:58:08 +08:00
|
|
|
pointer-events: auto;
|
2020-12-21 10:08:40 +08:00
|
|
|
margin-bottom: var(--gap-xs);
|
2020-06-09 14:44:38 +08:00
|
|
|
|
2020-12-21 16:12:28 +08:00
|
|
|
@if $Toast-icon-fillHeight {
|
2020-12-21 10:08:40 +08:00
|
|
|
padding: var(--Toast-paddingY)
|
|
|
|
var(--Toast-paddingX)
|
|
|
|
var(--Toast-paddingY)
|
|
|
|
calc(var(--Toast-paddingX) + var(--Toast-paddingL));
|
2020-06-09 14:44:38 +08:00
|
|
|
} @else {
|
2020-12-21 10:08:40 +08:00
|
|
|
padding: var(--Toast-paddingY) var(--Toast-paddingX);
|
2020-06-09 14:44:38 +08:00
|
|
|
}
|
|
|
|
|
2020-12-21 10:08:40 +08:00
|
|
|
box-shadow: var(--Toast-box-shadow);
|
|
|
|
border-radius: var(--Toast-borderRadius);
|
|
|
|
border: var(--Toast-border-width) solid;
|
|
|
|
color: var(--Toast-color);
|
2019-12-06 09:58:08 +08:00
|
|
|
position: relative;
|
2020-12-21 10:08:40 +08:00
|
|
|
opacity: var(--Toast-opacity);
|
2019-12-06 09:58:08 +08:00
|
|
|
cursor: pointer;
|
|
|
|
opacity: 0;
|
|
|
|
transform: translateZ(0);
|
|
|
|
|
|
|
|
&.in,
|
|
|
|
&.out {
|
|
|
|
animation-fill-mode: both;
|
2021-01-04 16:45:43 +08:00
|
|
|
animation-duration: var(--animation-duration);
|
2019-12-06 09:58:08 +08:00
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.in {
|
|
|
|
animation-name: bounceIn;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.out {
|
|
|
|
animation-name: bounceOut;
|
|
|
|
}
|
|
|
|
|
2019-12-29 10:48:53 +08:00
|
|
|
&-close {
|
|
|
|
position: absolute;
|
2020-12-21 10:08:40 +08:00
|
|
|
top: var(--gap-xs);
|
|
|
|
right: var(--gap-sm);
|
|
|
|
color: var(--Toast-close-color);
|
2019-12-29 10:48:53 +08:00
|
|
|
line-height: 1;
|
|
|
|
opacity: 0.8;
|
|
|
|
|
|
|
|
&:hover {
|
2020-12-21 10:08:40 +08:00
|
|
|
color: var(--Toast-close--onHover-color);
|
2019-12-29 10:48:53 +08:00
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&-title {
|
2020-12-21 10:08:40 +08:00
|
|
|
display: var(--Toast-title-display);
|
|
|
|
margin-right: var(--gap-base);
|
|
|
|
font-size: var(--fontSizeMd);
|
2020-06-09 14:44:38 +08:00
|
|
|
vertical-align: middle;
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-body {
|
2020-12-21 10:08:40 +08:00
|
|
|
display: var(--Toast-title-display);
|
2020-06-09 14:44:38 +08:00
|
|
|
vertical-align: middle;
|
2021-01-07 23:32:07 +08:00
|
|
|
white-space: pre-wrap;
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
2020-06-09 14:44:38 +08:00
|
|
|
&-icon {
|
|
|
|
display: inline-flex;
|
2019-12-06 09:58:08 +08:00
|
|
|
text-rendering: auto;
|
|
|
|
-webkit-font-smoothing: antialiased;
|
2020-06-09 14:44:38 +08:00
|
|
|
vertical-align: middle;
|
|
|
|
|
2020-12-21 16:12:28 +08:00
|
|
|
@if $Toast-icon-fillHeight {
|
2020-06-09 14:44:38 +08:00
|
|
|
position: absolute;
|
2020-12-21 10:08:40 +08:00
|
|
|
left: var(--Toast-paddingX);
|
|
|
|
top: var(--Toast-paddingY);
|
|
|
|
width: calc(var(--Toast-paddingL) - var(--Toast-paddingX));
|
|
|
|
height: calc(var(--Toast-paddingL) - var(--Toast-paddingX));
|
2020-06-09 14:44:38 +08:00
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
} @else {
|
2020-12-21 10:08:40 +08:00
|
|
|
margin-right: var(--gap-xs);
|
2020-06-09 14:44:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
> svg {
|
|
|
|
top: 0;
|
2020-12-21 10:08:40 +08:00
|
|
|
width: var(--Toast-icon-width);
|
|
|
|
height: var(--Toast-icon-height);
|
2020-06-09 14:44:38 +08:00
|
|
|
color: inherit;
|
|
|
|
}
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// colors
|
|
|
|
&--error {
|
2020-12-21 10:08:40 +08:00
|
|
|
color: var(--Toast--danger-color);
|
|
|
|
border-color: var(--Toast--danger-borderColor);
|
|
|
|
background: var(--Toast--danger-bgColor);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&--warning {
|
2020-12-21 10:08:40 +08:00
|
|
|
color: var(--Toast--warning-color);
|
|
|
|
border-color: var(--Toast--warning-borderColor);
|
|
|
|
background: var(--Toast--warning-bgColor);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&--info {
|
2020-12-21 10:08:40 +08:00
|
|
|
color: var(--Toast--info-color);
|
|
|
|
border-color: var(--Toast--info-borderColor);
|
|
|
|
background: var(--Toast--info-bgColor);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&--success {
|
2020-12-21 10:08:40 +08:00
|
|
|
color: var(--Toast--success-color);
|
|
|
|
border-color: var(--Toast--success-borderColor);
|
|
|
|
background: var(--Toast--success-bgColor);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// positions
|
|
|
|
&-wrap--topRight {
|
2020-12-21 10:08:40 +08:00
|
|
|
top: var(--gap-base);
|
|
|
|
right: var(--gap-base);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-wrap--topCenter {
|
2020-12-21 10:08:40 +08:00
|
|
|
top: var(--gap-base);
|
2019-12-06 09:58:08 +08:00
|
|
|
left: 50%;
|
2020-12-21 10:08:40 +08:00
|
|
|
margin-left: calc(var(--Toast-width) / -2);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-wrap--topLeft {
|
2020-12-21 10:08:40 +08:00
|
|
|
top: var(--gap-base);
|
|
|
|
left: var(--gap-base);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-wrap--bottomLeft {
|
2020-12-21 10:08:40 +08:00
|
|
|
left: var(--gap-base);
|
|
|
|
bottom: var(--gap-base);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-wrap--bottomCenter {
|
|
|
|
left: 50%;
|
2020-12-21 10:08:40 +08:00
|
|
|
margin-left: calc(var(--Toast-width) / -2);
|
|
|
|
bottom: var(--gap-base);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-wrap--bottomRight {
|
2020-12-21 10:08:40 +08:00
|
|
|
bottom: var(--gap-base);
|
|
|
|
right: var(--gap-base);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
}
|