about summary refs log tree commit diff
path: root/src/librustdoc/html/static/css/rustdoc.css
AgeCommit message (Collapse)AuthorLines
2023-06-02Improve new search result display on mobileGuillaume Gomez-0/+8
2023-06-02Move item kind before the item nameGuillaume Gomez-0/+5
2023-06-02Add search result item types after their nameGuillaume Gomez-2/+2
2023-05-23rustdoc: add hover indicator for notable trait tooltipMichael Howell-0/+4
2023-05-23rustdoc: add interaction delays for tooltip popoversMichael Howell-0/+8
Designing a good hover microinteraction is a matter of guessing user intent from what are, literally, vague gestures. In this case, guessing if hovering in our out of the tooltip base is intentional or not. To figure this out, a few different techniques are used: * When the mouse pointer enters a tooltip anchor point, its hitbox is grown on the bottom, where the popover is/will appear. This was already there before this commit: search "hover tunnel" in rustdoc.css for the implementation. * This commit adds a delay when the mouse pointer enters the base anchor, in case the mouse pointer was just passing through and the user didn't want to open it. * This commit also adds a delay when the mouse pointer exits the tooltip's base anchor or its popover, before hiding it. * A fade-out animation is layered onto the pointer exit delay to immediately inform the user that they successfully dismissed the popover, while still providing a way for them to cancel it if it was a mistake and they still wanted to interact with it. * No animation is used for revealing it, because we don't want people to try to interact with an element while it's in the middle of fading in: either they're allowed to interact with it while it's fading in, meaning it can't serve as mistake- proofing for opening the popover, or they can't, but they might try and be frustrated. See also: * https://www.nngroup.com/articles/timing-exposing-content/ * https://www.nngroup.com/articles/tooltip-guidelines/ * https://bjk5.com/post/44698559168/breaking-down-amazons-mega-dropdown
2023-04-17rustdoc: restructure type search engine to pick-and-use IDsMichael Howell-0/+4
This change makes it so, instead of mixing string distance with type unification, function signature search works by mapping names to IDs at the start, reporting to the user any cases where it had to make corrections, and then matches with IDs when going through the items. This only changes function searches. Name searches are left alone, and corrections are only done when there's a single item in the search query.
2023-04-12rustdoc: use CSS `overscroll-behavior` instead of JavaScriptMichael Howell-1/+2
Fixes the desktop scrolling weirdness mentioned in https://github.com/rust-lang/rust/pull/98775#issuecomment-1182575603 As described in the MDN page for this property: * The current Firefox ESR is 102, and the first Firefox version to support this feature is 59. * The current Chrome version 112, and the first version to support this is 63. * Edge is described as having a minor bug in `none` mode, but we use `contain` mode anyway, so it doesn't matter. * Safari 16, released September 2022, is the last browser to add this feature, and is also the oldest version we officially support.
2023-04-06Rollup merge of #109977 - notriddle:notriddle/data-nosnippet, r=jsha,the8472Matthias Krüger-7/+7
rustdoc: avoid including line numbers in Google SERP snippets ![image](https://user-images.githubusercontent.com/1593513/230141184-9171c8e0-de92-48e6-85b6-8baee35e6d86.png)
2023-04-05rustdoc: avoid including line numbers in Google SERP snippetsMichael Howell-7/+7
2023-04-05Improve display of logo on very small screensGuillaume Gomez-1/+6
2023-04-04Move scrollbar on the <main> element rather than only on the code block to ↵Guillaume Gomez-0/+4
improve UX
2023-03-23rustdoc: remove old `content` hack for theme switchingMichael Howell-15/+0
This is based on the compatibility data for `window.matchMedia` and `MediaQueryList`'s `EventTarget` implementation. https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList#browser_compatibility https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia#browser_compatibility * EventTarget would require us to drop support for all Chrome versions before 39. However, we already require Chrome 49, because rustdoc requires [CSS variables]. * EventTarget would also limit us to Firefox 55, but since #106502 rustdoc only supports Firefox > 68. * EventTarget limits us to Mobile Safari version 14, but #102404 shows that our CSS is broken in Safari versions before 15.5. [CSS variables]: https://developer.mozilla.org/en-US/docs/Web/CSS/--*#browser_compatibility
2023-03-23rustdoc: clean up `storage.js`Michael Howell-1/+1
This converts a few functions to more compact versions of themselves, and moves `RUSTDOC_MOBILE_BREAKPOINT` to main.js where it's actually used.
2023-03-21rustdoc: remove redundant `.content` prefix from span/a colorsMichael Howell-21/+21
Reverts a1d4ebe4961c107272f9764d1908227a3cd04092, as well as fixing the problem it solved with links losing their color.
2023-03-02Put backtick content from rustdoc search errors into a <code> elementsGuillaume Gomez-0/+5
2023-02-19Rollup merge of #107783 - notriddle:notriddle/item-table-ul, r=GuillaumeGomezDylan DPC-7/+9
rustdoc: simplify DOM for `.item-table` This switches from using `<div>` to the more semantic `<ul>`, and using class names that rhyme with the classes the search results table uses.
2023-02-13Rollup merge of #107340 - notriddle:notriddle/simplify-doctest-tooltip, ↵Matthias Krüger-45/+9
r=GuillaumeGomez rustdoc: merge doctest tooltip with notable traits tooltip Fixes https://discord.com/channels/442252698964721669/443150878111694848/1066420140167680000 <details><summary>a user report where the tooltip arrow overlaps the text</summary> ![](https://cdn.discordapp.com/attachments/443150878111694848/1066420139530145812/this-example-is-not-tested-busted-rendering.png) </details> Fixes #91100 Preview: <https://notriddle.com/notriddle-rustdoc-demos/simplify-doctest-tooltip/std/vec/struct.Vec.html#indexing> Screenshot: ![image](https://user-images.githubusercontent.com/1593513/214975516-72667632-4609-49fa-8c37-e8d2ba1ba7dc.png)
2023-02-12rustdoc: use tighter line height in h1 and h2Michael Howell-0/+8
2023-02-07rustdoc: simplify DOM for `.item-table`Michael Howell-7/+9
This switches from using `<div>` to the more semantic `<ul>`, and using class names that rhyme with the classes the search results table uses.
2023-02-04rustdoc: trait bound formattingRoland Strasser-0/+1
rustdoc: fix item-spacer rustdoc: use proper comment style rustdoc: change formatting where clauses for traits rustdoc: remove semicolon from provided methods update provided methods formatting
2023-02-03Replace nbsp in all rustdoc code blocksMichael Howell-0/+2
Co-Authored-By: David Tolnay <dtolnay@gmail.com>
2023-02-02Rollup merge of #107531 - GuillaumeGomez:inline-images-in-css, r=notriddleMatthias Krüger-4/+13
Inline CSS background images directly into the CSS A nice advantage of this is that it removes a few entries in the list of static files. r? ``@notriddle``
2023-02-01Inline CSS background images directly into the CSSGuillaume Gomez-4/+13
2023-01-31Rollup merge of #107527 - notriddle:notriddle/wcagcontrast, r=GuillaumeGomezGuillaume Gomez-4/+0
rustdoc: stop making unstable items transparent Fixes #93393
2023-01-31Rollup merge of #107354 - tspiteri:source-serif-4.005, r=GuillaumeGomezGuillaume Gomez-3/+11
rustdoc: update Source Serif 4 from 4.004 to 4.005 [Version 4.005](https://github.com/adobe-fonts/source-serif/releases/tag/4.005R) was released on 2023-01-20.
2023-01-31rustdoc: stop making unstable items transparentMichael Howell-4/+0
Fixes #93393
2023-01-31Rollup merge of #107477 - GuillaumeGomez:css-var, r=notriddleYuki Okushi-0/+8
Migrate last part of CSS themes to CSS variables No changes in the output. This is already tested in `tests/rustdoc-gui/search-tab.goml` so no need to add a GUI test. r? `@notriddle`
2023-01-30Migrate last part of CSS themes to CSS variablesGuillaume Gomez-0/+8
2023-01-30rustdoc: remove unnecessary wrapper div.item-decl from HTMLMichael Howell-1/+1
2023-01-27rustdoc: merge doctest tooltip with notable traits tooltipMichael Howell-45/+9
Fixes https://discord.com/channels/442252698964721669/443150878111694848/1066420140167680000 Fixes #91100
2023-01-27add comment to rustdoc.css on updating filename suffixesTrevor Spiteri-0/+8
2023-01-27rustdoc: update Source Serif 4 from 4.004 to 4.005Trevor Spiteri-3/+3
Version 4.005 was released on 2023-01-20.
2023-01-26rustdoc: remove mostly-unused CSS classes import/module-itemMichael Howell-2/+1
2023-01-24rustdoc: prevent scroll bar on source viewerKaDiWa-1/+1
2023-01-23Rollup merge of #107186 - GuillaumeGomez:correct-pseudo-element-selector, ↵Dylan DPC-4/+4
r=notriddle rustdoc: Use correct pseudo-element selector As explained [here](https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements#syntax). I wrote it on top of #107152 so we'll need to wait for this one to be merged first. r? `@notriddle`
2023-01-22Rollup merge of #107152 - GuillaumeGomez:migrate-to-css-var, r=notriddleMatthias Krüger-0/+6
Migrate scraped-examples top and bottom "borders" to CSS variables r? `@notriddle`
2023-01-22Use correct pseudo-element selectorGuillaume Gomez-4/+4
2023-01-21Migrate scraped-examples top and bottom "borders" to CSS variablesGuillaume Gomez-0/+6
2023-01-19rustdoc: remove redundant CSS selector `.sidebar .current`Michael Howell-1/+1
Since the current sidebar item is already a link, it doesn't do anything.
2023-01-14Rollup merge of #106828 - notriddle:notriddle/notable-trait-docblock, ↵Matthias Krüger-2/+6
r=GuillaumeGomez rustdoc: remove `docblock` class from notable trait popover This commit builds on b72de9be74dd5ac1d8b23d5ece03a7690274a14c, which removes the `docblock` class from the All Items page, and 9457380ac902db3febf92077c5b645db55998ad4, which removes the `docblock` class from the item decl. Fixes #92974
2023-01-14Rollup merge of #106819 - notriddle:notriddle/rm-h1-fqn, r=GuillaumeGomezYuki Okushi-1/+1
rustdoc: remove unnecessary DOM class `h1.fqn` It's misleading. The main heading sometimes isn't an fully qualified name at all. It's also redundant. It's always a child of `div.main-heading`, so just use that.
2023-01-13rustdoc: remove `docblock` class from notable trait popoverMichael Howell-2/+6
This commit builds on b72de9be74dd5ac1d8b23d5ece03a7690274a14c, which removes the `docblock` class from the All Items page, and 9457380ac902db3febf92077c5b645db55998ad4, which removes the `docblock` class from the item decl. Fixes #92974
2023-01-13rustdoc: rename CSS rustdoc-toggle -> toggle and toggle -> settings-toggleMichael Howell-36/+36
This swaps things around so that the class that gets used more often has the shorter name.
2023-01-13rustdoc: remove unnecessary DOM class `h1.fqn`Michael Howell-1/+1
It's misleading. The main heading sometimes isn't an fully qualified name at all. It's also redundant. It's always a child of `div.main-heading`, so just use that.
2023-01-11Change `src/test` to `tests` in source files, fix tidy and testsAlbert Larsan-1/+1
2023-01-11Rollup merge of #106690 - GuillaumeGomez:item-declaration-scrolling, r=notriddleYuki Okushi-0/+4
Fix scrolling for item declaration block Fixes https://github.com/rust-lang/rust/issues/105580. The `contain: layout` was the issue here and the bug was actually on both mobile and desktop. r? `@notriddle`
2023-01-10Fix scrolling for item declaration blockGuillaume Gomez-0/+4
2023-01-09rustdoc: merge common CSS for `a`Michael Howell-4/+1
2023-01-07Rollup merge of #106556 - notriddle:notriddle/margin-left-content-mobile, ↵Matthias Krüger-4/+0
r=GuillaumeGomez rustdoc: remove no-op mobile CSS `.content { margin-left: 0 }` This rule was added to override non-zero left margin on `.content`, which was removed in 135281ed1525db15edd8ebd092aa10aa40df2386 and the margin-left was put on the docblock.
2023-01-06rustdoc: remove no-op mobile CSS `.content { margin-left: 0 }`Michael Howell-4/+0
This rule was added to override non-zero left margin on `.content`, which was removed in 135281ed1525db15edd8ebd092aa10aa40df2386 and the margin-left was put on the docblock.