Description
See rust-lang/docs.rs#919 for some context.
When browsing docs within a single Web context (a.k.a. a single instance of LocalStorage
, mostly based on the domain but also affected by other details) generated from multiple versions of rustdoc
(or with custom themes) you may set the selected theme to one that does not exist in all the documentation. When loading a page with an unknown theme rustdoc
will just leave the theme as the default light
theme, which can result in suddenly been blinded if generally using a dark theme in a dark room.
To avoid the binding effect it would be good to have all builtin (and custom) themes classified into light or dark, and fallback to the base light/dark theme as appropriate when the exact theme requested is unknown. This will have to be implemented something like storing the classification into local-storage alongside the theme itself, since the rustdoc JS loading the theme will not know the theme to classify it itself.
If anyone can think of a plan that is backwards compatible with both pre-ayu rustdoc, and the current nightlies with ayu available, it'd be great if we can get this working across all versions on docs.rs somehow; but I doubt this is possible, so probably best to focus on just getting something that works on documentation generated going forward.