Skip to content

Commit 15cf3dc

Browse files
Guard placeholder glow/wave animations behind prefers-reduced-motion (#42768)
1 parent 7d83c39 commit 15cf3dc

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

scss/_placeholder.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@use "colors" as *;
2+
@use "config" as *;
23
@use "functions" as *;
34
@use "mixins/tokens" as *;
45

@@ -49,6 +50,12 @@ $placeholder-tokens: defaults(
4950
.placeholder-glow {
5051
.placeholder {
5152
animation: placeholder-glow 2s ease-in-out infinite;
53+
54+
@if $enable-reduced-motion {
55+
@media (prefers-reduced-motion: reduce) {
56+
animation: none;
57+
}
58+
}
5259
}
5360
}
5461

@@ -62,6 +69,12 @@ $placeholder-tokens: defaults(
6269
mask-image: linear-gradient(130deg, $black 55%, rgb(0 0 0 / calc(1 - var(--placeholder-opacity-min))) 75%, $black 95%);
6370
mask-size: 200% 100%;
6471
animation: placeholder-wave 2s linear infinite;
72+
73+
@if $enable-reduced-motion {
74+
@media (prefers-reduced-motion: reduce) {
75+
animation: none;
76+
}
77+
}
6578
}
6679

6780
@keyframes placeholder-wave {

0 commit comments

Comments
 (0)