about summary refs log tree commit diff
path: root/src/librustdoc/html/static
AgeCommit message (Collapse)AuthorLines
2022-09-28rustdoc: cut margin-top from first header in docblockMichael Howell-0/+7
Fixes a regression caused by 8846c0853d8687fda0e5f23f6687b03b243980ee, where a header's top margin used to be collapsed, but isn't any more.
2022-09-28Rollup merge of #102380 - notriddle:notriddle/rustdoc-source-sidebar, r=camelidYuki Okushi-3/+0
rustdoc: remove redundant mobile `.source > .sidebar` CSS When the source sidebar and standard sidebar had most of their code merged in 07e3f998b1ceb4b8d2a7992782e60f5e776aa114, the properties `z-index: 11`, `margin: 0`, and `position: fixed` were already being set on the `.sidebar` class, so no need to repeat them. https://github.com/rust-lang/rust/blob/57ee5cf5a93923dae9c98bffb11545fc3a31368d/src/librustdoc/html/static/css/rustdoc.css#L1742-L1754
2022-09-27rustdoc: remove redundant mobile `.source > .sidebar` CSSMichael Howell-3/+0
When the source sidebar and standard sidebar had most of their code merged in 07e3f998b1ceb4b8d2a7992782e60f5e776aa114, the properties `z-index: 11`, `margin: 0`, and `position: fixed` were already being set on the `.sidebar` class, so no need to repeat them.
2022-09-27Rollup merge of #102369 - GuillaumeGomez:results-colors, r=notriddleMatthias Krüger-1/+3
Fix search result colors Fixes regression introduced in https://github.com/rust-lang/rust/commit/99c00714cff0d13b6c5092c9949cb4e93a121346. As you can see, ayu lost some colors for its search results: beta/nightly: ![Screenshot from 2022-09-27 19-46-49](https://user-images.githubusercontent.com/3050060/192606456-e7bb58dd-cf76-49a0-b1ae-28565adb1dc6.png) stable: ![Screenshot from 2022-09-27 19-46-36](https://user-images.githubusercontent.com/3050060/192606453-e720e219-a336-4ff1-989b-2fdb76e789eb.png) We'll need to backport it to beta too to prevent it reaching stable. r? `@notriddle`
2022-09-27Rollup merge of #102367 - notriddle:notriddle/help-text-align, r=GuillaumeGomezMatthias Krüger-5/+0
rustdoc: remove redundant `#help-button` CSS When the separate top and bottom styles were added in cd3f4da244578a2ab4d17d10016c61b9191b21e4, some of the CSS rules were needlessly duplicated. The `text-align: initial` rule on `.side-by-side` was always redundant, since the rules that centered the text were set on children, not parents.
2022-09-27Rollup merge of #102330 - notriddle:notriddle/srclink, r=GuillaumeGomezMatthias Krüger-7/+0
rustdoc: remove no-op CSS `.srclink { font-weight; font-size }` When this CSS was added in 34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9, source links were nested below headers. https://github.com/rust-lang/rust/blob/34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9/src/librustdoc/html/render.rs#L4015-L4019 Now, thanks to 458e7219bc2a62f72368279945cfda632a016da1, they are now siblings of headers, and thanks to 270d09dca9aae263671c4d32bbc7cb60dc378af8, they have the same font size that they would've had anyway.
2022-09-27Fix regression for results colorsGuillaume Gomez-1/+3
2022-09-27rustdoc: remove redundant `#help-button` CSSMichael Howell-5/+0
When the separate top and bottom styles were added in cd3f4da244578a2ab4d17d10016c61b9191b21e4, some of the CSS rules were needlessly duplicated. The `text-align: initial` rule on `.side-by-side` was always redundant, since the rules that centered the text were set on children, not parents.
2022-09-27rustdoc: use CSS containment to speed up renderJacob Hoffman-Andrews-13/+29
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Containment This affected layout a little and required adjustments to the CSS to keep spacing the same. In particular, the margins of adjacent items usually overlap with each other. However, when an item has contain: layout, any margins of child nodes push out the size of the item itself. This was making spacing between items a little too big. To solve that, I removed margins in some places: in particular for certain classes that often occur at the end of a `details.rustdoc-toggle` block, I removed their bottom margin. Generally, the margins provided by the next item down are sufficient. Also remove an unnecessary margin-top on .code-header.
2022-09-26Rollup merge of #102325 - notriddle:notriddle/line-number, r=GuillaumeGomezMichael Howell-27/+27
rustdoc: give `.line-number` / `.line-numbers` meaningful names
2022-09-26rustdoc: remove no-op CSS `.srclink { font-weight; font-size }`Michael Howell-7/+0
When this CSS was added in 34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9, source links were nested below headers. https://github.com/rust-lang/rust/blob/34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9/src/librustdoc/html/render.rs#L4015-L4019 Now, thanks to 458e7219bc2a62f72368279945cfda632a016da1, they are now siblings of headers, and thanks to 270d09dca9aae263671c4d32bbc7cb60dc378af8, they have the same font size that they would've had anyway.
2022-09-26rustdoc: simplify example-line-numbers CSS selectorMichael Howell-4/+4
2022-09-26rustdoc: give `.line-number` / `.line-numbers` meaningful namesMichael Howell-27/+27
2022-09-26rustdoc: merge `table { border-collapse } into `.docblock table`Michael Howell-4/+1
This was added in 510107815fe888319028c5e96001cdee70e7a931, to fix the display of the module items and search results tables (see the discussion in https://github.com/rust-lang/rust/pull/86725). Those aren't tables any more. The only remaining table is in docblock, which needs this attribute to look right.
2022-09-26rustdoc: remove unneeded CSS `td, th { padding 0 }`Michael Howell-5/+0
This was added in 510107815fe888319028c5e96001cdee70e7a931, to fix the display of the module items and search results tables (see the discussion in https://github.com/rust-lang/rust/pull/86725). Those aren't tables any more. The only remaining table is in docblock, which has its own padding declarations.
2022-09-25rustdoc: clean up `.out-of-band`/`.in-band` CSSMichael Howell-13/+7
* Remove the `float: right` fallback from the main header, which hasn't been needed since IE11 support was dropped. * Remove `in-band` from low-level headers, which hasn't been needed since `.rightside` switched to `float: right` in 593d6d1cb15c55c88319470dabb40126c7b7f1e2 * Remove unreachable `.in-band > code, .in-band > .code-header` CSS, since the `in-band` class was attached to the `code-header` itself, not nested directly below it. * Use `rem` instead of `em` for code header margins. * This results in a slight change in spacing around impls and item-info, but since it makes it more consistent with the way methods are presented, it's probably fine.
2022-09-25Rollup merge of #102242 - notriddle:notriddle/summary, r=GuillaumeGomezMatthias Krüger-4/+0
rustdoc: remove unused CSS `.summary` It was added in 4d16de01d0beb84dc4a351022ea5cb587b4ab557 as part of a stability dashboard that was removed in 0a46933c4d81573e78ce16cd215ba155a3114fce.
2022-09-24rustdoc: remove unused CSS `.summary`Michael Howell-4/+0
It was added in 4d16de01d0beb84dc4a351022ea5cb587b4ab557 as part of a stability dashboard that was removed in 0a46933c4d81573e78ce16cd215ba155a3114fce.
2022-09-24rustdoc: remove unused CSS `#main-content > .line-numbers`Michael Howell-4/+0
This selector was added in 10b937028660e079cf15735cfb5c4d58892fb10e. It became unreachable when 09150f81930e035254e58ee56f5905c2eb421617 made it so that `.line-numbers` are always nested below `.example-wrap`, even on source pages.
2022-09-24Rollup merge of #102203 - notriddle:notriddle/source-sidebar, r=GuillaumeGomezMatthias Krüger-5/+0
rustdoc: remove no-op CSS `#source-sidebar { z-index }` This rule became redundant in 07e3f998b1ceb4b8d2a7992782e60f5e776aa114. When `#source-sidebar` became nested below `.sidebar`, it went from being `position: fixed` to `position: static`, and according to MDN's [z-index] documentation, this means it has no effect. [z-index]: https://developer.mozilla.org/en-US/docs/Web/CSS/z-index
2022-09-24Rollup merge of #102146 - notriddle:notriddle/sidebar-jank, r=GuillaumeGomezMatthias Krüger-1/+1
rustdoc: CSS prevent sidebar width change jank This commit makes the `width` and `min-width` of the sidebar the same. They originally were when cad0fce2053d52b7ba04c458f4c124c8b5c6141e added the `min-width` rule, but 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c changed the `width` without changing the `min-width`, causing it to sometimes oscilate between 200 and 250 pixels depending on the main content. # Before [Screencast from 09-22-2022 10:25:29 AM.webm](https://user-images.githubusercontent.com/1593513/191813469-ea00f30f-6f49-40fc-9a26-e1dfd5068d2b.webm) # After [Screencast from 09-22-2022 10:32:20 AM.webm](https://user-images.githubusercontent.com/1593513/191813642-ae0902da-5262-403a-bbdf-995334201acb.webm)
2022-09-23rustdoc: remove no-op CSS rule `#source-sidebar { z-index: 1 }`Michael Howell-1/+0
This rule became redundant in 07e3f998b1ceb4b8d2a7992782e60f5e776aa114. When `#source-sidebar` became nested below `.sidebar`, it went from being `position: fixed` to `position: static`, and according to MDN's [z-index] documentation, this means it has no effect. [z-index]: https://developer.mozilla.org/en-US/docs/Web/CSS/z-index
2022-09-23rustdoc: remove no-op mobile CSS `#source-sidebar { z-index: 11 }`Michael Howell-4/+0
This rule became redundant in 07e3f998b1ceb4b8d2a7992782e60f5e776aa114. When `#source-sidebar` became nested below `.sidebar`, it went from being `position: fixed` to `position: static`, and according to MDN's [z-index] documentation, this means it has no effect. [z-index]: https://developer.mozilla.org/en-US/docs/Web/CSS/z-index
2022-09-23rustdoc: CSS prevent sidebar width change jankMichael Howell-1/+1
This commit makes the `width` and `min-width` of the sidebar the same. They originally were when cad0fce2053d52b7ba04c458f4c124c8b5c6141e added the `min-width` rule, but 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c changed the width without changing the `min-width`, causing it to sometimes oscilate between 200 and 250 pixels depending on the main content.
2022-09-23Rollup merge of #102158 - notriddle:notriddle/stab-p, r=GuillaumeGomezMatthias Krüger-4/+0
rustdoc: clean up CSS/DOM for deprecation warnings Preview: https://notriddle.com/notriddle-rustdoc-test/stab-p/std/macro.try.html
2022-09-23Auto merge of #102165 - matthiaskrgr:rollup-n5oquhe, r=matthiaskrgrbors-1/+0
Rollup of 8 pull requests Successful merges: - #100734 (Split out async_fn_in_trait into a separate feature) - #101664 (Note if mismatched types have a similar name) - #101815 (Migrated the rustc_passes annotation without effect diagnostic infrastructure) - #102042 (Distribute rust-docs-json via rustup.) - #102066 (rustdoc: remove unnecessary `max-width` on headers) - #102095 (Deduplicate two functions that would soon have been three) - #102104 (Set 'exec-env:RUST_BACKTRACE=0' in const-eval-select tests) - #102112 (Allow full relro on powerpc64-unknown-linux-gnu) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-09-23Rollup merge of #102066 - notriddle:notriddle/headers-max-width, ↵Matthias Krüger-1/+0
r=GuillaumeGomez rustdoc: remove unnecessary `max-width` on headers This code was added in 003b2bc1c65251ec2fc80b78ed91c43fb35402ec to prevent these headers from overlapping `.out-of-band` side items. That stopped being a problem when 3f92ff34b5a2fe8dd1a32aa27d437519e63782f0 switched rustdoc over to using `float`, rather than `position: absolute`, to implement this.
2022-09-22rustdoc: clean up CSS/DOM for deprecation warningsMichael Howell-4/+0
2022-09-22Rollup merge of #102147 - notriddle:notriddle/location-border-none, ↵Matthias Krüger-4/+0
r=GuillaumeGomez rustdoc: remove no-op CSS `.location:empty { border: none }` This rule was added in 2bb2a2975f25e8ba7a372898e7e112f1cec5db01 to remove a border placed around the location when it's empty. That rule was removed in 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c, so this rule does nothing.
2022-09-22Rollup merge of #102125 - notriddle:notriddle/content-item-info, ↵Matthias Krüger-1/+0
r=GuillaumeGomez rustdoc: remove no-op CSS `.content .item-info { position: relative }` This rule was added to help position the marker line in 110e7270ab7b0700ce714b8b1c7e509195dea2c4, which was a `position: absolute` pseudo-element that relied on its parent to put it in the right spot. (it was changed from a line to an arrow in 1ffb9cf8d75e6f8b9aa27a25c7bc56c7bb3a1c43, then a different arrow in ae3a53ff58cec7aca1dfd17479fca44b7f91491f). The arrow was removed in 73d0f7c7b68784f1db0a1f53855c20d118a7e8b0, so the `relative` position is no longer necessary.
2022-09-22Rollup merge of #102118 - notriddle:notriddle/line-numbers, r=GuillaumeGomezMatthias Krüger-16/+38
rustdoc: clean up line numbers on code examples * First commit switches from `display: inline-flex; width: 100%` to `display: flex`. `display: inline-flex` was used as part of https://github.com/rust-lang/rust/commit/e961d397cab900c55f8d8c104648852e2b63664e, the original commit that added these line numbers. Does anyone know why it was done this way? * Second commit makes it so that toggling this checkbox will update the page in real time, just like changing themes does. Preview: https://notriddle.com/notriddle-rustdoc-test/line-numbers/std/vec/struct.Vec.html
2022-09-22rustdoc: remove no-op CSS `.location:empty { border: none }`Michael Howell-4/+0
This rule was added in 2bb2a2975f25e8ba7a372898e7e112f1cec5db01 to remove a border placed around the location when it's empty. That rule was removed in 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c, so this rule does nothing.
2022-09-21rustdoc: remove no-op CSS `.content .item-info { position: relative }`Michael Howell-1/+0
This rule was added to help position the marker line in 110e7270ab7b0700ce714b8b1c7e509195dea2c4, which was a `position: absolute` pseudo-element that relied on its parent to put it in the right spot. The arrow was removed in 73d0f7c7b68784f1db0a1f53855c20d118a7e8b0, so the `relative` position is no longer necessary.
2022-09-21rustdoc: remove unnecessary `max-width` on headersMichael Howell-1/+0
This code was added in 003b2bc1c65251ec2fc80b78ed91c43fb35402ec to prevent these headers from overlapping `.out-of-band` side items. That stopped being a problem when 3f92ff34b5a2fe8dd1a32aa27d437519e63782f0 switched rustdoc over to using `float`, rather than `position: absolute`, to implement this.
2022-09-22Rollup merge of #102100 - GuillaumeGomez:stab-in-docblocks, r=notriddleYuki Okushi-0/+6
Prevent usage of .stab elements to create scrollable areas in doc blocks Fixes #101874. You can test it online [here](https://rustdoc.crud.net/imperio/stab-in-doblocks/foo/index.html). r? `@notriddle`
2022-09-21rustdoc: dynamically show-hide line numbers on code examplesMichael Howell-11/+37
2022-09-21rustdoc: use block flex for line-number CSSMichael Howell-5/+1
`display: inline-flex` was used as part of e961d397cab900c55f8d8c104648852e2b63664e, the original commit that added these line numbers. Does anyone know why it was done this way?
2022-09-21Prevent usage of `.stab` elements to create scrollable areas in doc blocksGuillaume Gomez-0/+6
2022-09-20rustdoc: remove no-op `.method { position: relative }`Michael Howell-3/+0
This rule was added in 88fe6dfa31a1bee49090dc72c537c5cd7bd632f4 to assist in position the hide/show togges on methods. This is no longer needed, because these toggles are no longer implemented as absolutely positioned links nested inside headers.
2022-09-20rustdoc: remove no-op `.method { font-size: 1rem }`Michael Howell-1/+0
This rule was added in 22dad4b0440b184568956c10f2cbedabf763065a, back when the `method` class was attached to headers instead of DIVs that wrap headers. Old method rendering: https://github.com/rust-lang/rust/blob/a96247bcac385671757034bd928c13097fd2ce76/src/librustdoc/html/render.rs#L2062 Current method rendering: https://github.com/rust-lang/rust/blob/432abd86f231c908f6df3cdd779e83f35084be90/src/librustdoc/html/render/print_item.rs#L721
2022-09-20Rollup merge of #102034 - notriddle:notriddle/border-bottom, r=GuillaumeGomezMichael Howell-7/+0
rustdoc: remove no-op CSS `h1-6 { border-bottom-color }` For this rule to have an actual effect, the border-bottom width needs specified, elsewhere, without also specifying the color. This doesn't happen. Ever since 88b137d5fe0cbe28dab4f9af61045c726f831872, every spot where headers get a border assigned to them also assigns the color. Preview: https://notriddle.com/notriddle-rustdoc-test/border-bottom/rustc_monomorphize/collector/index.html
2022-09-20Rollup merge of #102027 - notriddle:notriddle/docblock-item-decl, ↵Michael Howell-3/+0
r=GuillaumeGomez rustdoc: remove `docblock` class from `item-decl` This class was originally added in 73b97c7e7c9cfac4dfa4804654b1db6ab687b589 to support hiding and showing the item, because `main.js` went through all `docblock` elements in the DOM and added toggles to them. https://github.com/rust-lang/rust/blob/73b97c7e7c9cfac4dfa4804654b1db6ab687b589/src/librustdoc/html/static/main.js#L1856-L1867 The `item-decl` is no longer auto-hidden since c96f86de3026f864e78397aff9097e885f2f8fdf removed it. `item-decl` used to be called `type-decl`: that name was changed in 8b7a2dd4626acf164e1ce8397878b3f5af83d585. The `docblock` class is no longer used for implementing toggles, since rustdoc switched to using `<details>` elements. Preview: https://notriddle.com/notriddle-rustdoc-test/docblock-item-decl/rustdoc/clean/types/enum.Type.html
2022-09-19rustdoc: remove no-op CSS `h1-6 { border-bottom-color }`Michael Howell-7/+0
For this rule to have an actual effect, the border-bottom width needs specified, elsewhere, without also specifying the color. This doesn't happen. Ever since 88b137d5fe0cbe28dab4f9af61045c726f831872, every spot where headers get a border assigned to them also assigns the color.
2022-09-19rustdoc: remove `docblock` class from `item-decl`Michael Howell-3/+0
This class was originally added in 73b97c7e7c9cfac4dfa4804654b1db6ab687b589 to support hiding and showing the item, because `main.js` went through all `docblock` elements in the DOM and added toggles to them. https://github.com/rust-lang/rust/blob/73b97c7e7c9cfac4dfa4804654b1db6ab687b589/src/librustdoc/html/static/main.js#L1856-L1867 The `item-decl` is no longer auto-hidden since c96f86de3026f864e78397aff9097e885f2f8fdf removed it. `item-decl` used to be called `type-decl`: that name was changed in 8b7a2dd4626acf164e1ce8397878b3f5af83d585. The `docblock` class is no longer used for implementing toggles, since rustdoc switched to using `<details>` elements.
2022-09-18rustdoc: remove unused CSS `td.summary-column`Michael Howell-4/+0
It was added in 2a1bad70dd9bc99d8db54964108b42da8f4e9fbd to go with this module summary function: https://github.com/rust-lang/rust/blob/2a1bad70dd9bc99d8db54964108b42da8f4e9fbd/src/librustdoc/html/format.rs#L767-L780 The corresponding HTML was removed in 0a46933c4d81573e78ce16cd215ba155a3114fce.
2022-09-18Rollup merge of #101954 - notriddle:notriddle/location-a-first-of-type, ↵Matthias Krüger-4/+0
r=GuillaumeGomez rustdoc: remove redundant `.location a { font-weight: 500 }` The `class="location"` element is an h2, either in the sidebar or in the mobile header. Either way, it already has `font-weight: 500`, which the link inside will inherit. The original version of this rule was added in 9e82fc7ef9b6c8a344dd27583990b02a661af78c. At that time, the location header was rendered as a paragraph with the full path: https://github.com/rust-lang/rust/blob/9e82fc7ef9b6c8a344dd27583990b02a661af78c/src/librustdoc/html/render.rs#L2080 Nowadays, it's rendered as a true header, with only the name of the item, and the full path is included in a separate `fqn` header: https://github.com/rust-lang/rust/blob/98ad6a5519651af36e246c0335c964dd52c554ba/src/librustdoc/html/render/mod.rs#L1797
2022-09-17rustdoc: remove redundant `.location a { font-weight: 500 }`Michael Howell-4/+0
The `class="location"` element is an h2, either in the sidebar or in the mobile header. Either way, it already has `font-weight: 500`, which the link inside will inherit. The original version of this rule was added in 9e82fc7ef9b6c8a344dd27583990b02a661af78c. At that time, the location header was rendered as a paragraph with the full path: https://github.com/rust-lang/rust/blob/9e82fc7ef9b6c8a344dd27583990b02a661af78c/src/librustdoc/html/render.rs#L2080 Nowadays, it's rendered as a true header, with only the name of the item, and the full path is included in a separate `fqn` header: https://github.com/rust-lang/rust/blob/98ad6a5519651af36e246c0335c964dd52c554ba/src/librustdoc/html/render/mod.rs#L1797
2022-09-17Auto merge of #101949 - matthiaskrgr:rollup-xu5cqnd, r=matthiaskrgrbors-4/+0
Rollup of 7 pull requests Successful merges: - #101093 (Initial version of 1.64 release notes) - #101713 (change AccessLevels representation) - #101821 (Bump Unicode to version 15.0.0, regenerate tables) - #101826 (Enforce "joined()" and "joined_with_noop()" test) - #101835 (Allow using vendoring when running bootstrap from outside the source root) - #101942 (Revert "Copy stage0 binaries into stage0-sysroot") - #101943 (rustdoc: remove unused CSS `.non-exhaustive { margin-bottom }`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-09-17Rollup merge of #101934 - GuillaumeGomez:theme-links-cleanup, r=notriddleMatthias Krüger-78/+67
Continue migration of CSS themes Now that https://github.com/rust-lang/rust/pull/101898 has been merged, we can move forward. This PR moves more CSS theme rules as CSS variables. I also added a GUI test to prevent regressions. Part of https://github.com/rust-lang/rust/pull/98460. r? ``@notriddle``
2022-09-17Rollup merge of #101918 - notriddle:notriddle/all, r=GuillaumeGomezMatthias Krüger-6/+3
rustdoc: clean up CSS for All Items and All Crates lists This reduces the amount of CSS, and makes these two pages more consistent (which, necessarily, means changing them a bit). # Before ![image](https://user-images.githubusercontent.com/1593513/190735035-c66b2664-3783-483c-9bc6-89f80e4a5490.png) ![image](https://user-images.githubusercontent.com/1593513/190735134-1d5df81d-58c5-4c86-b066-6dd3031ffc2e.png) # After ![image](https://user-images.githubusercontent.com/1593513/190735261-fc3878bb-0cab-4c4e-a6da-b5f7abd06588.png) ![image](https://user-images.githubusercontent.com/1593513/190735389-935a7836-f2c0-4349-a7d0-7fe5378f6b9a.png)