summary refs log tree commit diff
path: root/src/librustdoc/html/static/rustdoc.css
AgeCommit message (Collapse)AuthorLines
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
2020-08-09Rename "Important traits" to "Notable traits"Camelid-14/+14
* Rename it in the UI * Rename the CSS classes
2020-07-22Rollup merge of #74635 - GuillaumeGomez:fix-tooltip-pos, r=ManishearthManish Goregaokar-0/+10
Fix tooltip position if the documentation starts with a code block Fixes #74321. Before: ![before](https://user-images.githubusercontent.com/3050060/88188970-cf842400-cc38-11ea-839b-37e41656837d.png) After: ![after](https://user-images.githubusercontent.com/3050060/88188981-d3b04180-cc38-11ea-8194-713ffe640d3a.png) And in case there is text, it is not being applied: ![after-witness](https://user-images.githubusercontent.com/3050060/88189009-ddd24000-cc38-11ea-9f0a-61dfd0a0cbd0.png) And on mobile it isn't needed so it's not "activated": ![Screenshot from 2020-07-22 17-17-43](https://user-images.githubusercontent.com/3050060/88194698-65bb4880-cc3f-11ea-8513-0043ccca8cfc.png) r? @rust-lang/rustdoc
2020-07-22Fix tooltip position if the documentation starts with a code blockGuillaume Gomez-0/+10
2020-07-20Improve "important traits" popup display on mobileGuillaume Gomez-0/+5
2020-07-17Fix tidy issuesGuillaume Gomez-11/+12
2020-07-16Don't position:relative on all presManish Goregaokar-1/+6
We need it for run buttons (https://github.com/rust-lang/rust/pull/44671), but not function defs
2020-07-16Remove !important on border-color and background-colorManish Goregaokar-4/+1
2020-07-16Make spotlight show on hoverManish Goregaokar-64/+40
This makes the spotlight show on hover instead of click. Clicks can be used to persist it, which is also what's used on mobile.
2020-07-16Move spotlight next to the return typeManish Goregaokar-14/+2
2020-07-16Revert "Remove "important traits" feature"Manish Goregaokar-3/+93
This reverts commit 1244ced9580b942926afc06815e0691cf3f4a846.
2020-07-15Rollup merge of #74218 - GuillaumeGomez:search-results-bottom-margin, ↵Manish Goregaokar-0/+1
r=Dylan-DPC Add margin after doc search results I found it not really on computer that the last result is right at the bottom of the page. I find it better with margin below (especially when you hover the last element!). A screenshot to show the result: ![Screenshot from 2020-07-10 16-32-23](https://user-images.githubusercontent.com/3050060/87166097-6103a580-c2cb-11ea-81a8-12772cf20f64.png) r? @kinnison cc @rust-lang/rustdoc @Manishearth @jyn514
2020-07-10Add margin after doc search resultsGuillaume Gomez-0/+1
2020-07-05rustdoc: Restore underline text decoration on hover for FQN in headerKristofer Rye-0/+3
This causes the components of FQN's to behave similarly to other links in the contents of rustdoc-styled pages. I (and I hope others at least in part) have found the prior design to be somewhat confusing, as it is not clear (upon hovering) that the various parts of the FQN are actually links that the user can navigate to. In short, this patch makes links in the FQN have an underline when the user hovers over them, more clearly indicating that they can be used for navigation. Signed-off-by: Kristofer Rye <kristofer.rye@gmail.com>
2020-06-18Added tooltip for should_panic code examples.Jake Degen-1/+1
Previously, compile_fail and ignore code examples displayed a tooltip indicating this in the documentation. This tooltip has now also been added to should_panic examples.
2020-05-26Remove font-display settingsGuillaume Gomez-9/+0
2020-05-24Rollup merge of #72092 - workingjubilee:patch-2, r=GuillaumeGomezDylan DPC-0/+9
Unblock font loading in rustdoc.css rustdoc's font loading defaults to "auto", so browsers may block render. But rustdoc's case prefers a faster TTI for scrolling, this means the strictest font-display in use should be "swap". rustdoc's fonts do provide notable legibility improvements but first-time users will have little trouble reading without. This means "optional" is preferred. The one exception is Source Serif Pro: it's a big difference for body text, so "fallback" is preferred over "optional" to cause a (tiny) block. This follows up on (but does not resolve) #20962, taking PageSpeed Insight's rec fairly directly. Supporting reading material: https://drafts.csswg.org/css-fonts-4/#font-display-desc
2020-05-21Fix anchor display when hovering implGuillaume Gomez-1/+1
2020-05-10Unblock font loading in rustdoc.cssJubilee-0/+9
rustdoc's font loading defaults to "auto", so browsers may block render. But rustdoc's case prefers a faster TTI for scrolling, this means the strictest font-display in use should be "swap". rustdoc's fonts do provide notable legibility improvements but first-time users will have little trouble reading without. This means "optional" is preferred. The one exception is Source Serif Pro: it's a big difference for body text, so "fallback" is preferred over "optional" to cause a (tiny) block.
2020-04-07Extend sidebar scrollbar changes to all scrollbarsGuillaume Gomez-5/+12
2020-04-07Improve scrollbar display in rustdocGuillaume Gomez-0/+12
2020-03-28Fix rustdoc.css CSS tab-size property0xd4d-2/+2
2020-03-14Make ignore and compile fail signs more visibleGuillaume Gomez-3/+10
2020-02-27Remove "important traits" featureGuillaume Gomez-93/+3
2020-01-26Fix run button positionning in case of scrollingGuillaume Gomez-1/+3
2020-01-09rustdoc: use another stability mark arrow, no rotate.Liigo Zhuang-3/+2