Skip to content

Commit

Permalink
Animate: Standardize reduced motion handling using media queries
Browse files Browse the repository at this point in the history
  • Loading branch information
SainathPoojary committed Jan 3, 2025
1 parent 90804a2 commit 147e9bb
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions packages/components/src/animate/style.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.components-animate__appear {
animation: components-animate__appear-animation 0.1s cubic-bezier(0, 0, 0.2, 1) 0s;
animation-fill-mode: forwards;
@include reduce-motion("animation");
@media not (prefers-reduced-motion) {
animation: components-animate__appear-animation 0.1s cubic-bezier(0, 0, 0.2, 1) 0s;
animation-fill-mode: forwards;
}

&.is-from-top,
&.is-from-top.is-from-left {
Expand Down Expand Up @@ -29,9 +30,10 @@
}

.components-animate__slide-in {
animation: components-animate__slide-in-animation 0.1s cubic-bezier(0, 0, 0.2, 1);
animation-fill-mode: forwards;
@include reduce-motion("animation");
@media not (prefers-reduced-motion) {
animation: components-animate__slide-in-animation 0.1s cubic-bezier(0, 0, 0.2, 1);
animation-fill-mode: forwards;
}

&.is-from-left {
transform: translateX(+100%);
Expand All @@ -49,7 +51,9 @@
}

.components-animate__loading {
animation: components-animate__loading 1.6s ease-in-out infinite;
@media not (prefers-reduced-motion) {
animation: components-animate__loading 1.6s ease-in-out infinite;
}
}

@keyframes components-animate__loading {
Expand Down

0 comments on commit 147e9bb

Please sign in to comment.