rust-lang / mdBook

Create book from markdown files. Like Gitbook but implemented in Rust
https://rust-lang.github.io/mdBook/
Mozilla Public License 2.0
18.01k stars 1.62k forks source link

[Feature request] Add a theme option like "auto" to reset the theme to auto dark mode #1504

Open myuki opened 3 years ago

myuki commented 3 years ago

If change the theme manually, it can't be reset to auto dark mode that request the dark version of the site via the prefers-color-scheme CSS media query.

The desktop browser can reset the theme by manually delete the local storage which is really troublesome. Also, many mobile browsers can't just delete a specific website data. It should add a theme option like "auto" to reset the theme to auto dark mode.

vrslev commented 1 year ago

Any progress on this?

bragefuglseth commented 1 year ago

When set to auto, I would really like if I didn't have to reload the page for it to apply either. It should just change instantly when I change between light/dark mode on my system :)

atjn commented 4 weeks ago

I think you could make the theme picker even better by allowing the user to explicitly choose between "light", "dark", and "auto" mode. Then there can be a separate picker to choose which type of light theme, and which type of dark theme is preferred. Here is a mockup of what that could look like:

Light or dark mode:
[Always light] [Automatic] [Always dark]
Choose light theme: Choose dark theme:
[Light] [Coal]
[Rust] [Navy]
[Ayu]