Skip to content

Commit 91a0cf9

Browse files
authored
fix(cdk/overlay): disable overlay animation with prefers-reduced-motion (#30858)
Disables the CDK's backdrop transition if the `prefers-reduced-motion` media query is enabled.
1 parent 2bade9d commit 91a0cf9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/cdk/overlay/_index.scss

+4-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
8585
}
8686

8787
.cdk-overlay-backdrop {
88-
// TODO(jelbourn): reuse sidenav fullscreen mixin.
8988
position: absolute;
9089
top: 0;
9190
bottom: 0;
@@ -100,6 +99,10 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
10099
z-index: $overlay-backdrop-z-index;
101100
transition: opacity $backdrop-animation-duration $backdrop-animation-timing-function;
102101
}
102+
103+
@media (prefers-reduced-motion) {
104+
transition-duration: 1ms;
105+
}
103106
}
104107

105108
.cdk-overlay-backdrop-showing {

0 commit comments

Comments
 (0)