From 63f4cc456c592e6166236aa672ca2f17c2cfab8f Mon Sep 17 00:00:00 2001 From: karwosts <32912880+karwosts@users.noreply.github.com> Date: Sat, 12 Apr 2025 23:56:02 -0700 Subject: [PATCH] No particles when prefers-reduced-motion (#25029) --- src/auth/ha-authorize.ts | 5 ++++- src/onboarding/ha-onboarding.ts | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/auth/ha-authorize.ts b/src/auth/ha-authorize.ts index a4108bc9d1..a8b254a552 100644 --- a/src/auth/ha-authorize.ts +++ b/src/auth/ha-authorize.ts @@ -265,7 +265,10 @@ export class HaAuthorize extends litLocalizeLiteMixin(LitElement) { ); } - if (window.innerWidth > 450) { + if ( + window.innerWidth > 450 && + !matchMedia("(prefers-reduced-motion)").matches + ) { import("../resources/particles"); } diff --git a/src/onboarding/ha-onboarding.ts b/src/onboarding/ha-onboarding.ts index ca926802b8..8f8fbfc896 100644 --- a/src/onboarding/ha-onboarding.ts +++ b/src/onboarding/ha-onboarding.ts @@ -220,7 +220,10 @@ class HaOnboarding extends litLocalizeLiteMixin(HassElement) { this.addEventListener("onboarding-progress", (ev) => this._handleProgress(ev) ); - if (window.innerWidth > 450) { + if ( + window.innerWidth > 450 && + !matchMedia("(prefers-reduced-motion)").matches + ) { import("../resources/particles"); } makeDialogManager(this, this.shadowRoot!);