Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
its-felix committed Jan 8, 2024
1 parent 62153f9 commit 3ed3501
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/components/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<title>GW2Auth</title>
<style id="temp_style">body{color-scheme:dark; background-color: #0F1B2A}</style>
<style id="temp_style">body{color-scheme:dark;background-color:#0F1B2A;}</style>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
Expand Down
3 changes: 2 additions & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { applyMode, Mode } from '@cloudscape-design/global-styles';
import React from 'react';
import ReactDOM from 'react-dom/client';
import {
Expand Down Expand Up @@ -173,5 +174,5 @@ const element = (
</React.StrictMode>
);

applyMode(Mode.Dark);
root.render(element);
document.getElementById('temp_style')?.remove();

0 comments on commit 3ed3501

Please sign in to comment.