From ddbb2701bcb568a138ce5665d8b9b13609cd0e15 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Sun, 13 Apr 2025 09:25:11 +0200 Subject: [PATCH] fix(cdk/overlay): disable overlay animation with prefers-reduced-motion Disables the CDK's backdrop transition if the `prefers-reduced-motion` media query is enabled. --- src/cdk/overlay/_index.scss | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cdk/overlay/_index.scss b/src/cdk/overlay/_index.scss index ce8be7b73c5b..8b351bfca653 100644 --- a/src/cdk/overlay/_index.scss +++ b/src/cdk/overlay/_index.scss @@ -85,7 +85,6 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default; } .cdk-overlay-backdrop { - // TODO(jelbourn): reuse sidenav fullscreen mixin. position: absolute; top: 0; bottom: 0; @@ -100,6 +99,10 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default; z-index: $overlay-backdrop-z-index; transition: opacity $backdrop-animation-duration $backdrop-animation-timing-function; } + + @media (prefers-reduced-motion) { + transition-duration: 1ms; + } } .cdk-overlay-backdrop-showing {