From 33709ce9b5ec3d5bf764798c587c663fe4efc8ad Mon Sep 17 00:00:00 2001 From: Lynn Date: Mon, 17 Jan 2022 23:43:36 +0100 Subject: [PATCH] Don't play theme change animation on page load --- src/App.css | 1 - src/App.tsx | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/App.css b/src/App.css index b81621f..a0c6250 100644 --- a/src/App.css +++ b/src/App.css @@ -5,7 +5,6 @@ body { text-align: center; background-color: #eeeeee; - transition: 0.3s background-color ease-out; } .Row { diff --git a/src/App.tsx b/src/App.tsx index 245fc85..05071ed 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -36,6 +36,9 @@ function App() { useEffect(() => { document.body.className = dark ? "dark" : ""; + setTimeout(() => { + document.body.style.transition = "0.3s background-color ease-out"; + }, 1); }, [dark]); return (