UNPKG

7.87 kBSCSSView Raw
1@import "../node_modules/tinper-bee-core/scss/minxin-variables";
2@import "../node_modules/tinper-bee-core/scss/minxin-mixins";
3@import "../node_modules/bee-icon/src/Icon.scss";
4
5$zIndex-message: 2000;
6$message-background: #f7f9fb;
7$message-content-padding: 11px 64px 11px 4px;
8.u-message {
9 font-size: $message-font-size;
10 position: fixed;
11 z-index: $zIndex-message;
12 &-topLeft, &-topRight, &-bottomLeft, &-bottomRight {
13 .u-message-notice-description-content{
14 min-width: 132px;
15 }
16 }
17
18 &-notice {
19 position: relative;
20 padding: $message-padding;
21 // @include shadow-3dp();
22 box-shadow:0 4px 12px rgba(20, 27, 53, .2);
23 border: 1px solid #DFE1E6;
24 border-radius: $border-radius-base;
25 box-sizing: border-box;
26 background: $message-background;
27 line-height: 1.5;
28 overflow: hidden;
29 color: $font-color-base;
30 &-description {
31 font-size: 12px;
32 word-wrap: break-word;
33 vertical-align: middle;
34 &-content {
35 min-width: 250px;
36 max-width: 610px;
37 display: inline-block;
38 padding: $message-content-padding;
39 margin-left: 40px;
40 }
41 &-icon{
42 position: absolute;
43 top: 0;
44 left: 0;
45 display: inline-block;
46 padding-left: 12px;
47 padding-right: 4px;
48 text-align: center;
49 background-color: #000;
50 .uf {
51 font-size: 24px;
52 line-height: 40px;
53 padding: 0;
54 }
55 }
56 }
57
58 &-close {
59 position: absolute;
60 right: 14px;
61 top: 14px;
62 cursor: pointer;
63 outline: none;
64 font-size: 12px;
65 font-weight: 700;
66 line-height: 1;
67 text-shadow: 0 1px 0 #fff;
68 text-decoration: none;
69
70 &-x .uf {
71 font-size: 12px;
72 padding: 0;
73 }
74
75 &:hover {
76 opacity: 1;
77 filter: alpha(opacity=100);
78 text-decoration: none;
79 }
80
81 }
82 }
83
84 &-notice-dark {
85 background-color: #344563;
86 border-color: #344563;
87 color: #fff;
88 .u-message-notice-description-icon{
89 background-color: #344563;
90 }
91 }
92
93 &-notice-light {
94 background-color: #f7f9fb;
95 border-color: #DFE1E6;
96 color: #54698D;
97 .u-message-notice-description-icon{
98 background-color: #f7f9fb;
99 }
100 .u-message-notice-description-content{
101 color: $font-color-base;
102 }
103 }
104 &-notice-success {
105 background-color: $brand-success;
106 color: #fff;
107 border-color: $brand-success;
108 .u-message-notice-description-icon{
109 background-color: $brand-success;
110 }
111 }
112 &-notice-danger {
113 background-color: $brand-danger;
114 color: #fff;
115 border-color: $brand-danger;
116 .u-message-notice-description-icon{
117 background-color: $brand-danger;
118 }
119 }
120 &-notice-info {
121 background-color: $brand-info;
122 color: #fff;
123 border-color: $brand-info;
124 .u-message-notice-description-icon{
125 background-color: $brand-info;
126 }
127 }
128 &-notice-warning {
129 background-color:$brand-warning;
130 color: #fff;
131 border-color: $brand-warning;
132 .u-message-notice-description-icon{
133 background-color: $brand-warning;
134 }
135 }
136 &-notice-successlight {
137 background-color: $brand-light-success;
138 color: #000;
139 border-color: #42C556;
140 .u-message-notice-description-icon{
141 background-color: $brand-light-success;
142 color: $brand-success;
143 }
144 }
145 &-notice-dangerlight {
146 background-color: $brand-light-danger;
147 color: #000;
148 border-color: #FE8196;
149 .u-message-notice-description-icon{
150 background-color: $brand-light-danger;
151 color: $brand-danger;
152 }
153 }
154 &-notice-infolight {
155 background-color: $brand-light-info;
156 color: #000;
157 border-color: #4DD0E1;
158 .u-message-notice-description-icon{
159 background-color: $brand-light-info;
160 color: $brand-info;
161 }
162 }
163 &-notice-warninglight {
164 background-color: $brand-light-warning;
165 color: #000;
166 border-color: #FA9B36;
167 .u-message-notice-description-icon{
168 background-color: $brand-light-warning;
169 color: $brand-warning;
170 }
171 }
172
173}
174 .message-fade-effect {
175 animation-duration: 0.24s;
176 animation-fill-mode: both;
177 animation-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1);
178 }
179
180 .u-message-left-enter,
181 .u-message-left-appear,.u-message-right-enter,
182 .u-message-right-appear,.u-message-top-enter,
183 .u-message-top-appear,.u-message-bottom-enter,
184 .u-message-bottom-appear {
185 opacity: 0;
186 @extend .message-fade-effect;
187 animation-play-state: paused;
188 }
189
190 .u-message-left-leave,
191 .u-message-right-leave,
192 .u-message-top-leave,
193 .u-message-bottom-leave {
194 @extend .message-fade-effect;
195 animation-duration: 0.2s;
196 animation-play-state: paused;
197 }
198
199
200 .u-message-left-enter.u-message-left-enter-active,
201 .u-message-left-appear.u-message-left-appear-active {
202 animation-name: uMessageLeftIn;
203 animation-play-state: running;
204 }
205
206 .u-message-left-leave.u-message-left-leave-active {
207 animation-name: uMessageFadeOut;
208 animation-play-state: running;
209 }
210 .u-message-right-enter.u-message-right-enter-active,
211 .u-message-right-appear.u-message-right-appear-active {
212 animation-name: uMessageRightIn;
213 animation-play-state: running;
214 }
215
216 .u-message-right-leave.u-message-right-leave-active {
217 animation-name: uMessageFadeOut;
218 animation-play-state: running;
219 }
220 .u-message-top-enter.u-message-top-enter-active,
221 .u-message-top-appear.u-message-top-appear-active {
222 animation-name: uMessageMoveUp;
223 animation-play-state: running;
224 }
225
226 .u-message-top-leave.u-message-top-leave-active {
227 animation-name: uMessageFadeOut;
228 animation-play-state: running;
229 }
230 .u-message-bottom-enter.u-message-bottom-enter-active,
231 .u-message-bottom-appear.u-message-bottom-appear-active {
232 animation-name: uMessageMoveDown;
233 animation-play-state: running;
234 }
235
236 .u-message-bottom-leave.u-message-bottom-leave-active {
237 animation-name: uMessageFadeOut;
238 animation-play-state: running;
239 }
240 @keyframes uMessageLeftIn {
241 0% {
242 opacity: 0;
243 right: 30px;
244 }
245 100% {
246 right: 0;
247 opacity: 1;
248 }
249 }
250 @keyframes uMessageRightIn {
251 0% {
252 opacity: 0;
253 left:30px;
254 }
255 100% {
256 left: 0;
257 opacity: 1;
258 }
259 }
260 @keyframes uMessageMoveUp {
261 0% {
262 opacity: 0;
263 top: -30px;
264 }
265 100% {
266 top: 0;
267 opacity: 1;
268 }
269 }
270 @keyframes uMessageMoveDown {
271 0% {
272 opacity: 0;
273 bottom: -78px;
274 }
275 100% {
276 bottom: 0;
277 opacity: 1;
278 }
279 }
280
281
282 @keyframes uMessageFadeOut {
283 0% {
284 opacity: 1;
285 padding-top: $message-padding;
286 padding-bottom: $message-padding;
287 max-height: 150px;
288 }
289 100% {
290 opacity: 0;
291 padding-top: 0;
292 padding-bottom: 0;
293 max-height: 0;
294 }
295 }