cognitive-engineering-lab / rust-book

The Rust Programming Language: Experimental Edition
https://rust-book.cs.brown.edu
Other
503 stars 82 forks source link

Does not respect system dark theme preference #157

Closed LSeelig closed 3 months ago

LSeelig commented 5 months ago

URL to the section(s) of the book with this problem: N/A

Description of the problem: My computer switches its system-wide theme from light to dark at sunset. Most apps and many websites can detect/support this, but this book does not. I appreciate the theme options, but I end up having to manually change them every time my computer switches if I want it to match the rest of my system.

Suggested fix: Currently, the default theme is the dark 'Navy' theme. Consider adding 'System' or 'Automatic' to the theme dropdown, that, if selected, switches between the 'Light' theme and one of the dark themes.

It would be appreciated if the user could choose which theme they would want as their light and dark theme, but I recognize this could overcomplicate the menu. If there is no selection for specific light and dark themes, 'Light' should probably be the light mode, and 'Coal' is the most standard dark theme.

It may be more elegant (but maybe convention breaking), but since the theme dropdown is already a pseudo-checklist,checking the system/auto option could simply use the previous (and still checked) theme for dark mode. Since 'Light' is the only light theme, only the dark theme is even in question.

willcrichton commented 3 months ago

The color themes are handled by mdBook, not by us. I would recommend raising this issue over there if you want this feature implemented.