2017-10-13 02:53:33 +08:00
|
|
|
@import "../../stylesheets/variables/_all";
|
|
|
|
|
2018-10-19 04:37:14 +08:00
|
|
|
:root {
|
|
|
|
--toast-default-color: var(--color-white);
|
|
|
|
--toast-default-bg: var(--color-gray);
|
2017-10-13 02:53:33 +08:00
|
|
|
|
2018-10-19 04:37:14 +08:00
|
|
|
--toast-info-color: var(--color-white);
|
|
|
|
--toast-info-bg: var(--color-primary);
|
2017-10-13 02:53:33 +08:00
|
|
|
|
2018-10-19 04:37:14 +08:00
|
|
|
--toast-success-color: var(--color-white);
|
|
|
|
--toast-success-bg: var(--color-success);
|
2017-10-13 02:53:33 +08:00
|
|
|
|
2018-10-19 04:37:14 +08:00
|
|
|
--toast-error-color: var(--color-white);
|
|
|
|
--toast-error-bg: var(--color-danger);
|
2017-10-13 02:53:33 +08:00
|
|
|
|
2018-10-19 04:37:14 +08:00
|
|
|
--toast-warning-color: var(--color-white);
|
|
|
|
--toast-warning-bg: var(--color-warning);
|
2017-10-13 02:53:33 +08:00
|
|
|
|
2018-10-19 04:37:14 +08:00
|
|
|
--background: var(--color-white);
|
|
|
|
--background-active: #eee;
|
2019-03-12 22:35:19 +08:00
|
|
|
|
|
|
|
--toast-offset: 4.5rem;
|
2019-04-04 23:29:46 +08:00
|
|
|
--toast-offset-sm: .325rem;
|
2019-03-12 22:35:19 +08:00
|
|
|
--toast-mobile-width: 75%;
|
2019-04-04 23:29:46 +08:00
|
|
|
|
|
|
|
--toast-max-width: 20rem !important;
|
|
|
|
--toast-body-max-width: 17.75rem !important;
|
|
|
|
--toast-container-max-width: 23rem !important;
|
|
|
|
--toast-container-min-width: var(--toast-max-width);
|
|
|
|
|
|
|
|
--toast-icon-md: 2rem;
|
|
|
|
--toast-icon-sm: 1.2rem;
|
2018-10-19 04:37:14 +08:00
|
|
|
}
|
2017-10-13 02:53:33 +08:00
|
|
|
|
|
|
|
@mixin notification-variant($icon-color, $icon-bg) {
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
> .icon {
|
|
|
|
color: $icon-color;
|
|
|
|
background-color: $icon-bg;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-13 01:21:31 +08:00
|
|
|
.toastContainer {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
|
|
|
|
.smallToastContainer {
|
2018-10-19 04:37:14 +08:00
|
|
|
background-color: inherit;
|
2018-06-13 01:21:31 +08:00
|
|
|
}
|
|
|
|
|
2017-10-13 02:53:33 +08:00
|
|
|
.icon {
|
|
|
|
align-self: flex-start;
|
2019-05-14 21:15:54 +08:00
|
|
|
margin: 0 var(--sm-padding-x) auto 0;
|
2019-04-04 23:29:46 +08:00
|
|
|
width: var(--toast-icon-md);
|
|
|
|
height: var(--toast-icon-md);
|
2017-10-13 02:53:33 +08:00
|
|
|
border-radius: 50%;
|
|
|
|
position: relative;
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
2019-05-14 21:15:54 +08:00
|
|
|
[dir="rtl"] & {
|
|
|
|
margin: 0 0 auto var(--sm-padding-x);
|
|
|
|
}
|
|
|
|
|
2017-10-13 02:53:33 +08:00
|
|
|
> i {
|
|
|
|
line-height: 0;
|
|
|
|
color: inherit;
|
|
|
|
position: absolute;
|
|
|
|
top: 50%;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-13 01:21:31 +08:00
|
|
|
.smallIcon {
|
2019-04-04 23:29:46 +08:00
|
|
|
width: var(--toast-icon-sm);
|
|
|
|
height: var(--toast-icon-sm);
|
2018-06-13 01:21:31 +08:00
|
|
|
> i {
|
|
|
|
font-size: 70%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-19 04:37:14 +08:00
|
|
|
.separator {
|
2019-04-04 23:29:46 +08:00
|
|
|
position: relative;
|
|
|
|
width: 100%;
|
|
|
|
height: var(--border-size-small);
|
2018-10-19 04:37:14 +08:00
|
|
|
background-color: var(--color-gray-lighter);
|
|
|
|
margin-top: calc(var(--line-height-computed) * .5);
|
|
|
|
margin-bottom: calc(var(--line-height-computed) * .5);
|
2018-06-13 01:21:31 +08:00
|
|
|
}
|
|
|
|
|
2017-10-13 02:53:33 +08:00
|
|
|
.message {
|
|
|
|
margin-top: auto;
|
|
|
|
margin-bottom: auto;
|
2018-10-19 04:37:14 +08:00
|
|
|
font-size: var(--font-size-small);
|
2017-10-13 02:53:33 +08:00
|
|
|
max-height: 15vh;
|
|
|
|
overflow: auto;
|
|
|
|
}
|
|
|
|
|
2018-06-13 01:21:31 +08:00
|
|
|
.smallMessage {
|
|
|
|
font-size: 80%;
|
|
|
|
}
|
|
|
|
|
2017-10-13 02:53:33 +08:00
|
|
|
.default {
|
2018-10-19 04:37:14 +08:00
|
|
|
@include notification-variant(var(--toast-default-color), var(--toast-default-bg));
|
2017-10-13 02:53:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.info {
|
2018-10-19 04:37:14 +08:00
|
|
|
@include notification-variant(var(--toast-info-color), var(--toast-info-bg));
|
2017-10-13 02:53:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.success {
|
2018-10-19 04:37:14 +08:00
|
|
|
@include notification-variant(var(--toast-success-color), var(--toast-success-bg));
|
2017-10-13 02:53:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.error {
|
2018-10-19 04:37:14 +08:00
|
|
|
@include notification-variant(var(--toast-error-color), var(--toast-error-bg));
|
2017-10-13 02:53:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.warning {
|
2018-10-19 04:37:14 +08:00
|
|
|
@include notification-variant(var(--toast-warning-color), var(--toast-warning-bg));
|
2017-10-13 02:53:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.container {
|
2019-03-12 22:35:19 +08:00
|
|
|
z-index: 9998;
|
2017-10-13 02:53:33 +08:00
|
|
|
position: fixed;
|
2018-10-19 04:37:14 +08:00
|
|
|
padding: var(--sm-padding-y);
|
2019-04-04 23:29:46 +08:00
|
|
|
min-width: var(--toast-container-min-width);
|
|
|
|
max-width: var(--toast-container-max-width);
|
2017-10-13 02:53:33 +08:00
|
|
|
box-sizing: border-box;
|
2019-03-12 22:35:19 +08:00
|
|
|
right: var(--jumbo-padding-y);
|
2019-05-14 21:15:54 +08:00
|
|
|
left: auto;
|
2019-03-12 22:35:19 +08:00
|
|
|
top: var(--toast-offset);
|
2017-10-13 02:53:33 +08:00
|
|
|
max-height: 75vh;
|
|
|
|
overflow: hidden;
|
|
|
|
|
2019-05-14 21:15:54 +08:00
|
|
|
[dir="rtl"] & {
|
|
|
|
right: auto;
|
|
|
|
left: var(--jumbo-padding-y);
|
|
|
|
}
|
|
|
|
|
2017-10-13 02:53:33 +08:00
|
|
|
@include mq($small-only) {
|
2019-03-12 22:35:19 +08:00
|
|
|
width: var(--toast-mobile-width);
|
2017-10-13 02:53:33 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.toast {
|
|
|
|
position: relative;
|
2018-10-19 04:37:14 +08:00
|
|
|
margin-bottom: var(--sm-padding-x);
|
|
|
|
padding: var(--md-padding-x);
|
|
|
|
border-radius: var(--border-radius);
|
2019-04-04 23:29:46 +08:00
|
|
|
box-shadow: 0 var(--border-size-small) 10px 0 rgba(0, 0, 0, 0.1), 0 var(--border-size) 15px 0 rgba(0, 0, 0, 0.05);
|
2017-10-13 02:53:33 +08:00
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
cursor: pointer;
|
2018-10-19 04:37:14 +08:00
|
|
|
color: var(--color-text);
|
|
|
|
background-color: var(--background);
|
2017-10-13 02:53:33 +08:00
|
|
|
animation-duration: 0.75s;
|
|
|
|
animation-fill-mode: both;
|
2019-04-04 23:29:46 +08:00
|
|
|
max-width: var(--toast-max-width);
|
2020-02-11 02:19:49 +08:00
|
|
|
width: var(--toast-max-width);
|
2017-10-13 02:53:33 +08:00
|
|
|
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
2018-10-19 04:37:14 +08:00
|
|
|
background-color: var(--background-active);
|
2017-10-13 02:53:33 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.body {
|
2019-04-04 23:29:46 +08:00
|
|
|
margin: auto auto;
|
2017-10-13 02:53:33 +08:00
|
|
|
flex: 1;
|
2018-07-06 20:05:56 +08:00
|
|
|
background-color: inherit;
|
2019-04-04 23:29:46 +08:00
|
|
|
max-width: var(--toast-body-max-width);
|
2017-10-13 02:53:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.close {
|
|
|
|
background: transparent;
|
|
|
|
outline: none;
|
|
|
|
border: none;
|
|
|
|
cursor: pointer;
|
2018-06-13 01:21:31 +08:00
|
|
|
opacity: .5;
|
2019-04-04 23:29:46 +08:00
|
|
|
font-size: var(--font-size-smallest);
|
2018-10-19 04:37:14 +08:00
|
|
|
color: var(--color-gray-dark);
|
2017-10-13 02:53:33 +08:00
|
|
|
line-height: 0;
|
2019-04-04 23:29:46 +08:00
|
|
|
position: relative;
|
2018-06-13 01:21:31 +08:00
|
|
|
font-size: 70%;
|
2019-04-04 23:29:46 +08:00
|
|
|
left: var(--toast-offset-sm);
|
2019-05-14 21:15:54 +08:00
|
|
|
|
|
|
|
[dir="rtl"] & {
|
|
|
|
left: auto;
|
|
|
|
right: var(--toast-offset-sm);
|
|
|
|
}
|
2019-03-05 10:46:37 +08:00
|
|
|
|
2019-04-11 23:04:10 +08:00
|
|
|
:global(.animationsEnabled) & {
|
2019-03-05 10:46:37 +08:00
|
|
|
transition: .3s ease;
|
|
|
|
}
|
|
|
|
|
2017-10-13 02:53:33 +08:00
|
|
|
&:before {
|
2019-05-14 21:15:54 +08:00
|
|
|
margin: inherit inherit inherit -.4rem;
|
|
|
|
|
|
|
|
[dir="rtl"] & {
|
|
|
|
margin: inherit -.4rem inherit inherit;
|
|
|
|
}
|
2017-10-13 02:53:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
@include mq($small-only) {
|
|
|
|
position: relative;
|
2019-04-04 23:29:46 +08:00
|
|
|
font-size: var(--font-size-smaller);
|
|
|
|
left: auto;
|
2017-10-13 02:53:33 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes track-progress {
|
|
|
|
0% {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
100% {
|
|
|
|
width: 0;
|
|
|
|
}
|
|
|
|
}
|
2018-10-19 04:37:14 +08:00
|
|
|
.backgroundColorInherit {
|
2019-04-04 23:29:46 +08:00
|
|
|
position: relative;
|
2018-07-06 20:05:56 +08:00
|
|
|
}
|
2017-10-13 02:53:33 +08:00
|
|
|
|
|
|
|
.progress {
|
|
|
|
position: absolute;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
2019-05-14 21:15:54 +08:00
|
|
|
right: auto;
|
2017-10-13 02:53:33 +08:00
|
|
|
width: 0;
|
|
|
|
height: 5px;
|
|
|
|
z-index: 9999;
|
|
|
|
animation: track-progress linear 1;
|
2018-10-19 04:37:14 +08:00
|
|
|
background-color: var(--color-gray-lighter);
|
|
|
|
border-radius: var(--border-radius);
|
2019-05-14 21:15:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
[dir="rtl"] & {
|
|
|
|
left: auto;
|
|
|
|
right: 0;
|
|
|
|
}
|
2017-10-13 02:53:33 +08:00
|
|
|
}
|