Comments (5)
The default theme only works on first page load, once any other docs have been loaded and stored their preference into local storage it will not be used. (It does also appear to be buggy, if you clear local storage then load that page no theme at all is used, but given that's a situation that essentially never happens I don't see any reason to fix it).
from docs.rs.
I was hoping to make sure the correct theme was chosen for people loading it for the first time. It's kind of the reason why I set the default theme. To make it look nicer and not completely blind people on the first load (I absolutely hate light themes cause of the problems it causes me)
from docs.rs.
The default theme only works on first page load, once any other docs have been loaded and stored their preference into local storage it will not be used. (It does also appear to be buggy, if you clear local storage then load that page no theme at all is used, but given that's a situation that essentially never happens I don't see any reason to fix it).
So the setting is a user setting and will be used for all of docs.rs then? Or do we have some potential optimization here?
from docs.rs.
The default theme only works on first page load, once any other docs have been loaded and stored their preference into local storage it will not be used. (It does also appear to be buggy, if you clear local storage then load that page no theme at all is used, but given that's a situation that essentially never happens I don't see any reason to fix it).
So the setting is a user setting and will be used for all of docs.rs then? Or do we have some potential optimization here?
From my understanding, the default theme only applies if the user hasn't set one yet and the user setting applies site-wide
from docs.rs.
The default theme only applies if the user has never visited a page, as soon as a page (that doesn't have a default-theme) is visited the settings are stored into local storage and apply site-wide. Docs.rs' theming (of the topbar and the crates pages) also relies on the settings being stored into local storage, so don't work with a default theme.
I have identified why it's not applying any styling though, rustdoc has migrated to using <body data-theme="ayu">
at some point instead of loading separate css files, which is what docs.rs has been using too, so because the default theme doesn't get stored into local storage we override that with data-theme="null"
. I can fix that so at least we don't cause issues with conflicting with rustdoc (e.g. for defaults like this, or more usefully if the default theme-set changes we don't break theming till we update our set too).
from docs.rs.
Related Issues (20)
- Request to rebuild axum-login docs HOT 1
- liboxen docs failing HOT 3
- Docs.rs doesn't seem to run anymore for my crate simconnect-sys HOT 2
- Custom CSS from `--extend-css` doesn't work HOT 2
- Re-generate docs for dependents on generic-array v0.14 HOT 8
- Features page: link dependent features HOT 1
- Features page: mark all active by default features
- Crate succeeds to build, but some pages are unreachable HOT 8
- Rebuild docs for openvino crate 0.7.2 HOT 2
- My crate build fails and the build error message is not very informative HOT 1
- https://giphy.com/clips/erichamlet-upVo4ebZoXlUUsKdn8
- Crate failed to build HOT 3
- increase RAM or lower number of jobs for crates diffsl and diffsol HOT 2
- Does not build for MacOS and Windows target. HOT 1
- Add lines labels to `/crate/**/source/` HOT 8
- several Bevy crates failed to build with yanked dependencies error but could not find which HOT 8
- Build fails due to DNS resolution problem HOT 1
- SM-G355HN
- LIEF Rust bindings need network access HOT 2
- Rebuild request: SQLx 0.8.0 crates HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docs.rs.