| Age | Commit message (Collapse) | Author | Lines |
|
rustdoc: clean up CSS `#titles` using flexbox
This commit allows it to stop manually specifying pixel heights for the tabs on search result pages. There's less messing with manual breakpoints and less complex CSS selectors.
# Before

# After

|
|
rustdoc: clean up DOM by removing `.dockblock-short p`
On https://doc.rust-lang.org/nightly/std/ this reduces the number out of `document.querySelectorAll("*").length` from 1278 to 1103.
Preview: https://notriddle.com/notriddle-rustdoc-test/docblock-short-p/std/index.html
|
|
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.
|
|
This commit allows it to stop manually specifying pixel heights for the tabs
on search result pages. There's less messing with manual breakpoints and
less complex CSS selectors.
|
|
rustdoc: remove outdated CSS `.content table` etc
# Screenshot before

# Screenshot after

# Description
The `.content table` / `.content td` / `.content tr` family of selectors date back to 4fd061c426902b0904c65e64a3780b21f9ab3afb, when module indexes and other parts of rustdoc used `<table>` tags for layout and content presentation. The `.content td h1, .content td h2` has only been changed since then to tweak the font size in dd5ff428edbc7cd4fa600b81f27bbec28589704f.
https://github.com/rust-lang/rust/blob/4fd061c426902b0904c65e64a3780b21f9ab3afb/src/rustdoc_ng/html/static/main.css#L155-L162
This CSS would have affected:
* search result tables, which were removed in b615c0c85469c94041a5e68b9d8b68dcf799f9f1
* module item tables, which were removed in 6020c79ddeafe8d9760b27c14c39da81bac9b4a6
* docblock tables from markdown, which still exist
It may also have affected a few other tables over the last decade, but they've been gradually replaced with grid layouts and flexbox to make layouts that work better on narrow viewports. For example, 34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9.
These rules have no affect on the appearance of docblock tables
---------------------------------------------------------------
.content table {
border-spacing: 0 5px;
}
According to MDN, [border-spacing] only has an effect when `border-collapse` is `separate`. However, `border-collapse: collapse` is set globally for all tables, so this rule does nothing.
[border-spacing]: https://developer.mozilla.org/en-US/docs/Web/CSS/border-spacing
.content td p:first-child { margin-top: 0; }
Tables with paragraphs in them are impossible without dropping down to raw HTML. Also, the rustdoc stylesheet sets paragraphs to have no top margin anyway, so this rule is a no-op.
.content td h1, .content td h2 { margin-left: 0; font-size: 1.125rem; }
Tables with headers in them are impossible without dropping down to raw HTML. This is considered unlikely, especially since it looks weird right now (`.docblock h2` has an underline that is redundant with the table cell's own border).
.content tr:first-child td { border-top: 0; }
This has no effect because of border collapsing.
This rule is removed, because tables look fine without it
---------------------------------------------------------
.content td:first-child { padding-right: 20px; }
By removing this rule, the first cell in each row has the same padding as all other cells in the row.
This rule is kept, and converted to directly target `.docblock`
---------------------------------------------------------------
.content td { vertical-align: top; }
Removing this rule would cause it to be aligned to the middle instead.
|
|
r=GuillaumeGomez
rustdoc: remove redundant CSS `.out-of-band > span.since { position }`
At the time this CSS was added, it was just `span.since`, because the version info could be rendered in two different ways:
1. `<div class='since'>` was used for associated items like methods. It was absolutely positioned, and the selector in rustdoc.css that targetted it was just `.since`.
https://github.com/rust-lang/rust/blob/a5a2f2b951ea982a666eaf52b1874d8f1b17290b/src/librustdoc/html/static/rustdoc.css#L522-L529
2. `<span class='since'>` was introduced in a5a2f2b951ea982a666eaf52b1874d8f1b17290b for page-global version info, so that it could be laid out alongside the `[-]`/`[+]` button. This CSS rule was added to override the absolute position introduced in (1).
https://github.com/rust-lang/rust/blob/a5a2f2b951ea982a666eaf52b1874d8f1b17290b/src/librustdoc/html/static/rustdoc.css#L637-L641
The selector was changed in 8fc6e420d16dc882f2047e6ec1b981cac5ef0d14 so that everything could use a `<span>` tag, but the dichotomy of the absolutely-positioned version info for associated items and the static positioned item version info remained.
The absolutely positioned `.since` was changed to one nested below a `<div class="rightside">` container in 5de1391b88007a1d4f7b1517657a86aae352af1e, so the version information is now always statically-positioned, and, as described in the commit message, "their DOM representation is consistent."
|
|
On https://doc.rust-lang.org/nightly/std/ this reduces the number out of
`document.querySelectorAll("*").length` from 1278 to 1103.
|
|
notriddle:notriddle/search-results-result-name-span, r=GuillaumeGomez
rustdoc: remove no-op CSS `.search-results .result-name > span`
The rule `display: inline-block` was added in 5afa52bc7dee683f25f437dddf338dbc6ad32eb8. The `margin: 0` and `font-weight: normal` were added in c01bd560e2f87a9a960ed071213edd70f73171a8.
Both seem to have been added to override class-based rules that were targetted at method sections. See <https://github.com/rust-lang/rust/blob/c01bd560e2f87a9a960ed071213edd70f73171a8/src/librustdoc/html/static/rustdoc.css#L140-L148> for an example. The selectors that these were meant to override were changed in a8318e420d19c364b1eec33956a86164941f6df4 and 76a3b609d0b93c5d8da5e4e3db37bd03e5cb1c30 to be more specific, so they no longer need to be overridden.
|
|
The `.content table` / `.content td` / `.content tr` family of selectors date
back to 4fd061c426902b0904c65e64a3780b21f9ab3afb, when module indexes and
other parts of rustdoc used `<table>` tags for layout and content
presentation. The `.content td h1, .content td h2` has only been changed
since then to tweak the font size in
dd5ff428edbc7cd4fa600b81f27bbec28589704f.
https://github.com/rust-lang/rust/blob/4fd061c426902b0904c65e64a3780b21f9ab3afb/src/rustdoc_ng/html/static/main.css#L155-L162
This CSS would have affected:
* search result tables, which were removed in
b615c0c85469c94041a5e68b9d8b68dcf799f9f1
* module item tables, which were removed in
6020c79ddeafe8d9760b27c14c39da81bac9b4a6
* docblock tables from markdown, which still exist
It may also have affected a few other tables over the last decade, but
they've been gradually replaced with grid layouts and flexbox to make layouts
that work better on narrow viewports. For example,
34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9.
These rules have no affect on the appearance of docblock tables
===============================================================
.content table {
border-spacing: 0 5px;
}
According to MDN, [border-spacing] only has an effect when `border-collapse`
is `separate`. However, `border-collapse: collapse` is set globally for all
tables, so this rule does nothing.
[border-spacing]: https://developer.mozilla.org/en-US/docs/Web/CSS/border-spacing
.content td p:first-child { margin-top: 0; }
Tables with paragraphs in them are impossible without dropping down to raw
HTML. Also, the rustdoc stylesheet sets paragraphs to have no top margin
anyway, so this rule is a no-op.
.content td h1, .content td h2 { margin-left: 0; font-size: 1.125rem; }
Tables with headers in them are impossible without dropping down to raw HTML.
This is considered unlikely, especially since it looks weird right now
(`.docblock h2` has an underline that is redundant with the table cell's own
border).
.content tr:first-child td { border-top: 0; }
This has no effect because of border collapsing.
This rule is removed, because tables look fine without it
=========================================================
.content td:first-child { padding-right: 20px; }
By removing this rule, the first cell in each row has the same padding as all
other cells in the row.
This rule is kept, and converted to directly target `.docblock`
===============================================================
.content td { vertical-align: top; }
Removing this rule would cause it to be aligned to the middle instead.
|
|
At the time this CSS was added, it was just `span.since`, because the
version info could be rendered in two different ways:
1. `<div class='since'>` was used for associated items like methods. It
was absolutely positioned, and the selector in rustdoc.css that
targetted it was just `.since`.
https://github.com/rust-lang/rust/blob/a5a2f2b951ea982a666eaf52b1874d8f1b17290b/src/librustdoc/html/static/rustdoc.css#L522-L529
2. `<span class='since'>` was introduced in
a5a2f2b951ea982a666eaf52b1874d8f1b17290b for page-global version info,
so that it could be laid out alongside the `[-]`/`[+]` button. This CSS
rule was added to override the absolute position introduced in (1).
https://github.com/rust-lang/rust/blob/a5a2f2b951ea982a666eaf52b1874d8f1b17290b/src/librustdoc/html/static/rustdoc.css#L637-L641
The selector was changed in 8fc6e420d16dc882f2047e6ec1b981cac5ef0d14 so
that everything could use a `<span>` tag, but the dichotomy of the
absolutely-positioned version info for associated items and the static
positioned item version info remained.
The absolutely positioned `.since` was changed to one nested below a
`<div class="rightside">` container in
5de1391b88007a1d4f7b1517657a86aae352af1e, so the version information is now
always statically-positioned, and, as described in the commit message,
"their DOM representation is consistent."
|
|
These two elements are always nested below `<nav class="sidebar">`, and will
inherit the font from their parent.
These selectors were added in 93520d2ad145b791b1b1a6c71cdea65b1943ffb6, and
became redundant in 07e3f998b1ceb4b8d2a7992782e60f5e776aa114 when the source
sidebar elements became nested below `nav.sidebar`.
|
|
The rule `display: inline-block` was added in
5afa52bc7dee683f25f437dddf338dbc6ad32eb8.
The `margin: 0` and `font-weight: normal` were added in
c01bd560e2f87a9a960ed071213edd70f73171a8.
Both seem to have been added to override class-based rules that were
targetted at method sections. See
<https://github.com/rust-lang/rust/blob/c01bd560e2f87a9a960ed071213edd70f73171a8/src/librustdoc/html/static/rustdoc.css#L140-L148>
for an example. The selectors that these were meant to override were changed
in a8318e420d19c364b1eec33956a86164941f6df4 and
76a3b609d0b93c5d8da5e4e3db37bd03e5cb1c30 to be more specific, so they no
longer need to be overridden.
|
|
The padding rule was added in 135281ed1525db15edd8ebd092aa10aa40df2386 when
converting the rule for #main, but didn't do anything even then.
|
|
This rule was added in c729e4dca7581fcd060978bcb0d7f98ea4eb6b82 to remove an
unnecessary left margin that was present on desktop. This desktop-mode margin
was itself removed in 135281ed1525db15edd8ebd092aa10aa40df2386.
|
|
Simplify codeblock and their associated tooltip
It is based on https://github.com/rust-lang/rust/pull/101600 so it needs to wait for this one to be merged first.
This PR does two things:
* Remove CSS class duplication by setting CSS classes such as `compile_fail` directly on the `div` wrapping both the codeblock and the tooltip.
* Simplify DOM: no need to wrap the tooltip into a `<div>`, it can work just as well without it.
You can test it [here](https://rustdoc.crud.net/imperio/codeblock-tooltip/std/string/struct.String.html#deref).
r? `@notriddle`
|
|
|
|
rustdoc: remove unused CSS `#search { position: relative }`
This was added in 611d0e6ccef8b60fa86ff5aa8fe3571cd36c444a, to allow its child `#results` element to be absolutely positioned inside it. The child stopped being absolute in 8c0469552e879f6319f8f96db660bab9eae1de5c.
To keep the layout looking the same, the links need to not have `width: 100%` any more, relying instead on the box naturally growing to fit because it has `display: block`.
|
|
This was added in 611d0e6ccef8b60fa86ff5aa8fe3571cd36c444a, to allow its
child `#results` element to be absolutely positioned inside it. The
child stopped being absolute in 8c0469552e879f6319f8f96db660bab9eae1de5c.
To keep the layout looking the same, the links need to not have
`width: 100%` any more, relying instead on the box naturally growing to
fit because it has `display: block`.
|
|
rustdoc: simplify the codeblock tooltip
**https://github.com/rust-lang/rust/pull/101593 needs merged first**
This PR moves the tooltip into example-wrap, simplifying several overly-complex aspects of how these tooltips work:
* The mousover javascript can be removed, because hovering example-wrap can style the tooltip inside.
* The sibling selecor can be removed, because hovering the tooltip also hovers the wrapper, which can hover the codeblock itself.
* The relative positioning of the `<li>` tag, which was added in https://github.com/rust-lang/rust/commit/e861efd9f9ca45c1048a256812dfe8faffbb1367 to fix the positioning of the code tooltip, can now be removed, because example-wrap itself already has relative positioning.
|
|
This commit moves the tooltip into example-wrap, simplifying allowing several
overly-complex things to be fixed:
* The mousover javascript can be removed, because hovering example-wrap can
style the tooltip inside.
* The sibling selecor can be removed, because hovering the tooltip also
hovers the wrapper, which can hover the codeblock itself.
* The relative positioning of the `<li>` tag, which was added in
e861efd9f9ca45c1048a256812dfe8faffbb1367 to fix the positioning of the code
tooltip, can now be removed, because example-wrap itself already has
relative positioning.
|
|
Cleanup themes (tooltip)
No changes in the UI. I used this opportunity to unify the dark theme with the others for the alpha parameter though.
r? `@notriddle`
|
|
|
|
rustdoc: remove no-op CSS `#settings-menu { padding: 0 }`
This CSS was added in 5e01ba36c9f1037c4cf3e7421413fc6c41f85d05, and served to override CSS right above it that set a 5px padding for several kinds of buttons in the same toolbar:
https://github.com/rust-lang/rust/blob/5e01ba36c9f1037c4cf3e7421413fc6c41f85d05/src/librustdoc/html/static/css/rustdoc.css#L1400-L1409
The CSS that it overrode is still there, but now it only applies to `#settings-menu > a`, so there's nothing to override.
https://github.com/rust-lang/rust/blob/24d69920201563f0ee7b530f1cda0f171b205cc2/src/librustdoc/html/static/css/rustdoc.css#L1445-L1454
|
|
r=GuillaumeGomez
rustdoc: remove unused CSS `div.impl-items > div`
This was added in 9077d540da944c41678a7129e04e7fc5d7e38582 to override the style on `<div>` tags that were acting as headers. These `<div>` tags were replaced with `<section>` tags in 32f62607c3142dfc9eb56a0bd72dee298ca43358, but this CSS was probably already redundant even then (the headers had already been replaced with real `<h3>` and `<h4>` tags in 76a3b609d0b93c5d8da5e4e3db37bd03e5cb1c30).
|
|
This CSS was added in 5e01ba36c9f1037c4cf3e7421413fc6c41f85d05, and served to
override CSS right above it that set a 5px padding for several kinds of
buttons in the same toolbar.
The CSS that it overrode is still there, but now it only applies to
`#settings-menu > a`, so there's nothing to override.
|
|
This was added in 9077d540da944c41678a7129e04e7fc5d7e38582 to override the
style on `<div>` tags that were acting as headers. These `<div>` tags were
replaced with `<section>` tags in 32f62607c3142dfc9eb56a0bd72dee298ca43358,
but this CSS was probably already redundant even then (the headers had
already been replaced with real `<h3>` and `<h4>` tags in
76a3b609d0b93c5d8da5e4e3db37bd03e5cb1c30).
|
|
This was added in 51f26acaea46afd630fbab4ca441748802d20670 to help with the
display of an `<h3>` tag that has a `<span class='in-band'>` inside.
The way implementation lists were rendered was changed in
34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9 to have `<code class='in-band'>`,
making this CSS unused.
Then it was turned into a `<div>` in 9077d540da944c41678a7129e04e7fc5d7e38582
without issue.
Finally, the header itself acquired the `in-band` class in
76a3b609d0b93c5d8da5e4e3db37bd03e5cb1c30.
|
|
r=GuillaumeGomez
rustdoc: remove unused CSS `.content .methods > div`
This selector has its roots in these commits:
* current version:
`.content .methods > div:not(.notable-traits):not(.method)` from 9077d540da944c41678a7129e04e7fc5d7e38582
* intermediate version:
`.content .methods > div:not(.important-traits)` from d86621f69e827361e47bc6c4b2c7fd5319155227
* original version:
`.content .methods > div { margin-left: 40px; }` from 0a46933c4d81573e78ce16cd215ba155a3114fce
Based on the call stack, where [`class='methods'`] calls `trait_item` and [`trait_item`] calls [`document`], this div selector was probably intended to target docblock and stability tags.
In the current version of the code, neither of these can possibly be nested directly below the `class='methods'` wrapper, because the [current version of the `trait_item` function] always wraps them in a `<details>` tag if they exist. The only div tag that can possibly be nested directly below it now is the one with class `method`, which is explicitly excluded.
[`class='methods'`]: https://github.com/rust-lang/rust/blob/0a46933c4d81573e78ce16cd215ba155a3114fce/src/librustdoc/html/render.rs#L1811-L1842
[`trait_item`]: https://github.com/rust-lang/rust/blob/0a46933c4d81573e78ce16cd215ba155a3114fce/src/librustdoc/html/render.rs#L1807
[`document`]: https://github.com/rust-lang/rust/blob/0a46933c4d81573e78ce16cd215ba155a3114fce/src/librustdoc/html/render.rs#L1515-L1523
[current version of the `trait_item` function]: https://github.com/rust-lang/rust/blob/e7c7aa7288559f8e5ea7ce3543ff946b09783628/src/librustdoc/html/render/print_item.rs#L710
|
|
r=GuillaumeGomez
rustdoc: remove unused mobile CSS `.rustdoc { flex-direction }`
According to MDN, [flex-direction] only applies to [flex containers], which are boxes with `display: flex` or `inline-flex`.
However, the `.rustdoc` body container is not a flex-container on mobile. A few lines above, it's set to `display: block`, so this selector does not have any effect.
[flex-direction]: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction
[flex containers]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox#the_flex_container
|
|
r=GuillaumeGomez
rustdoc: remove unused CSS `#main-content > table td`
This rule was added in 4e2c59a970695b2809a0f68f2ffe415ebdb04913 to benefit the module items table. However, the module items table stopped using table tags when 6020c79ddeafe8d9760b27c14c39da81bac9b4a6 switched us over to grid layout.
You can see when this one used to be triggered by visiting <https://doc.rust-lang.org/1.54.0/alloc/slice/index.html#structs-1> in a very narrow window, but it doesn't any more, because the module table is now rendered using `<div>` tags.
|
|
r=GuillaumeGomez
rustdoc: remove unused CSS `#main-content > .since`
I missed one from #101298
|
|
This rule was added in 4e2c59a970695b2809a0f68f2ffe415ebdb04913
to benefit the module items table. However, the module items table stopped
using table tags when 6020c79ddeafe8d9760b27c14c39da81bac9b4a6
switched us over to grid layout.
You can see when this one used to be triggered by visiting
<https://doc.rust-lang.org/1.54.0/alloc/slice/index.html#structs-1> in a
very narrow window, but it doesn't any more, because the module table is
now rendered using `<div>` tags.
|
|
This selector has its roots in these commits:
* current version:
`.content .methods > div:not(.notable-traits):not(.method)` from
9077d540da944c41678a7129e04e7fc5d7e38582
* intermediate version:
`.content .methods > div:not(.important-traits)` from
d86621f69e827361e47bc6c4b2c7fd5319155227
* original version:
`.content .methods > div { margin-left: 40px; }` from
0a46933c4d81573e78ce16cd215ba155a3114fce
Based on the call stack, where [`class='methods'`] calls `trait_item` and
[`trait_item`] calls [`document`], this div selector was probably intended to
target docblock and stability tags.
In the current version of the code, neither of these can possibly be nested
directly below the `class='methods'` wrapper, because the [current version of
the `trait_item` function] always wraps them in a `<details>` tag if they
exist. The only div tag that can possibly be nested directly below it now is
the one with class `method`, which is explicitly excluded.
[`class='methods'`]: https://github.com/rust-lang/rust/blob/0a46933c4d81573e78ce16cd215ba155a3114fce/src/librustdoc/html/render.rs#L1811-L1842
[`trait_item`]: https://github.com/rust-lang/rust/blob/0a46933c4d81573e78ce16cd215ba155a3114fce/src/librustdoc/html/render.rs#L1807
[`document`]: https://github.com/rust-lang/rust/blob/0a46933c4d81573e78ce16cd215ba155a3114fce/src/librustdoc/html/render.rs#L1515-L1523
[current version of the `trait_item` function]: https://github.com/rust-lang/rust/blob/e7c7aa7288559f8e5ea7ce3543ff946b09783628/src/librustdoc/html/render/print_item.rs#L710
|
|
According to MDN, [flex-direction] only applies to [flex containers], which
are boxes with `display: flex` or `inline-flex`.
However, the `.rustdoc` body container is not a flex-container on mobile.
A few lines above, it's set to `display: block`, so this selector does
not have any effect.
[flex-direction]: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction
[flex containers]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox#the_flex_container
|
|
r=GuillaumeGomez
rustdoc: remove outdated CSS `.sub-variant > div > .item-info`
This CSS still matches sometimes, as you can see in <https://doc.rust-lang.org/1.63.0/std/collections/enum.TryReserveErrorKind.html#variant.AllocError.fields>, but since nothing else is setting `margin-top`, putting it back to `initial` does nothing.
This selector was added here, but it was called `.stability` instead of `.item-info` at the time, probably as an override for the selector immediately above it that sets a negative margin:
https://github.com/rust-lang/rust/blob/2fd378b82b14f2746462018e8510e15a079818a0/src/librustdoc/html/static/rustdoc.css#L514-L522
That negative margin was removed in 593d6d1cb15c55c88319470dabb40126c7b7f1e2.
|
|
I missed one from 096efc29f1be25daca6675f5f7684780ff294613.
|
|
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.
|
|
This CSS still matches sometimes, as you can see in
<https://doc.rust-lang.org/1.63.0/std/collections/enum.TryReserveErrorKind.html#variant.AllocError.fields>,
but since nothing else is setting `margin-top`, putting it back to `initial`
does nothing.
This selector was added in 2fd378b82b14f2746462018e8510e15a079818a0 (but it
was called `.stability` instead of `.item-info` at the time), probably as an
override for the selector immediately above it that sets a negative margin.
That negative margin was removed in 593d6d1cb15c55c88319470dabb40126c7b7f1e2.
|
|
This code was added in 96ef2f8ab9bbea24b71c7441ee534407949848db to improve
rendering of the search results table, but results have not used a table
since b615c0c85469c94041a5e68b9d8b68dcf799f9f1 switched it to rendering with
`<div>` tags.
|
|
r=GuillaumeGomez
rustdoc: remove redundant mobile-sized `.source nav:not(.sidebar).sub`
It's redundant because there's already a selector `.source nav.sub` with exactly the same margin-left at [line 796].
[line 796]: https://github.com/rust-lang/rust/blob/84f0c3f79a85329dd79a54694ff8a7f427c842e9/src/librustdoc/html/static/css/rustdoc.css#L796
This selector was added in 1e98fb10274ea0245f865ddb1e295e454382000b, along with an identical desktop selector, but that desktop selector was removed in 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c as part of a larger simplification.
|
|
It's redundant because there's already a selector `.source nav.sub` with
exactly the same margin-left at line 796.
This selector was added in 1e98fb10274ea0245f865ddb1e295e454382000b, along
with an identical desktop selector, but that desktop selector was removed in
6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c as part of a larger simplification.
|
|
Added in 34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9
For this to actually do anything, [according to MDN] (and Firefox Dev Tools),
it must be a "flex item", which only happens if its a direct child of a node
with `display: flex` on it. It seems like it could not have worked at the time
when this rule was added, because the only items in `rustdoc.css` with
`display: flex` active were:
* `#help`
This should not contain anything like this.
* `.impl-items h4, h4.impl, h3.impl`
These are all headers, so they shouldn't contain `.impl-items` either.
* `.content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant`
Associated constants and methods definitely shouldn't contain a list of impl
items, and the `.type` class seems to refer to type aliases, which, when
shown inside of an impl, only show a link to the aliased type.
[according to MDN]: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis
Nowadays, `display: flex` is a lot more prolific, but `.impl-items` still
seems to only be used in plain block parents:
* If it's not a trait impl, then it's nested below a `<div>` with an id but no
class, added in a5216cf67d93de97091b41ecba85de2e08f39863. This will be
`display: block`, probably. For example, [vec deref]
* Inherent impls also get a `<div>` tag, for example [vec impl], and they are
also wrapped by their own non-flexbox `<details>` tag.
* If it's a tait implementation, then it's also nested below a `<details>`
container, like [deref cstring].
[vec impl]: https://doc.rust-lang.org/1.63.0/std/vec/struct.Vec.html#impl
[vec deref]: https://doc.rust-lang.org/1.63.0/std/vec/struct.Vec.html#deref-methods-%5BT%5D
[deref cstring]: https://doc.rust-lang.org/1.63.0/std/ops/trait.Deref.html#impl-Deref
Also, this would imply that trait items ought to take up as much space as
possible, pushing everything else to the edge of the screen. If this is nested
directly below the `.rustdoc` container, which has a row basis, that would
be bad.
|
|
rustdoc: remove old CSS selector that causes weird spacing
It was added with e08a84a0c18739417a50c3e46917ced5037244eb (actually, it was called `.methods > .stability` at the time) and was directly nested that way.
**EDIT**: It is technically reachable code still, but it seems wrong.
## With the old CSS rule still present
https://notriddle.com/notriddle-rustdoc-test/weird-spacing/lib/struct.Foo.html

## Version 2 (an older version of this PR)
https://notriddle.com/notriddle-rustdoc-test/normal-spacing-2/lib/struct.Foo.html

## Version 3 (with alignment fix for mobile)
https://notriddle.com/notriddle-rustdoc-test/normal-spacing-3/lib/struct.Foo.html

|
|
|
|
|
|
|
|
It was added with e08a84a0c18739417a50c3e46917ced5037244eb
(actually, it was called `.methods > .stability` at the time) and was
directly nested that way.
But with the switch to `<details>`, the code has changed drastically out from
under it, to the point where you have to go out of your way to actually get
it to render this way, and the result looks overly-tight and weird alongside
the normal version where this code is not reachable.
|
|
Remove unused .toggle-label CSS rule
It was added in https://github.com/rust-lang/rust/pull/44192 but since we moved to `<details>`, we don't use this rule any more.
r? `@notriddle`
|
|
|
|
r=GuillaumeGomez
rustdoc: remove unused CSS `#main-content > .since`
This rule was added (actually, it was called `#main > .since` back then) with cdca0843779eed0b9046e9fee48c91458ad51605 and you can see an example of the bug it's intended to fix in <https://doc.rust-lang.org/1.9.0/std/fmt/fn.write.html> by looking at the `1.0.0` version marker.
However, a5a2f2b951ea982a666eaf52b1874d8f1b17290b changed it so that `<span class="since">` is always placed in an out-of-band wrapper, so it's never nested directly below `#main` / `#main-content` any more.
|