Skip to content

Commit 3d2bff6

Browse files
committed
wip
1 parent 0416e2a commit 3d2bff6

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

packages/aura/src/components/notification.css

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ html {
33
--vaadin-notification-box-shadow: 0 0 0 1px hsla(0deg, 0%, 0%, 0.07), 0 6px 16px -4px hsla(0deg, 0%, 0%, 0.3);
44
--vaadin-notification-background: light-dark(hsla(0deg, 0%, 100%, 0.2), hsla(0deg, 0%, 0%, 0.6));
55
--vaadin-notification-border-color: hsla(0deg, 0%, 100%, 0.1);
6+
--vaadin-ease-fluid: cubic-bezier(0.78, 0, 0.22, 1);
67
}
78

89
vaadin-notification-card::part(overlay) {
@@ -33,3 +34,79 @@ vaadin-notification-card vaadin-card {
3334
--vaadin-card-gap: var(--vaadin-gap-s);
3435
color: var(--aura-text-color-subtle);
3536
}
37+
38+
/* Animations *
39+
vaadin-notification-card {
40+
transition: 400ms var(--vaadin-ease-fluid);
41+
--_inset: calc(var(--_paint-area) * -1);
42+
--_clip-path: inset(var(--_inset));
43+
}
44+
45+
@keyframes notification-enter {
46+
0% {
47+
translate: var(--_enter-translate, 0 100%);
48+
margin-block: 0;
49+
height: var(--_enter-height, auto);
50+
max-height: var(--_enter-max-height, none);
51+
}
52+
}
53+
54+
vaadin-notification-card:is([opening], [closing]) {
55+
animation: notification-enter 400ms var(--vaadin-ease-fluid);
56+
z-index: 9999;
57+
}
58+
59+
vaadin-notification-card[closing] {
60+
animation-direction: reverse;
61+
}
62+
63+
vaadin-notification-card:not(:hover, :focus-within):not([style*='order: 1;']) {
64+
--_inset-exclude: calc(100% - var(--_gap) - 2px);
65+
--_clip-path: inset(var(--_inset-exclude) var(--_inset) var(--_inset) var(--_inset));
66+
}
67+
68+
vaadin-notification-card:is([position^='bottom'], [position='middle']):not(:hover, :focus-within):not([style*='order: 1;']) {
69+
--_clip-path: inset(var(--_inset) var(--_inset) var(--_inset-exclude) var(--_inset));
70+
--vaadin-notification-box-shadow: none;
71+
}
72+
73+
@supports (interpolate-size: allow-keywords) {
74+
vaadin-notification-card {
75+
--_enter-height: 0;
76+
}
77+
78+
vaadin-notification-card:not(:hover, :focus-within):not([style*='order: 1;']) {
79+
height: 0;
80+
--_clip-path-duration: 450ms;
81+
}
82+
}
83+
84+
@supports not (interpolate-size: allow-keywords) {
85+
vaadin-notification-card {
86+
max-height: 25em;
87+
--_enter-max-height: 0;
88+
--_clip-path-duration: 250ms;
89+
}
90+
91+
vaadin-notification-card:not(:hover, :focus-within):not([style*='order: 1;']) {
92+
--_clip-path-duration: 500ms;
93+
max-height: 0;
94+
}
95+
}
96+
97+
vaadin-notification-card:not(:hover, :focus-within) {
98+
&[style*='order: 2;'] {
99+
scale: 0.94;
100+
}
101+
102+
&[style*='order: 3;'] {
103+
scale: 0.86;
104+
}
105+
106+
&:not([style*='order: 1;'], [style*='order: 2;'], [style*='order: 3;']) {
107+
scale: 0.78;
108+
--_opacity: 0;
109+
margin-block: 0;
110+
}
111+
}
112+
*/

0 commit comments

Comments
 (0)