From 3ed35019d5609810af12fd095ec1034e040c2a50 Mon Sep 17 00:00:00 2001 From: Felix <23635466+its-felix@users.noreply.github.com> Date: Mon, 8 Jan 2024 22:34:07 +0100 Subject: [PATCH] wip --- src/components/root.tsx | 4 ++++ src/pages/index.html | 2 +- src/pages/index.tsx | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/root.tsx b/src/components/root.tsx index b560d69..cda9095 100644 --- a/src/components/root.tsx +++ b/src/components/root.tsx @@ -178,6 +178,10 @@ function InternalBaseProviders({ children }: React.PropsWithChildren) { setAuthInfo(newValue); } + useEffect(() => { + document.getElementById('temp_style')?.remove(); + }, []); + useEffect(() => { applyMode(preferences.effectiveColorScheme === ColorScheme.LIGHT ? Mode.Light : Mode.Dark); applyDensity(preferences.uiDensity === UIDensity.COMFORTABLE ? Density.Comfortable : Density.Compact); diff --git a/src/pages/index.html b/src/pages/index.html index e6c92c2..880ac8c 100644 --- a/src/pages/index.html +++ b/src/pages/index.html @@ -4,7 +4,7 @@ GW2Auth - + diff --git a/src/pages/index.tsx b/src/pages/index.tsx index e5cd064..0a9f917 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,3 +1,4 @@ +import { applyMode, Mode } from '@cloudscape-design/global-styles'; import React from 'react'; import ReactDOM from 'react-dom/client'; import { @@ -173,5 +174,5 @@ const element = ( ); +applyMode(Mode.Dark); root.render(element); -document.getElementById('temp_style')?.remove();