You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: fix missing import, explicitly use nativeTheme api (electron#21937)
* docs: fix missing import, explicitly use nativeTheme api
* Update docs/tutorial/mojave-dark-mode-guide.md
Co-Authored-By: Charles Kerr <ckerr@github.com>
* switch to nativeTheme event
Co-authored-by: Charles Kerr <ckerr@github.com>
Copy file name to clipboardExpand all lines: docs/tutorial/mojave-dark-mode-guide.md
+6-9Lines changed: 6 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,10 @@
2
2
3
3
In macOS 10.14 Mojave, Apple introduced a new [system-wide dark mode](https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/dark-mode/)
4
4
for all macOS computers. If your app does have a dark mode, you can make your Electron app
5
-
follow the system-wide dark mode setting.
5
+
follow the system-wide dark mode setting using [the nativeTheme api](../api/native-theme.md).
6
6
7
7
In macOS 10.15 Catalina, Apple introduced a new "automatic" dark mode option for all macOS computers. In order
8
-
for the `isDarkMode` and `Tray` APIs to work correctly in this mode on Catalina you need to either have `NSRequiresAquaSystemAppearance` set to `false` in your `Info.plist` file or be on Electron `>=7.0.0`.
8
+
for the `nativeTheme.shouldUseDarkColors` and `Tray` APIs to work correctly in this mode on Catalina you need to either have `NSRequiresAquaSystemAppearance` set to `false` in your `Info.plist` file or be on Electron `>=7.0.0`.
9
9
10
10
## Automatically updating the native interfaces
11
11
@@ -18,15 +18,12 @@ out of this theming.
18
18
## Automatically updating your own interfaces
19
19
20
20
If your app has its own dark mode you should toggle it on and off in sync with the system's dark mode setting. You can do
21
-
this by listening for the theme changed event on Electron's `systemPreferences` module. E.g.
21
+
this by listening for the theme updated event on Electron's `nativeTheme` module. E.g.
0 commit comments