mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 17:25:59 +02:00
fix: hopefully fix for #334
This commit is contained in:
committed by
Jean-Philippe Sirois
parent
6b267780b5
commit
b6b295fced
@@ -26,7 +26,9 @@ const ThemeProvider: FC<IScopedDownChildren> = ({ children }) => {
|
||||
|
||||
// App's current theme
|
||||
const [theme, setTheme] = useState<ThemeType>(
|
||||
localTheme === "unset" ? "dark" : localTheme
|
||||
document.documentElement.style.getPropertyValue(
|
||||
"--initial-theme"
|
||||
) as ThemeType
|
||||
)
|
||||
|
||||
const themeObject = useMemo(
|
||||
@@ -40,8 +42,6 @@ const ThemeProvider: FC<IScopedDownChildren> = ({ children }) => {
|
||||
"(prefers-color-scheme: light)"
|
||||
)
|
||||
|
||||
setTheme(prefersLightTheme.matches ? "light" : "dark")
|
||||
|
||||
prefersLightTheme.onchange = ({ matches }) =>
|
||||
setTheme(matches ? "light" : "dark")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user