about summary refs log tree commit diff
path: root/src/librustdoc/html/static/rustdoc.css
AgeCommit message (Collapse)AuthorLines
2021-03-22Fix codeblock tooltip positionGuillaume Gomez-1/+1
2021-03-15Fall-back to sans-serif if Arial is not availableSimonas Kazlauskas-4/+5
Otherwise on systems where Arial is not available the system will fallback to a serif font, rather than a sans-serif one. This is especially relevant on acessibility-conscious setups (such as is mine) that have web-fonts disabled and a limited set of fonts available on the system.
2021-03-12Rollup merge of #82979 - GuillaumeGomez:run-button-pos, r=Nemo157Yuki Okushi-1/+1
Fix "run" button position in error index This isn't really a rustdoc issue but I still made the same fix in the `rustdoc.css` file (doesn't hurt). Before: ![Screenshot from 2021-03-10 16-35-49](https://user-images.githubusercontent.com/3050060/110655807-aa402800-81bf-11eb-8a88-bc979efd1697.png) After: ![Screenshot from 2021-03-10 16-40-08](https://user-images.githubusercontent.com/3050060/110655843-b4622680-81bf-11eb-8670-42975d92b4eb.png) cc ````@jyn514```` (considering this is quite a big bug and an easy fix) r? ````@Nemo157````
2021-03-10Fix "run" button position in error indexGuillaume Gomez-1/+1
2021-03-09Fix typoGuillaume Gomez-1/+1
2021-03-07Update Source Code Pro and include italicsTrevor Spiteri-2/+9
2021-03-02Use Arial as fallback font instead of sans-serif.Jacob Hoffman-Andrews-3/+3
On most platforms and browsers, `sans-serif` is equivalent to Arial. However, on Firefox on Ubuntu (and possibly other Linuxes), `sans-serif` is DejaVu Sans, a much wider font. This creates a larger shift in text when the custom fonts finally load. Arial is a web-safe font, and specifying it explicitly gives us more cross-platform consistency, as well as reducing the layout shift that happens when fonts load.
2021-03-02Improve page load performance in rustdoc.Jacob Hoffman-Andrews-0/+8
Add font-display: swap. Per https://web.dev/font-display/, this prevents "flash of invisible text" during load by using a system font until the custom font is available. I've noticed this flash of invisible text occasionally when reading Rust docs. Add an explicit height to icons (which already had an explicit width) to allow browsers to lay out the page more accurately before the icons have been loaded. https://web.dev/optimize-cls/. Add min-width: 115px to the crate search dropdown. When the HTML first loads, this dropdown includes only the text "All crates." Later, JS loads the items underneath it, some of which are wider. That causes the dropdown to get wider, causing a distracting reflow. This sets a min-width based on the size that the dropdown eventually becomes based on the crates on doc.rust-lang.org, reducing page movement during load.
2021-02-26Add optional woff2 versions of FiraSans.Jacob Hoffman-Andrews-2/+6
For browsers that support woff2 (most modern ones: https://caniuse.com/woff2), this offers a reduction in download size for these two fonts from 362k to 257k (32% reduction). It decreases the total page size for `struct.String.html` (counting all subresources) by about 2.5%. If this is interesting, I'm happy to apply the same treatment to the other fonts, but these two are the biggest.
2021-02-02Better styling of "Switch result tab" shortcutSmitty-0/+1
2021-02-02Rollup merge of #81630 - GuillaumeGomez:overflow-sidebar-title-text, r=pickfireJonas Schievink-0/+8
Fix overflowing text on mobile when sidebar is displayed Fixes #81597. Before: ![Screenshot from 2021-02-01 17-21-15](https://user-images.githubusercontent.com/3050060/106486857-610b0300-64b2-11eb-96d3-12b939f5b661.png) After: ![Screenshot from 2021-02-01 17-20-59](https://user-images.githubusercontent.com/3050060/106486840-5cdee580-64b2-11eb-9492-4df27bb39e59.png) cc `@pickfire` r? `@Nemo157`
2021-02-01Fix overflowing text on mobile when sidebar is displayedGuillaume Gomez-0/+8
2021-02-01Rollup merge of #81592 - GuillaumeGomez:rustdoc-ui-fixes, r=Nemo157Jonas Schievink-2/+2
Rustdoc UI fixes The first commit fixes this bug (I couldn't figure out why we were setting the width manually and it works as expected without so...): ![Screenshot from 2021-01-31 12-58-46](https://user-images.githubusercontent.com/3050060/106384371-d56a7700-63ca-11eb-9e04-c06b40c2ab5e.png) The second commit fixes a small bug. On tablets or computer with very little width, the search section goes "over" the search input, making it impossible to click on the search input: ![Screenshot from 2021-01-31 13-22-37](https://user-images.githubusercontent.com/3050060/106384413-021e8e80-63cb-11eb-8321-391a1f8a4c7e.png) The third and last commit fixes two bugs that you can see in this screenshot: ![Screenshot from 2021-01-31 13-41-05](https://user-images.githubusercontent.com/3050060/106384424-0cd92380-63cb-11eb-82de-76218286c3fb.png) The wheel is going over the search input and the search tab is going under the search results text. The bug was fixed by simply switching to "mobile mode" at a bigger width: ![Screenshot from 2021-01-31 13-49-50](https://user-images.githubusercontent.com/3050060/106384466-4447d000-63cb-11eb-9330-a7cd29403905.png) cc ```@pickfire``` r? ```@Nemo157```
2021-01-31Improve resize handlingGuillaume Gomez-1/+1
2021-01-31Prevent search section to go over search inputGuillaume Gomez-1/+1
2021-01-31Rollup merge of #81563 - pickfire:patch-6, r=GuillaumeGomezJonas Schievink-0/+4
Improve docblock readability on small screen Before ![image](https://user-images.githubusercontent.com/4687791/106363174-f77bdf00-6361-11eb-898f-d480b8460ab3.png) After ![image](https://user-images.githubusercontent.com/4687791/106363259-6bb68280-6362-11eb-85a1-ef9262681dd7.png) Too much space is wasted on the left side. I wanted to make that 0 but it breaks some part with error symbols. 0 ![image](https://user-images.githubusercontent.com/4687791/106363287-90aaf580-6362-11eb-88c1-62a8313988a7.png) After ![image](https://user-images.githubusercontent.com/4687791/106363276-825cd980-6362-11eb-86eb-6f4611b4ab99.png)
2021-01-31Remove extra trailing spacesIvan Tham-1/+1
2021-01-31Fix docblock short code missing end whitespacesIvan Tham-0/+3
2021-01-31Improve docblock readability on small screenIvan Tham-0/+4
2021-01-31Fix ascii art text wrapping in mobileIvan Tham-3/+1
Fix #81377
2021-01-05Remove bottom margin from crate version when the sidebar is collapsed.Aru Sahni-0/+1
This fixes a mobile UI bug where a vertical scrollbar would always be rendered on the sidebar nav when the menu was closed.
2021-01-02Auto merge of #80412 - GuillaumeGomez:fix-search-section-pos, r=jyn514bors-1/+4
Fix search section position on small devices Fixes #79526. This is exactly the same issue fixed in 9c36491538476dd3ff5ec834944aacdaceb12f30 (in https://github.com/rust-lang/rust/pull/79936) but applied to the search section. When the width becomes too small, the search input goes on its own line to get more space, making it go "under" the section following (so either "main" or "search"). The fix is to simply make the section go more under so that it doesn't go over the search input. r? `@jyn514`
2020-12-30Rollup merge of #80472 - GuillaumeGomez:sans-serif-for-all-items-page, r=Nemo157Yuki Okushi-1/+3
Use sans-serif font for the "all items" page links The "all items" pages' links aren't using a sans-serif font unlike the rest of equivalent items in the other module pages. ``@Nemo157`` reported me this issue so here is the fix! r? ``@Nemo157``
2020-12-29Use sans-serif font for the "all items" page linksGuillaume Gomez-1/+3
2020-12-29Fix search section position on small devicesGuillaume Gomez-1/+4
2020-12-24Auto merge of #79742 - GuillaumeGomez:move-tooltips-messages-out-of-html, ↵bors-7/+17
r=Nemo157 Move tooltips messages out of html First thing first: nothing in the output has changed. You still have the "i" on the left of code blocks examples when they have `ignore`, `compile_fail`, `should_panic` and `edition`. The behavior also remains the same: when you hover the "i", you have the corresponding message showing up. So now, why this PR then? I realized recently that we were actually generating those messages into the HTML every time whereas all messages are the same (except for the edition ones, I'll come back to it later). So instead of generating more content, I simply moved it inside the CSS thanks to pseudo elements (`::before` and `::after`). The message is now inside `::after` and we use the `::before` to have the small triangle on the left of the message. So now, we have less HTML generated which is seems pretty nice. So now, back to the `edition` change: the message is globally the same, but the "edition" itself can be different (2015 or 2018 currently, I expect 2021 to arrive not too far in the future). So the only difference for it is that I added a new attribute on the tooltip called `edition` which contains this information. Then, the `::after` uses it inside its `content` (you can get the content of an element's attribute by using `attr` and concat different strings by simply having them after the other). Don't hesitate if a part of my explanations isn't clear. r? `@jyn514`
2020-12-23Update HTML DOM attribute "edition" to "data-edition"Guillaume Gomez-1/+1
2020-12-14Rollup merge of #79936 - GuillaumeGomez:mobile-fix-item-name, r=Nemo157,jyn514Guillaume Gomez-1/+5
Fix item name display on mobile Fixes https://github.com/rust-lang/docs.rs/issues/1200 ![Screenshot_20201211-200931](https://user-images.githubusercontent.com/3050060/101944457-0c06eb00-3bed-11eb-8f63-a4d4fd3cbb56.jpg) ![Screenshot_20201211-195846](https://user-images.githubusercontent.com/3050060/101944459-0d381800-3bed-11eb-91ff-815a2af7ca72.jpg) cc `@jyn514` r? `@Nemo157`
2020-12-11Fix main section position so that the search input remains clickableGuillaume Gomez-0/+4
2020-12-11Fix item name display on mobileGuillaume Gomez-1/+1
2020-12-10Make search results tab and help button focusable with keyboardGuillaume Gomez-5/+6
2020-12-05Move tooltips messages to CSS instead of inside HTMLGuillaume Gomez-7/+17
2020-11-24Rename "stability" CSS class to "item-info"Guillaume Gomez-9/+9
2020-11-18add [src] links to methods on a trait's pageNixon Enraght-Moony-5/+5
2020-10-22Rollup merge of #78084 - GuillaumeGomez:improve-mobile-display, r=jyn514,Nemo157Yuki Okushi-0/+35
Greatly improve display for small mobile devices screens Fixes #78014. The biggest change being the "search bar". Instead of having everything on one line, I decided to move the search input on its own: ![Screenshot from 2020-10-18 21-54-26](https://user-images.githubusercontent.com/3050060/96378530-c863a800-118c-11eb-8e82-a43fce312b5b.png) Another change is that now, we "break words" in the listing so that they don't grow too big: ![Screenshot from 2020-10-18 21-57-17](https://user-images.githubusercontent.com/3050060/96378555-ffd25480-118c-11eb-8a71-8f116c7edd93.png) r? @jyn514
2020-10-19Add link to rustdoc book in rustdoc help popupGuillaume Gomez-2/+10
2020-10-18Greatly improve display for small mobile devices screensGuillaume Gomez-0/+35
2020-10-18Rollup merge of #78050 - GuillaumeGomez:small-css-cleanup, r=jyn514Yuki Okushi-5/+1
Small CSS cleanup r? @jyn514
2020-10-17Small CSS cleanupGuillaume Gomez-5/+1
2020-10-15Rollup merge of #77979 - GuillaumeGomez:hide-help-button, r=jyn514Guillaume Gomez-0/+8
Hide help button on mobile Addresses #77899. This PR is just a quick fix for now: we're still debating about whether or not we want to display this help popup and if so, how. I'll open an issue once this PR is merged to discuss about it. Before: ![Screenshot from 2020-10-15 17-56-39](https://user-images.githubusercontent.com/3050060/96155127-df499680-0f0f-11eb-8a13-77c537141f21.png) After: ![Screenshot from 2020-10-15 17-55-06](https://user-images.githubusercontent.com/3050060/96154957-ac070780-0f0f-11eb-9d90-7d8f79a6bf37.png) r? @jyn514
2020-10-15Hide help button on mobile devicesGuillaume Gomez-0/+8
2020-10-13Rollup merge of #77699 - GuillaumeGomez:word-wrap, r=XAMPPRockyYuki Okushi-7/+3
Add word wrap for short descriptions Fixes #77652 ![Screenshot from 2020-10-08 13-26-18](https://user-images.githubusercontent.com/3050060/95452770-11845280-096a-11eb-80da-723da85261fa.png) cc @WaffleLapkin r? @jyn514
2020-10-12Add word-wrap rule for short descriptionsGuillaume Gomez-0/+3
2020-10-08Remove unused class ruleGuillaume Gomez-7/+0
2020-10-07Fix tooltip text displayGuillaume Gomez-0/+4
2020-10-03Only use Fira Sans for the first `td` in item listsCamelid-1/+1
Fixes an issue where links in the one-line version of an item's docs would be in Fira Sans, while the rest would be in a serifed font.
2020-09-07rustdoc: Fix font CSS for crate listsCamelid-0/+4
I had put it in the wrong file in #76126. This should fix it now. Thank you to @ollie27 for pointing this out!
2020-08-24Expand rustdoc theme chooser x paddingIvan Tham-1/+1
2020-08-11Rollup merge of #75366 - GuillaumeGomez:help-button, r=jyn514Dylan DPC-4/+14
Add help button Part of #75197. Here is a screenshot of the result: ![Screenshot from 2020-08-10 16-53-20](https://user-images.githubusercontent.com/3050060/89796547-14112a00-db2a-11ea-9f25-57b30ab68f9b.png) r? @jyn514
2020-08-10Add help buttonGuillaume Gomez-4/+14