rustdoc: CSS for all three themes is fetched #82614
Labels
A-rustdoc-ui
Area: Rustdoc UI (generated HTML)
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Right now, light1.52.0.css, dark1.52.0.css, and ayu1.52.0.css are all loaded on each page load. These are early in the page, and as high-priority resources, they loaded first. Even with HTTP/2, they block other resources from starting their downloads (because there appears to be a limit on parallel HTTP/2 fetches made by browsers; though I need to check this).
These stylesheets are loaded like:
Interestingly, the theme picker JS doesn't change the
disabled
property, but changes the href on the main theme:rust/src/librustdoc/html/static/storage.js
Line 111 in 94736c4
I think it would be more efficient to omit the second two
<link>
s, and instead list all the theme URLs using adata
property onrustdoc-vars
.The text was updated successfully, but these errors were encountered: