diff --git a/docs/api/system-preferences.md b/docs/api/system-preferences.md index 41f9f5328f12..e4753eff35d1 100644 --- a/docs/api/system-preferences.md +++ b/docs/api/system-preferences.md @@ -43,7 +43,7 @@ Returns: ## Methods -### `systemPreferences.isDarkMode()` _macOS_ +### `systemPreferences.isDarkMode()` _macOS_ _Windows_ Returns `Boolean` - Whether the system is in Dark Mode. diff --git a/shell/browser/api/atom_api_system_preferences.cc b/shell/browser/api/atom_api_system_preferences.cc index a5193ff17d78..0f51e6036295 100644 --- a/shell/browser/api/atom_api_system_preferences.cc +++ b/shell/browser/api/atom_api_system_preferences.cc @@ -10,6 +10,7 @@ #include "shell/common/node_includes.h" #include "ui/gfx/animation/animation.h" #include "ui/gfx/color_utils.h" +#include "ui/native_theme/native_theme.h" namespace electron { @@ -30,7 +31,7 @@ SystemPreferences::~SystemPreferences() { #if !defined(OS_MACOSX) bool SystemPreferences::IsDarkMode() { - return false; + return ui::NativeTheme::GetInstanceForNativeUi()->SystemDarkModeEnabled(); } #endif