macOS Mojave will have a system-wide dark mode. It would be nice to have an option to follow the system theme.
(Depends on https://github.com/electron/electron/issues/13387)
@CvX It's already possible.
We can check whether it's dark mode with systemPreferences.isDarkMode() and detect dark mode changes with systemPreferences.subscribeNotification('AppleInterfaceThemeChangedNotification', () => {}).
Ah, my bad, I missed the ! when looking at this code: https://github.com/electron/electron/blob/47826a1262ab9d5f25cb9e0128adeb23c5fe8749/atom/browser/api/atom_api_system_preferences.cc#L30-L34 馃槄
Most helpful comment
@CvX It's already possible.
We can check whether it's dark mode with
systemPreferences.isDarkMode()and detect dark mode changes withsystemPreferences.subscribeNotification('AppleInterfaceThemeChangedNotification', () => {}).