Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Added notify and drawer default CSS animations #531

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
34 changes: 34 additions & 0 deletions less/core/drawer.less
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,37 @@
}
}
}

.drawer:not(.disable-animation) {
opacity: 0;

&.anim-show-before {
.transition(left var(--adapt-drawer-duration) var(--adapt-drawer-show-easing), right var(--adapt-drawer-duration) var(--adapt-drawer-show-easing), opacity var(--adapt-drawer-duration) var(--adapt-drawer-show-easing););
}

&.anim-hide-before {
.transition(left var(--adapt-drawer-duration) var(--adapt-drawer-hide-easing), right var(--adapt-drawer-duration) var(--adapt-drawer-hide-easing), opacity var(--adapt-drawer-duration) var(--adapt-drawer-hide-easing););
}

&.is-position-auto,
&.is-position-right {
&.anim-show-after {
opacity: 1;
}

&.anim-hide-after {
opacity: 0;
}
}

.dir-rtl &:not(.is-position-right),
&.is-position-left {
&.anim-show-after {
opacity: 1;
}

&.anim-hide-after {
opacity: 0;
}
}
}
31 changes: 30 additions & 1 deletion less/core/notify.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
&__popup {
background-color: @notify;
color: @notify-inverted;
.transition(margin-top @duration, top @duration;);
}

&__popup-inner {
Expand Down Expand Up @@ -106,3 +105,33 @@
.transition(background-color @duration ease-in, color @duration ease-in;);
}
}


.notify:not(.disable-animation) > .notify__popup {
.transition(margin-top var(--adapt-notify-duration) @animation-easing, top var(--adapt-notify-duration) @animation-easing, transform var(--adapt-notify-duration) @animation-easing, opacity var(--adapt-notify-duration) @animation-easing, height var(--adapt-notify-duration) @animation-easing;);
opacity: 0;
transform: translateY(0%);

.anim-show-after& {
transform: translateY(-50%);
opacity: 1;
}

.anim-hide-after& {
transform: translateY(0%);
opacity: 0;
}
}

.notify:not(.disable-animation) > .notify__shadow {
.transition(opacity var(--adapt-notify-duration) @animation-easing;);
opacity: 0;

.anim-show-after& {
opacity: 1;
}

.anim-hide-after& {
opacity: 0;
}
}
13 changes: 13 additions & 0 deletions less/core/shadow.less
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
.shadow {
background-color: fade(@shadow, @shadow-opacity);
}

.shadow:not(.disable-animation) {
.transition(opacity @duration ease-in;);
opacity: 0;

&.anim-show-after {
opacity: 1;
}

&.anim-hide-after {
opacity: 0;
}
}