Skip to content

Commit ef38bc6

Browse files
committed
Handle mode SVG animation prefers reduced motion
1 parent a984ef0 commit ef38bc6

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

src/styles/page.scss

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,19 @@ p.larger-spacing {
146146
// Animations
147147

148148
.rotate-appear {
149-
animation: 250ms ease-in-out forwards rotate-appear;
149+
animation: 0ms ease-in-out forwards rotate-appear;
150150
}
151151
.rotate-vanish {
152-
animation: 250ms ease-in-out reverse forwards rotate-appear;
152+
animation: 0ms ease-in-out reverse forwards rotate-appear;
153+
}
154+
155+
@include m-motion {
156+
.rotate-appear {
157+
animation-duration: 250ms;
158+
}
159+
.rotate-vanish {
160+
animation-duration: 250ms;
161+
}
153162
}
154163

155164
@keyframes rotate-appear {

src/styles/partials/_media.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
}
55
}
66

7+
@mixin motion {
8+
@media (prefers-reduced-motion: no-preference) {
9+
@content;
10+
}
11+
}
12+
713
@mixin small {
814
@media (min-width: 28em) {
915
@content;

0 commit comments

Comments
 (0)