| Age | Commit message (Collapse) | Author | Lines |
|
rustdoc: give `.line-number` / `.line-numbers` meaningful names
|
|
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.
|
|
|
|
|
|
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.
|
|
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.
|
|
* 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.
|
|
rustdoc: remove unused CSS `.summary`
It was added in 4d16de01d0beb84dc4a351022ea5cb587b4ab557 as part of a stability dashboard that was removed in 0a46933c4d81573e78ce16cd215ba155a3114fce.
|
|
It was added in 4d16de01d0beb84dc4a351022ea5cb587b4ab557 as part of a
stability dashboard that was removed in
0a46933c4d81573e78ce16cd215ba155a3114fce.
|
|
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.
|
|
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
|
|
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)
|
|
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
|
|
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
|
|
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.
|
|
rustdoc: clean up CSS/DOM for deprecation warnings
Preview: https://notriddle.com/notriddle-rustdoc-test/stab-p/std/macro.try.html
|
|
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
|
|
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.
|
|
|
|
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.
|
|
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.
|
|
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
|
|
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.
|
|
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.
|
|
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.
|
|
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`
|
|
`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?
|
|
|
|
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.
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
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
|
|
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
|
|
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``
|
|
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


# After


|
|
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.
|
|
This reduces the amount of CSS, and makes these two pages more consistent
(which, necessarily, means changing them a bit).
|
|
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).
|
|
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.
|
|
|
|
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.
|
|
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`
|
|
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.
|
|
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.
|
|
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.
|