-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle.scss
122 lines (109 loc) · 2.17 KB
/
style.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// Colors
$toast-colors: (
"green": (
"background": var(--toast-green-background),
"text": var(--toast-green-text),
"border": var(--toast-green-border),
),
"red": (
"background": var(--toast-red-background),
"text": var(--toast-red-text),
"border": var(--toast-red-border),
),
"other": (
"background": var(--toast-other-background),
"text": var(--toast-other-text),
"border": var(--toast-other-border),
),
);
.toast {
border-radius: 8px;
// box-shadow: rgba(0, 0, 0, 0.4) 0px 0 6px 0px,
// rgba(0, 0, 0, 0.06) 0px 0px 0px 1px;
margin: 5px;
min-width: 150px;
min-height: 50px;
padding: 8px 5px;
display: flex;
justify-content: space-between;
align-items: center;
backdrop-filter: blur(5px);
will-change: transform;
font-size: 16px;
@media (max-width: 768px) {
font-size: 12px;
padding: 6px 3px;
}
&__wrapper {
transform-origin: top;
width: fit-content;
overflow: hidden;
}
@each $name, $colors in $toast-colors {
&.#{$name} {
background-color: map-get($colors, "background");
color: map-get($colors, "text");
border: map-get($colors, "border");
.toast__icon {
color: map-get($colors, "text");
}
}
}
&.loading {
will-change: transform;
@keyframes rotate {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(359deg);
}
}
.toast__icon {
animation: rotate 4s linear infinite;
}
}
span {
display: flex;
&.toast__icon {
margin-left: 7px;
svg {
height: 25px;
width: auto;
}
}
&:not(.toast__icon) {
padding: 0 10px;
}
}
&-container {
z-index: 999;
position: fixed;
bottom: 0;
right: 0;
padding: 20px;
display: flex;
flex-direction: column;
width: fit-content;
align-items: flex-end;
@media (max-width: 768px) {
padding: 10px;
}
&.toast-bottom {
top: unset;
bottom: 0;
}
&.toast-top {
bottom: unset;
top: 0;
}
&.toast-left {
right: unset;
left: 0;
}
&.toast-right {
left: unset;
right: 0;
}
}
}