-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Inline some SVG icons into rustdoc.css #91724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This reduces the number of requests made when loading rustdoc off the web, without any significant bloat (they aren't base64-ed, and they aren't inlined into every single HTML file, either). This is currently three icons, but if we switch to font-awesome, it will probably be more.
Some changes occurred in HTML/CSS/JS. |
r? @CraftSpider (rust-highfive has picked a reviewer for you, use r? to override) |
It looks great. I'll take a complete look in the next days to be sure I don't miss something. |
This is really great, thanks a lot! @bors: r+ |
📌 Commit 04b96ac has been approved by |
// The following icons are embeded in the CSS file, | ||
// unless we're in tweak-the-theme-mode. | ||
if !options.enable_minification { | ||
write_toolchain("down-arrow.svg", static_files::DOWN_ARROW_SVG)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just realized but: could you merge the write_toolchain
call with the css_icon_url
closure call please? It would make it impossible to forget to update this part.
@bors: r- |
Another thing I wonder is if this PR is useful considering #91735. |
That’s actually the main reason for doing this. It adds more SVG icons, in places that used to use Unicode symbols, so it makes sense to put in work to reduce the number of separate network requests. |
The PR I linked moves all icons them into a font. So it reduces the number of calls, not the opposite. |
This reduces the number of requests made when loading rustdoc off the web, without significant bloat (they aren't base64-ed, and they aren't inlined into every single HTML file, either).
This is currently three icons, but if we switch to font-awesome, it will probably be more.