From 34270ca70777e4ffb177e42de246c6a71d290931 Mon Sep 17 00:00:00 2001 From: Joe Opseth Date: Sat, 27 Jul 2024 11:36:41 -0500 Subject: [PATCH] Disable shake for users with reduced motion preference Only enable the CSS shake animation for invalid input if the user has not indicated a preference against animations. --- src/style/_mixins.scss | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/style/_mixins.scss b/src/style/_mixins.scss index 007ddf16130..990b87a7ace 100644 --- a/src/style/_mixins.scss +++ b/src/style/_mixins.scss @@ -136,9 +136,12 @@ $browser-context: 16; } @mixin invalidFormElement() { - animation: shake 0.4s 1; border-color: $color-delete; background: color.adjust($color-delete, $lightness: 35%); + + @media(prefers-reduced-motion: no-preference) { + animation: shake 0.4s 1; + } } @mixin method($color) {