From 154c350ec6b35d6d28baabf59f087c6118f5e813 Mon Sep 17 00:00:00 2001 From: Alexey Pyltsyn Date: Wed, 26 Feb 2020 04:11:29 +0300 Subject: [PATCH] fix: add check on disabled dark mode --- packages/docusaurus-theme-classic/src/theme/hooks/useTheme.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/docusaurus-theme-classic/src/theme/hooks/useTheme.js b/packages/docusaurus-theme-classic/src/theme/hooks/useTheme.js index 52402bba8f72..dcbb24e2d28a 100644 --- a/packages/docusaurus-theme-classic/src/theme/hooks/useTheme.js +++ b/packages/docusaurus-theme-classic/src/theme/hooks/useTheme.js @@ -62,6 +62,10 @@ const useTheme = () => { }, [setTheme]); useEffect(() => { + if (disableDarkMode) { + return; + } + window .matchMedia('(prefers-color-scheme: dark)') .addListener(({matches}) => {