Skip to content

Commit

Permalink
fix: add check on disabled dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
lex111 committed Feb 26, 2020
1 parent b022740 commit 154c350
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/docusaurus-theme-classic/src/theme/hooks/useTheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ const useTheme = () => {
}, [setTheme]);

useEffect(() => {
if (disableDarkMode) {
return;
}

window
.matchMedia('(prefers-color-scheme: dark)')
.addListener(({matches}) => {
Expand Down

0 comments on commit 154c350

Please sign in to comment.