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;
|
|
|
|
}
|
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
|
|
|
margin: -.35rem;
|
|
|
|
}
|
|
|
|
|
2017-10-13 02:53:33 +08:00
|
|
|
.icon {
|
|
|
|
align-self: flex-start;
|
|
|
|
margin-bottom: auto;
|
2018-10-19 04:37:14 +08:00
|
|
|
margin-right: var(--sm-padding-x);
|
2017-10-13 02:53:33 +08:00
|
|
|
width: 2rem;
|
|
|
|
border-radius: 50%;
|
|
|
|
position: relative;
|
|
|
|
height: 2rem;
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
|
|
> i {
|
|
|
|
line-height: 0;
|
|
|
|
color: inherit;
|
|
|
|
position: absolute;
|
|
|
|
top: 50%;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-13 01:21:31 +08:00
|
|
|
.smallIcon {
|
|
|
|
width: 1.2rem;
|
|
|
|
height: 1.2rem;
|
|
|
|
> i {
|
|
|
|
font-size: 70%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-19 04:37:14 +08:00
|
|
|
.separator {
|
2018-06-13 01:21:31 +08:00
|
|
|
height: 1px;
|
|
|
|
width: 99%;
|
|
|
|
position: absolute;
|
|
|
|
margin-left: -.5em;
|
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
|
|
|
@include mq($small-only) {
|
|
|
|
position: relative;
|
|
|
|
margin-left: auto;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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 {
|
|
|
|
z-index: 9999;
|
|
|
|
position: fixed;
|
2018-10-19 04:37:14 +08:00
|
|
|
padding: var(--sm-padding-y);
|
2017-10-13 02:53:33 +08:00
|
|
|
width: 15vw;
|
|
|
|
min-width: 320px;
|
|
|
|
box-sizing: border-box;
|
2018-10-19 04:37:14 +08:00
|
|
|
top: var(--md-padding-y);
|
|
|
|
right: var(--md-padding-y);
|
2017-10-13 02:53:33 +08:00
|
|
|
max-height: 75vh;
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
@include mq($small-only) {
|
2018-10-19 04:37:14 +08:00
|
|
|
left: var(--sm-padding-y);
|
2017-10-13 02:53:33 +08:00
|
|
|
width: auto;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.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);
|
2017-10-13 02:53:33 +08:00
|
|
|
box-shadow: 0 1px 10px 0 rgba(0, 0, 0, 0.1), 0 2px 15px 0 rgba(0, 0, 0, 0.05);
|
|
|
|
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;
|
|
|
|
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
2018-10-19 04:37:14 +08:00
|
|
|
background-color: var(--background-active);
|
2017-10-13 02:53:33 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.body {
|
|
|
|
margin: auto 0;
|
|
|
|
flex: 1;
|
2018-07-06 20:05:56 +08:00
|
|
|
background-color: inherit;
|
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;
|
2017-10-13 02:53:33 +08:00
|
|
|
font-size: .35rem;
|
2018-10-19 04:37:14 +08:00
|
|
|
color: var(--color-gray-dark);
|
2017-10-13 02:53:33 +08:00
|
|
|
padding: .4rem;
|
|
|
|
line-height: 0;
|
|
|
|
position: absolute;
|
2018-10-19 04:37:14 +08:00
|
|
|
top: var(--md-padding-y);
|
|
|
|
right: var(--md-padding-y);
|
2018-06-13 01:21:31 +08:00
|
|
|
font-size: 70%;
|
2018-10-19 04:37:14 +08:00
|
|
|
top: var(--lg-padding-y);
|
2019-03-05 10:46:37 +08:00
|
|
|
|
|
|
|
[style~="--enableAnimation:1;"] & {
|
|
|
|
transition: .3s ease;
|
|
|
|
}
|
|
|
|
|
2017-10-13 02:53:33 +08:00
|
|
|
&:before {
|
|
|
|
margin-left: -.2rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
@include mq($small-only) {
|
|
|
|
position: relative;
|
|
|
|
top: auto;
|
|
|
|
right: auto;
|
|
|
|
align-self: flex-start;
|
|
|
|
margin-top: auto;
|
|
|
|
margin-bottom: auto;
|
2018-10-19 04:37:14 +08:00
|
|
|
margin-left: var(--sm-padding-x);
|
2017-10-13 02:53:33 +08:00
|
|
|
font-size: 1rem;
|
|
|
|
line-height: 1;
|
|
|
|
border: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes track-progress {
|
|
|
|
0% {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
100% {
|
|
|
|
width: 0;
|
|
|
|
}
|
|
|
|
}
|
2018-10-19 04:37:14 +08:00
|
|
|
.backgroundColorInherit {
|
2018-07-06 20:05:56 +08:00
|
|
|
background-color: inherit;
|
|
|
|
}
|
2017-10-13 02:53:33 +08:00
|
|
|
|
|
|
|
.progress {
|
|
|
|
position: absolute;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
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);
|
2017-10-13 02:53:33 +08:00
|
|
|
}
|