about summary refs log tree commit diff
path: root/src/librustdoc/html/static/css/rustdoc.css
AgeCommit message (Collapse)AuthorLines
2022-09-26Rollup merge of #102325 - notriddle:notriddle/line-number, r=GuillaumeGomezMichael Howell-9/+9
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-1/+1
2022-09-26rustdoc: give `.line-number` / `.line-numbers` meaningful namesMichael Howell-9/+9
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-12/+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-5/+1
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: 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-0/+43
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)
2022-09-17rustdoc: remove unused CSS `.non-exhaustive { margin-bottom }`Michael Howell-4/+0
This selector was added in 959a13d53e27ca92b59798e6c6737f8249d59a2e to target a `<div class="non-exhaustive">`. With 4edcf6147912e7e4c1f13208d830c3c25e544a8c, the non-exhaustive indicator was changed to a `<details>`, and a separate selector targetting `details.non-exhaustive` was added for it, but the old selector was never removed.
2022-09-16rustdoc: clean up CSS for All Items and All Crates listsMichael Howell-6/+3
This reduces the amount of CSS, and makes these two pages more consistent (which, necessarily, means changing them a bit).
2022-09-16rustdoc: remove no-op CSS `.source .content { max-width: none }`Michael Howell-1/+0
This rule originated in 7669f04fb0ddc3d71a1fb44dc1c5c00a6564ae99, to override the default, limited line-width that makes sense for prose, but doesn't make sense for code (which typically uses hard-wrapped lines): https://github.com/rust-lang/rust/blob/7669f04fb0ddc3d71a1fb44dc1c5c00a6564ae99/src/librustdoc/html/static/main.css#L153 This line width limiter isn't applied to the `<div class="content">` node any more. It's been moved to a separate wrapper `<div>` that used to be called `main-inner` (in 135281ed1525db15edd8ebd092aa10aa40df2386) but is now called `width-limiter` (since d7528e2157762fadb9665518fd1e4dee6d6a2809).
2022-09-16rustdoc: remove no-op CSS `.source .content { margin-left: 0 }`Michael Howell-1/+0
This rule originated in 7669f04fb0ddc3d71a1fb44dc1c5c00a6564ae99, to override the default, massive left margin that content used to accommodate the sidebar: https://github.com/rust-lang/rust/blob/7669f04fb0ddc3d71a1fb44dc1c5c00a6564ae99/src/librustdoc/html/static/main.css#L307-L309 This massive left margin doesn't exist any more. It was replaced with a flexbox-based sidebar layout in 135281ed1525db15edd8ebd092aa10aa40df2386.
2022-09-16Create new CSS variables for links colorGuillaume Gomez-0/+43
2022-09-16Rollup merge of #101877 - notriddle:notriddle/block, r=Dylan-DPCGuillaume Gomez-3/+0
rustdoc: remove no-op CSS `.block { padding: 0 }` This rule was changed in 8fb1250aba8135679463351a3813c04ae45bf311 from the original version that had a non-zero padding. It's not needed, because it's not overriding anything that would've given `.block` a padding.
2022-09-16Rollup merge of #101494 - jsha:notable-traits-right, r=GuillaumeGomezGuillaume Gomez-6/+0
rustdoc mobile: move notable traits to return type These were originally on the left, but were moved to the return type in c90fb7185a5febb00b7f8ccb49abceacd41bad6e. The CSS rule for mobile did not get updated at the time, so updating it now. r? `@notriddle`
2022-09-15rustdoc: remove no-op CSS `.block { padding: 0 }`Michael Howell-3/+0
This rule was changed in 8fb1250aba8135679463351a3813c04ae45bf311 from the original version that had a non-zero padding. It's not needed, because it's not overriding anything that would've given `.block` a padding.
2022-09-15rustdoc: remove no-op CSS `h1-4 { color: --main-color }`Michael Howell-1/+0
Headers already inherit the font color they need from their parents. This rule dates back to earlier versions of the rustdoc theme, where headers and body had different text colors. https://github.com/rust-lang/rust/blob/68c15be8b5a28297ae58ea030adf49f265e41127/src/librustdoc/html/static/main.css#L72-L98 Nowadays, since the two have exactly the same color (specified by the `--main-color` variable), this rule does nothing.
2022-09-15Rollup merge of #101820 - notriddle:notriddle/a, r=GuillaumeGomezMatthias Krüger-1/+0
rustdoc: remove no-op rule `a { background: transparent }` The background is transparent by default. It was added in 5a01dbe67b43660bf1df96074f34a635aad50e56 to work around a bug in the JavaScript syntax highlighting engine that rustdoc used at the time.