From 4b2affd531fd7c4102ff8ba77bb8aee63ca9a588 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 29 May 2019 22:01:29 +0200 Subject: [PATCH] Fix prefers-color-scheme not working --- docs/src/modules/components/ThemeContext.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/modules/components/ThemeContext.js b/docs/src/modules/components/ThemeContext.js index a5c524189a72bf..c050426c99c3c8 100644 --- a/docs/src/modules/components/ThemeContext.js +++ b/docs/src/modules/components/ThemeContext.js @@ -49,7 +49,7 @@ export function Provider(props) { } }, themeInitialOptions); - const prefersDarkMode = useMediaQuery('prefers-color-scheme: dark'); + const prefersDarkMode = useMediaQuery('@media (prefers-color-scheme: dark)'); const preferredType = prefersDarkMode ? 'dark' : 'light'; const { direction, paletteColors, paletteType = preferredType } = themeOptions;