1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-06-30 01:26:37 -04:00

fix theme toggle animating on load

This commit is contained in:
2022-05-08 22:06:53 -04:00
parent 00d497b69b
commit 482700e640
5 changed files with 20 additions and 16 deletions

View File

@ -29,7 +29,7 @@ export const ThemeProvider = ({
const [systemTheme, setSystemTheme] = useState("");
// hook into system `prefers-dark-mode` setting
// https://web.dev/prefers-color-scheme/#the-prefers-color-scheme-media-query
const isSystemDark = useMedia("(prefers-color-scheme: dark)", false);
const isSystemDark = useMedia("(prefers-color-scheme: dark)");
// get the theme names (light, dark) via passed-in classnames' keys
const themeNames = Object.keys(classNames);