New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GSoD] docs: revised dark mode feature page #26187
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're renaming this guide do we need to add a redirect from the old URL on the website?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General comment: I believe this also works on Windows, so it's important to scope macOS-specific advice to their own subsection.
To other reviewers: for reference, here's a gist link to the original demo I gave Anton: https://gist.github.com/151c3804bb771807c38fc4f0c8bc74bf
docs/tutorial/dark-mode-guide.md
Outdated
### macOS | ||
|
||
In macOS 10.14 Mojave, Apple introduced a new [system-wide dark mode][system-wide-dark-mode] | ||
for all macOS computers. If your Electron app has a dark mode, you can make it | ||
follow the system-wide dark mode setting using | ||
[the `nativeTheme` api](../api/native-theme.md). | ||
|
||
In macOS 10.15 Catalina, Apple introduced a new "automatic" dark mode option | ||
for all macOS computers. In order 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 | ||
use Electron `>=7.0.0`. Both [Electron Packager][electron-packager] and | ||
[Electron Forge][electron-forge] have a | ||
[`darwinDarkModeSupport` option][packager-darwindarkmode-api] | ||
to automate the `Info.plist` changes during app build time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe move the macOS
section to another H2 below Overview
for platform-specific considerations.
docs/tutorial/dark-mode-guide.md
Outdated
theming from the OS. If you wish to opt-out while using Electron > 8.0.0, | ||
you must set the `NSRequiresAquaSystemAppearance` key in the `Info.plist` file | ||
to `true`. Please note that Electron 8.0.0 and above will not let you opt-out | ||
of this theming, due to the use of the macOS 10.14 SDK. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This opt-out, however, is macOS specific (maybe move to platform-specific section mentioned above).
@MarshallOfSound I can add a PR to electronjs.org after this is merged and it's live on the website. |
Release Notes Persisted
|
* docs: revised dark mode page * docs: fixed lint errors in dark mode page * docs: fixed mentions, revised doc structure in the dark mode feature page * docs: fixed mentions, made all the steps more verbose in the dark mode feature page
Description of Change
Revised dark mode feature page, added example that demonstrates the feature, added gif representing the code sample
Checklist
Release Notes
Notes: Revised dark mode feature page, added example that demonstrates the feature, added gif representing the code sample