summary refs log tree commit diff
path: root/src/librustdoc/html/static/rustdoc.css
AgeCommit message (Collapse)AuthorLines
2021-07-26Rustdoc accessibility: use real headers for doc itemsbors-13/+53
Part of #87059 Partially reverts #84703 Heavily modified for beta backport needs.
2021-07-26Remove redundant CSSMichael Howell-1/+0
2021-07-26Rustdoc accessibility: make the sidebar headers actual headersMichael Howell-0/+5
Part of #87059 Preview it at: https://notriddle.com/notriddle-rustdoc-test/rustdoc-sidebar-header/std/index.html
2021-07-26Do not hide the sidebar on mobile, move it outside of the viewport insteadGuillaume Gomez-4/+6
2021-06-08Rollup merge of #86078 - GuillaumeGomez:type-page-font-weight, r=jshaYuki Okushi-1/+1
Type page font weight Fixes https://github.com/rust-lang/rust/issues/86069. r? ```@jsha```
2021-06-06Fix invalid weight for type pagesGuillaume Gomez-1/+1
2021-06-05Fix display for search resultsGuillaume Gomez-0/+2
2021-06-03Auto merge of #84834 - GuillaumeGomez:sidebar-unification, r=jshabors-1/+4
Sidebar unification This PR does a few things: * Put crates list at all levels (before, it was only on the "top" items) * Fix bug in module sidebar: the list of items was from the parent module. The other changes (on bootstrap mostly) were to allow to generate multiple crates in a same folder so that we can ensure that clicking on the crates in the sidebar works as expected. I added a rustdoc-gui test to ensure everything is where it should be. r? `@jyn514`
2021-06-02Replace h3 for notable traits with divGuillaume Gomez-12/+8
2021-06-02Remove data-level selectors from CSS.Jacob Hoffman-Andrews-71/+13
2021-06-01Remove invalid usage of aria-levelGuillaume Gomez-18/+18
2021-06-01Replace h3 and h4 containing invalid DOMGuillaume Gomez-22/+68
2021-05-31Fix details rustdoc toggle for blanket implIvan Tham-2/+1
In the meantime, allow all of the details to have the same top.
2021-05-31Improve display of the separation between page items and siblings in the sidebarGuillaume Gomez-1/+4
2021-05-26Rollup merge of #84048 - konan8205:master, r=jshaYuki Okushi-1/+9
Avoid CJK legacy fonts in Windows As metioned in #84035, the default serif CJK font in Windows is meh-looking. To avoid this, we should use sans-serif font or provide CJK glyph supported font in `rustdoc.css`.
2021-05-25Move extra search result information for keywords and primitives from CSS to DOMGuillaume Gomez-10/+0
2021-05-24Rollup merge of #85621 - jsha:serif-in-table, r=GuillaumeGomezGuillaume Gomez-0/+1
Restore sans-serif font for module items. This was broke in #84462 by modifying a style that applied both to searches and to module items (and other tables). Fixes #85616. Fixes https://github.com/rust-lang/rust/issues/85545. r? `@camelid`
2021-05-24Rollup merge of #85551 - GuillaumeGomez:fix-search-result-overflow, r=jshaGuillaume Gomez-5/+32
Fix search results display Fixes https://github.com/rust-lang/rust/issues/85544. cc `@dns2utf8` r? `@jsha`
2021-05-23Restore sans-serif font for module items.Jacob Hoffman-Andrews-0/+1
This was broke in #84462 by modifying a style that applied both to searches and to module items (and other tables).
2021-05-22Set desc class on the div instead of the span to simplify CSSGuillaume Gomez-4/+4
2021-05-22Mobile description width: 100%Stefan Schindler-1/+1
2021-05-22Add padding to mobile layout and fix width issue on bothStefan Schindler-0/+2
2021-05-22Prepar to remove deep nestingStefan Schindler-6/+5
2021-05-22Implement staggered mobile layoutStefan Schindler-4/+17
2021-05-21Fix display for primitive and keyword extra infoGuillaume Gomez-2/+2
2021-05-21Fix search results displayGuillaume Gomez-3/+16
2021-05-18Rollup merge of #85396 - jsha:top-doc-font-sizes, r=GuillaumeGomezJack Huey-3/+7
rustdoc: restore header sizes The `<details>` toggle work changed the relationship from #main to the top-doc docblock so it was no longer a parent relationship but a great-grandparent relationship. This updates the CSS rules that set the heading sizes so they still apply. Fixes #85389 r? ``@camelid``
2021-05-18Rollup merge of #85407 - GuillaumeGomez:copy-path-display-improvement, r=jshaRalf Jung-3/+2
Improve display for "copy-path" button, making it more discreet As suggested by `@Nemo157` [here](https://github.com/rust-lang/rust/pull/85118#issuecomment-838887670): ![Screenshot from 2021-05-18 11-18-49](https://user-images.githubusercontent.com/3050060/118626882-899ddb00-b7cb-11eb-84c5-ef68dee5e351.png) ![Screenshot from 2021-05-18 11-15-06](https://user-images.githubusercontent.com/3050060/118626880-899ddb00-b7cb-11eb-95c1-2f3bacd22374.png) ![Screenshot from 2021-05-18 11-18-54](https://user-images.githubusercontent.com/3050060/118626885-8a367180-b7cb-11eb-870c-7acdf4259bef.png) ![Screenshot from 2021-05-18 11-15-00](https://user-images.githubusercontent.com/3050060/118626877-89054480-b7cb-11eb-9efc-9a0f153964ce.png) ![Screenshot from 2021-05-18 11-18-58](https://user-images.githubusercontent.com/3050060/118626888-8a367180-b7cb-11eb-91bb-47867cd0f2cc.png) ![Screenshot from 2021-05-18 11-19-00](https://user-images.githubusercontent.com/3050060/118626891-8acf0800-b7cb-11eb-9e3d-d2937b361524.png) r? `@jsha`
2021-05-18Rollup merge of #84462 - jsha:focus-search-results2, r=GuillaumeGomezRalf Jung-13/+19
rustdoc: use focus for search navigation Rather than keeping track of highlighted element inside the JS, take advantage of `.focus()` and the :focus CSS pseudo-class. This required wrapping each row of results in one big `<a>` tag (because anchors can be focused, but table rows cannot). That in turn required moving from a table layout to a div layout with float. This makes it so Ctrl+Enter opens links in new tabs, and using the arrow keys to navigate off the bottom of the page scrolls the rest of the page into view. It also simplifies the keyboard event handling. It eliminates the need for click handlers on the search results, and for tracking mouse movements. This changes the UI treatment of mouse hovering. A hovered element now gets a light grey background, but does not change the focus. It's possible to have two highlighted search results: one that is focused (via keyboard) and one that is hovered (via mouse). Pressing enter will activate the focused link; clicking will activate the hovered link. This matches up with how Firefox and Chrome handle suggestions in their URL bar, and avoids stray mouse movements changing the focus. Selecting tabs is now done with left/right arrows while any search result is focused. The visibility of results on each search tab is controlled with the "active" class, rather than by setting display: none directly. Note that the old code kept track of highlighted search element when tabbing back and forth. The new code doesn't. Demo at https://hoffman-andrews.com/rust/focus-search-results2/std/?search=fn Fixes #84384 Fixes #79962 Fixes #79872
2021-05-18Improve display for "copy-path" button, making it more discreteGuillaume Gomez-3/+2
2021-05-16rustdoc: restore header sizesJacob Hoffman-Andrews-3/+7
2021-05-15Rollup merge of #85289 - GuillaumeGomez:fix-toggle-position-mobile, r=jshaGuillaume Gomez-192/+198
Fix toggle position on mobile Before: ![Screenshot from 2021-05-14 14-21-27](https://user-images.githubusercontent.com/3050060/118276475-fe210300-b4c7-11eb-94f8-4e2a4e10d91e.png) ![Screenshot from 2021-05-14 14-21-30](https://user-images.githubusercontent.com/3050060/118276479-feb99980-b4c7-11eb-85db-40e9df6e9abd.png) After: ![Screenshot from 2021-05-14 15-16-54](https://user-images.githubusercontent.com/3050060/118276494-0416e400-b4c8-11eb-9479-d447928cfa62.png) ![Screenshot from 2021-05-14 15-16-59](https://user-images.githubusercontent.com/3050060/118276498-0416e400-b4c8-11eb-99f6-894276c62dfc.png) r? ```@jsha```
2021-05-15Rollup merge of #85256 - GuillaumeGomez:fix-implementors-display, r=notriddleGuillaume Gomez-1/+1
Fix display for "implementors" section Just saw this problem when going through docs: ![Screenshot from 2021-05-13 15-20-52](https://user-images.githubusercontent.com/3050060/118131978-766fc180-b3ff-11eb-86a8-7f6d22afa675.png) This fix puts it back to normal: ![Screenshot from 2021-05-13 15-23-29](https://user-images.githubusercontent.com/3050060/118132006-7e2f6600-b3ff-11eb-9985-025a7b7c5216.png) You can see it on the `TryFrom` page for example. r? ```@Nemo157```
2021-05-15chore: update comment in rustdoc.cssShinwoo Park-1/+1
2021-05-15rustdoc: avoid legacy Korean fonts in WindowsShinwoo Park-1/+9
2021-05-14Unify toggle rules on smaller resolutionsGuillaume Gomez-6/+3
2021-05-14Move @media rules at the end so they override the other rulesGuillaume Gomez-193/+195
2021-05-14Fix toggle position on mobileGuillaume Gomez-1/+8
2021-05-13rustdoc: use focus for search navigationJacob Hoffman-Andrews-13/+19
Rather than keeping track of highlighted element inside the JS, take advantage of `.focus()` and the :focus CSS pseudo-class. This required wrapping each row of results in one big <a> tag (because anchors can be focused, but table rows cannot). That in turn required moving from a table layout to a div layout with float. This makes it so Ctrl+Enter opens links in new tabs, and using the arrow keys to navigate off the bottom of the page scrolls the rest of the page into view. It also simplifies the keyboard event handling. It eliminates the need for click handlers on the search results, and for tracking mouse movements. This changes the UI treatment of mouse hovering. A hovered element now gets a light grey background, but does not change the focused element. It's possible to have two highlighted search results: one that is focused (via keyboard) and one that is hovered (via mouse). Pressing enter will activate the focused link; clicking will activate the hovered link. This matches up with how Firefox and Chrome handle suggestions in their URL bar, and avoids stray mouse movements changing the focus. Selecting tabs is now done with left/right arrows while any search result is focused. The visibility of results on each search tab is controlled with the "active" class, rather than by setting display: none directly. Note that the old code kept track of highlighted search element when tabbing back and forth. The new code doesn't.
2021-05-13Rollup merge of #85175 - GuillaumeGomez:rustdoc-cleanup, r=jshaGuillaume Gomez-73/+2
Rustdoc cleanup Part of https://github.com/rust-lang/rust/issues/83332. The goal of this PR is to remove a few unused things: * The "loading content" things are now unneeded. * Some toggle CSS rules were still there. * Some parts of the JS had a different indent, fixed it. r? `@jsha`
2021-05-13Fix display for "implementors" sectionGuillaume Gomez-1/+1
2021-05-12Rollup merge of #85174 - GuillaumeGomez:doc-code-block-border-radius, r=jshaGuillaume Gomez-2/+2
Fix border radius for doc code blocks in rustdoc In #85148, I made an invalid change on the border radius of the doc code blocks (look in the top left and bottom left corners of the code blocks). Before this fix: ![Screenshot from 2021-05-11 11-14-59](https://user-images.githubusercontent.com/3050060/117791459-a4f86b80-b24a-11eb-8ac3-facc719c799a.png) After this fix: ![Screenshot from 2021-05-11 11-05-29](https://user-images.githubusercontent.com/3050060/117791482-a9bd1f80-b24a-11eb-8c38-a01989595f5c.png) r? `@jsha`
2021-05-12Remove unused CSS rulesGuillaume Gomez-68/+2
2021-05-12Remove "loading content" which is now unnecessaryGuillaume Gomez-5/+0
2021-05-11Move global click handlers to per-element ones.Jacob Hoffman-Andrews-4/+4
In rustdoc's main.js, we had an onclick handler for the whole document that would dispatch to handlers for various elements. This change attaches the handlers to the elements that trigger them, instead. This simplfies the code and avoids reimplementing the browser's bubbling functionality. As part of this change, change from a class to an id for help button. Move the handlers and associated code for highlighting source lines into source-script.js (and factor out a shared regex).
2021-05-11Fix border radius for doc code blocks in rustdocGuillaume Gomez-2/+2
2021-05-10Rollup merge of #85148 - GuillaumeGomez:source-code-line-number, r=jshaGuillaume Gomez-9/+5
Fix source code line number display and make it clickable again Fixes https://github.com/rust-lang/rust/issues/85119. I used the same logic we're using for other codeblocks: putting the line number `<span>`s into the `example-wrap` directly and then add `display: inline-flex` on `example-wrap`. r? `@jsha`
2021-05-10Use an SVG image for clipboard instead of unicode characterGuillaume Gomez-4/+5
2021-05-10Fix line number not being clickable on source pagesGuillaume Gomez-9/+5
2021-05-10End toggle migrationGuillaume Gomez-0/+12