From 98b0aedf18e33ab2ca720a58fb7862c7fc154eda Mon Sep 17 00:00:00 2001 From: Aidan Timson Date: Thu, 6 Nov 2025 09:24:10 +0000 Subject: [PATCH] Setup base animation styles --- src/resources/styles.ts | 20 ++++++++++++++++++++ src/resources/theme/core.globals.ts | 8 ++++++++ 2 files changed, 28 insertions(+) diff --git a/src/resources/styles.ts b/src/resources/styles.ts index 553b75b55d..708d7afedc 100644 --- a/src/resources/styles.ts +++ b/src/resources/styles.ts @@ -199,3 +199,23 @@ export const baseEntrypointStyles = css` width: 100vw; } `; + +export const baseAnimationStyles = css` + @keyframes fade-in { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes fade-out { + from { + opacity: 1; + } + to { + opacity: 0; + } + } +`; diff --git a/src/resources/theme/core.globals.ts b/src/resources/theme/core.globals.ts index 9bcfdd6603..5b4739219d 100644 --- a/src/resources/theme/core.globals.ts +++ b/src/resources/theme/core.globals.ts @@ -42,6 +42,14 @@ export const coreStyles = css` --ha-space-18: 72px; --ha-space-19: 76px; --ha-space-20: 80px; + + --ha-animation-base-duration: 350ms; + } + + @media (prefers-reduced-motion: reduce) { + html { + --ha-animation-base-duration: 0ms; + } } `;