Add "Auto" theme selection which switches between default light and dark theme automatically #2576
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The first commit is pretty uncontroversial. It takes the existing behavior for auto-detecting light/dark mode and improves it so that the page automatically changes when the preferred mode changes without a refresh. This is useful on systems which have a scheduled light/dark mode change, which is a built-in option on many OSes.
The problem is that this functionality can only be accessed if the user has never selected a theme before. To allow restoring the default behavior, we now add an "Auto" theme menu option in the second commit.
Since some people customize their index.hbs we make both changes resilient to that, falling back to the old behavior if the index changes are not applied. Thankfully this is pretty simple to do. (Longer term it'd be nice to remove the need to do this, e.g. for custom themes... that's #2594 or #2059.)
Fixes #1504