@@ -38,7 +38,8 @@ export class UUIToastNotificationElement extends LitElement {
38
38
height: 0;
39
39
pointer-events: none;
40
40
41
- transition: height 480ms ease-in-out;
41
+ transition: height
42
+ var(--uui-toast-notification-animation-duration, 480ms) ease-in-out;
42
43
}
43
44
:host([is-open]) {
44
45
pointer-events: all;
@@ -74,7 +75,8 @@ export class UUIToastNotificationElement extends LitElement {
74
75
border-radius: calc(var(--uui-border-radius) * 2);
75
76
76
77
opacity: 0;
77
- transition: opacity 480ms;
78
+ transition: opacity
79
+ var(--uui-toast-notification-animation-duration, 480ms);
78
80
}
79
81
:host([is-open]) #toast > div {
80
82
opacity: 1;
@@ -230,6 +232,17 @@ export class UUIToastNotificationElement extends LitElement {
230
232
demandCustomElement ( this , 'uui-icon' ) ;
231
233
}
232
234
235
+ private _getAnimationDuration ( ) : number {
236
+ return (
237
+ parseInt (
238
+ getComputedStyle ( this ) . getPropertyValue (
239
+ '--uui-toast-notification-animation-duration'
240
+ ) ,
241
+ 10
242
+ ) || 480
243
+ ) ;
244
+ }
245
+
233
246
private _requestAnimationUpdate = 0 ;
234
247
private _makeOpen ( ) {
235
248
if ( this . _open === true ) {
@@ -265,7 +278,7 @@ export class UUIToastNotificationElement extends LitElement {
265
278
new UUIToastNotificationEvent ( UUIToastNotificationEvent . OPENED )
266
279
) ;
267
280
}
268
- } , 480 ) ;
281
+ } , this . _getAnimationDuration ( ) ) ;
269
282
} ) ;
270
283
} ) ;
271
284
}
@@ -312,7 +325,7 @@ export class UUIToastNotificationElement extends LitElement {
312
325
this . parentNode . removeChild ( this ) ;
313
326
}
314
327
}
315
- } , 480 ) ;
328
+ } , this . _getAnimationDuration ( ) ) ;
316
329
} ) ;
317
330
}
318
331
}
0 commit comments