-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
rustdoc: make icons more consistent #91735
Conversation
Some changes occurred in HTML/CSS/JS. |
(rust-highfive has picked a reviewer for you, use r? to override) |
Thanks, looks nice! Please fix the conflict and then ping me once done so I can review. ;) |
This looks nice! Two comments:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@GuillaumeGomez the ping your requested |
@GuillaumeGomez I have refactored the icons to use a custom webfont. Works very well. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
- Change to solid Font Awesome icons to match the style of docs.rs and crates.io + `down-arrow.svg` (`<select>`s) -> `caret-down.svg` + `gear.svg` (settings button) -> `cog.svg` + warning triangle ⚠ (unsafe) -> `exclamation-triangle.svg` + microscope 🔬 (experimental) -> `flask.svg` + info ⓘ (information tooltips) -> `info-circle.svg` + `brush.svg` (theme button) -> `paint-brush.svg` [these turned out to be the same icon] + thumbs down 👎 (deprecated) -> `thumbs-down.svg` - All SVG icons were bundled into a custom font `icons` (those listed above plus `clipboard.svg`, `toggle-minus.svg`, `toggle-plus.svg`) This allows for easily setting the icon color, saves network requests, improves fallback behavior, and removes some `root_path`/`suffix` handling in templates - Move information tooltip into example-wrap for pure CSS hover effects - Modify `toggle-plus.svg` and `toggle-minus.svg`: minified and empty margin removed to be compatible with icon font - Pure CSS code example hover effects
@GuillaumeGomez ready for review |
Code looks good to me. I'll test it locally as soon as possible. Having everything in a font directly instead of downloading multiple images seems like a great improvement! In the meantime: what do you think about this @jsha? |
For anyone interested, I uploaded the generated std docs here. |
I didn't see it as a hard blocker but it could be problematic if we don't have an (opensource) alternative. |
Fontello is open source licensed MIT: https://github.com/fontello/fontello And various alternatives exist. I'm sure the creation of the font could even be automated (using fontello API or some other utility), but given how rarely I expect the font to be modified, I doubt it's worth the maintenance burden. |
Still something we need to approve as a team. I opened a discussion on zulip here. |
☔ The latest upstream changes (presumably #91957) made this pull request unmergeable. Please resolve the merge conflicts. |
Close #91309
<selects>
down-arrow.svg
caret-down.svg
gear.svg
cog.svg
⚠
exclamation-triangle.svg
🔬
flask.svg
ⓘ
info-circle.svg
👎
thumbs-down.svg
icons
(those listed above plus
clipboard.svg
,toggle-minus.svg
,toggle-plus.svg
)This allows for easily setting the icon color, saves network requests, improves fallback behavior,
and removes some
root_path
/suffix
handling in templatestoggle-plus.svg
andtoggle-minus.svg
: minified and empty margin removedto be compatible with icon font
clipboard.svg
was unchanged, besides being bundled into the icon font.Included instruction for recreating the icon font should that be necessary in the future.