|
3 | 3 | --vaadin-notification-box-shadow: 0 0 0 1px hsla(0deg, 0%, 0%, 0.07), 0 6px 16px -4px hsla(0deg, 0%, 0%, 0.3); |
4 | 4 | --vaadin-notification-background: light-dark(hsla(0deg, 0%, 100%, 0.2), hsla(0deg, 0%, 0%, 0.6)); |
5 | 5 | --vaadin-notification-border-color: hsla(0deg, 0%, 100%, 0.1); |
| 6 | + --vaadin-ease-fluid: cubic-bezier(0.78, 0, 0.22, 1); |
6 | 7 | } |
7 | 8 |
|
8 | 9 | vaadin-notification-card::part(overlay) { |
@@ -33,3 +34,79 @@ vaadin-notification-card vaadin-card { |
33 | 34 | --vaadin-card-gap: var(--vaadin-gap-s); |
34 | 35 | color: var(--aura-text-color-subtle); |
35 | 36 | } |
| 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