| Age | Commit message (Collapse) | Author | Lines |
|
|
|
r=GuillaumeGomez
rustdoc: add main-heading and example-wrap link CSS to big selector
This makes the stylesheet more consistent about how it handles link hover.
|
|
This makes the stylesheet more consistent about how it handles link hover.
|
|
This CSS, added in 34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9, overrode CSS
that was applied to the `.since` class:
https://github.com/rust-lang/rust/blob/34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9/src/librustdoc/html/static/rustdoc.css#L782-L795
The absolute positioning for `.since` was abandoned in favor of always
floating it, so this is no longer needed:
https://github.com/rust-lang/rust/commit/5de1391b88007a1d4f7b1517657a86aae352af1e#diff-7dc22a0530802d77c2f2ec9e834024a5657b6eab4055520fca46edc99a544413L902-L904
|
|
|
|
r=GuillaumeGomez
rustdoc: remove unused CSS `.docblock a:not(.srclink)`
This selector was added in c7312fbae4979c6d4fdfbd1f55a71cd47d82a480, because the list of impl items could be nested below `docblock`.
https://github.com/rust-lang/rust/blob/c7312fbae4979c6d4fdfbd1f55a71cd47d82a480/src/librustdoc/html/render.rs#L3841-L3845
Now that rustdoc toggles have been switched to `<details>`, there shouldn't be any need to put things inside docblock containers just to give them disclosure toggles.
|
|
r=GuillaumeGomez
rustdoc: remove unused CSS `.content .item-list`
When these rules were added in 4fd061c426902b0904c65e64a3780b21f9ab3afb (yeah, that's the very first commit of rustdoc_ng), `.item-list` was a `<ul>`, and this would override the default style for that tag.
In c1b1d6804bfce1aee3a95b3cbff3eaeb15bad9a4, it was changed to use a `<div>` tag, so these rules are both no-ops.
|
|
This selector was added in c7312fbae4979c6d4fdfbd1f55a71cd47d82a480,
because the list of impl items could be nested below `docblock`.
https://github.com/rust-lang/rust/blob/c7312fbae4979c6d4fdfbd1f55a71cd47d82a480/src/librustdoc/html/render.rs#L3841-L3845
Now that rustdoc toggles have been switched to `<details>`, there shouldn't
be any need to put things inside docblock containers just to give them
disclosure toggles.
|
|
When these rules were added in 4fd061c426902b0904c65e64a3780b21f9ab3afb
(yeah, that's the very first commit of rustdoc_ng), `.item-list` was a
`<ul>`, and this would override the default style for that tag.
In c1b1d6804bfce1aee3a95b3cbff3eaeb15bad9a4, it was changed to use a
`<div>` tag, so these rules are both no-ops.
|
|
|
|
Since a7c25b29575c17434406b69773f8c2961af343b3 removed `in-band` from code
headers, the only remaining uses of the `in-band` class are:
https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/render/write_shared.rs#L520-L521
https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/templates/print_item.html#L2-L3
https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/render/context.rs#L637-L638
https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/render/mod.rs#L368-L369
https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/render/mod.rs#L401-L402
https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/static/js/main.js#L525
Since all of these uses are nested below `h1.fqn`, we can get rid of it,
and the support code that was used for when `in-band` was part of item
rendering.
|
|
Fix hamburger button color
Before:

After:

No need to backport it, beta doesn't seem affected.
r? `@notriddle`
|
|
|
|
Since 76a3b609d0b93c5d8da5e4e3db37bd03e5cb1c30 converted code headers to
real headers, `display: block` is now the default.
|
|
rustdoc: remove font family CSS on `.rustdoc-toggle summary::before`
This rule became irrelevant since c58246efe47bea09d4f3e70f536e4c9bb7770749 made it so that the `summary::before` pseudo-element contains an SVG instead of text.
|
|
|
|
Migrate `.stab` elements style to CSS variables
Part of https://github.com/rust-lang/rust/pull/98460.
There should be no UI changes.
r? `@notriddle`
|
|
This rule became irrelevant since c58246efe47bea09d4f3e70f536e4c9bb7770749
made it so that the `summary::before` pseudo-element contains an SVG instead
of text.
|
|
|
|
rustdoc: remove no-op CSS on `.impl, .method` etc
Preview: http://notriddle.com/notriddle-rustdoc-demos/impl/index.html
# `flex-basis: 100%`
When `.impl-items { flex-basis: 100% }` and `h3.impl, h3.method, h4.method, h3.type, h4.type, h4.associatedconstant` were added in https://github.com/rust-lang/rust/commit/34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9, it seems like it was a mistake even then. According to MDN, [flex-basis] does nothing unless the box it's applied to is a flex *item*, a child of a flex container. However, when this was added, these elements were flex containers themselves.
[flex-basis]: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis
# `position: relative`
This property was added to help with positioning the `[+]/[-]` toggle. It is no longer necessary, because `details.rustdoc-toggle` already has `position:relative` set on it.
|
|
This property was added to help with positioning the `[+]/[-]` toggle.
It is no longer necessary, because `details.rustdoc-toggle` already has
`position:relative` set on it.
|
|
When `.impl-items { flex-basis: 100% }` and `h3.impl, h3.method, h4.method,
h3.type, h4.type, h4.associatedconstant` were added in
34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9, it seems like it was a mistake even
then. According to MDN, [flex-basis] does nothing unless the box it's applied
to is a flex *item*, a child of a flex container. However, when this was
added, these elements were flex containers themselves.
[flex-basis]: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis
|
|
rustdoc: remove unused CSS selector `a.source`
The link with this class attribute was removed in https://github.com/rust-lang/rust/commit/4d16de01d0beb84dc4a351022ea5cb587b4ab557#diff-3fe025bd3bd6b48044d0bd8d8c3122de5ecdb1dcd72a9dbe3c24430883595012L1281-R1324
|
|
Migrate sidebar links color to CSS variables and unify themes with ayu
Part of https://github.com/rust-lang/rust/pull/98460.
This PR does two things:
1. Migrate more theme CSS rules toward CSS variables.
2. Remove `a.current` specific colors depending on the kind of the item behind the link. The `ayu` theme was already doing it this way and I think it makes much more sense like this.
You can test it [here](https://rustdoc.crud.net/imperio/sidebar-links-color/lib2/struct.Foo.html) by hovering other module's items in the sidebar (or check the selector `a.current`).
cc `@jsha`
r? `@notriddle`
|
|
The link with this class attribute was removed in
4d16de01d0beb84dc4a351022ea5cb587b4ab557.
|
|
r=GuillaumeGomez
rustdoc: add missing margin to no-docblock methods
Fixes another regression caused by 8846c0853d8687fda0e5f23f6687b03b243980ee, this time fixing the appearance of methods that have no docblock (we didn't notice this one because libstd docs *always* have docblocks).
See how it looks at https://doc.rust-lang.org/nightly/nightly-rustc/rustdoc/clean/types/enum.Type.html#implementations
<details>
# Before

# After

</details>
See how it looks at https://doc.rust-lang.org/nightly/nightly-rustc/rustdoc/clean/types/trait.AttributesExt.html
<details>
# Before

# After

</details>
|
|
Fixes another regression caused by 8846c0853d8687fda0e5f23f6687b03b243980ee,
this time fixing the appearance of methods that have no docblock (we didn't
notice this one because libstd docs *always* have docblocks).
See how it looks at https://doc.rust-lang.org/nightly/nightly-rustc/rustdoc/clean/types/trait.AttributesExt.html
|
|
rustdoc: remove no-op CSS `h3.variant, .sub-variant h4 { border-bottom: none }`
This rule, added in 69df43b041f76251391f11264c1ff763ca2a64a0 to override the default `h4` style, has been obsoleted when a65c98fefb78cddee955b87214732b0de30a769f changed it so that only the top docblock put `border-bottom` on `h4.`
|
|
Fixes another regression caused by 8846c0853d8687fda0e5f23f6687b03b243980ee,
this time fixing the appearance of methods that have no docblock (we didn't
notice this one because libstd docs *always* have docblocks).
See how it looks without the fix at https://doc.rust-lang.org/nightly/nightly-rustc/rustdoc/clean/types/enum.Type.html#implementations
|
|
* Remove specific color handling for ".current" items in the sidebar.
|
|
rustdoc: remove no-op source sidebar `opacity`
These rules were added in dc2c9723343c985740be09919236a6e96c4e4433 to work with CSS transitions. They're otherwise redundant, since the `visibility` property already hides everything.
https://github.com/rust-lang/rust/blob/dc2c9723343c985740be09919236a6e96c4e4433/src/librustdoc/html/static/css/rustdoc.css#L350-L354
The transition was remove with 237d62588ddb4b7a93f3f5c61ea9253eba30ed5d, but the now-redundant `opacity` property was not.
|
|
r=GuillaumeGomez
rustdoc: remove unneeded CSS `.rust-example-rendered { position }`
The Run button isn't inside the `<pre>` any more. It's instead nested below the example wrapper.
The class name can't be removed from the DOM, because `main.js` uses it.
|
|
This rule, added in 69df43b041f76251391f11264c1ff763ca2a64a0 to override the
default `h4` style, has been obsoleted when
a65c98fefb78cddee955b87214732b0de30a769f changed it so that only the top
docblock put `border-bottom` on `h4.`
|
|
These rules were added in dc2c9723343c985740be09919236a6e96c4e4433 to work
with CSS transitions. They're otherwise redundant, since the `visibility`
property already hides everything.
https://github.com/rust-lang/rust/blob/dc2c9723343c985740be09919236a6e96c4e4433/src/librustdoc/html/static/css/rustdoc.css#L350-L354
The transition was remove with 237d62588ddb4b7a93f3f5c61ea9253eba30ed5d, but
the now-redundant `opacity` property was not.
|
|
rustdoc: add method spacing to trait methods
More cleanup for 8846c0853d8687fda0e5f23f6687b03b243980ee, this time in trait layouts when things are collapsed.
This PR makes two changes to the appearance of trait pages:
* It adds the `method-toggle` class to method toggles on traits, making the DOM more consistent with type pages (which already have this class).
## Before

## After

* It adds a bottom margin to docblocks nested directly in the implementors list, giving it a similar appearance to if it was nested within a toggle.
## Before

## After

|
|
rustdoc: remove bad CSS font-weight on `.impl`, `.method`, etc
This line was added in c494a06064017f307a8d9dc4797e614d2ed99143, because at the time, the headers had these classes on them. Now, the headers are children of the `<section>` with the class on it.
This commit also adds a test case, to make sure the srclink font weight does not regress again.
|
|
rustdoc: cut margin-top from first header in docblock
Fixes a regression caused by 8846c0853d8687fda0e5f23f6687b03b243980ee, where a header's top margin used to be collapsed, but isn't any more.
## Before

## After

|
|
The Run button isn't inside the `<pre>` any more. It's instead nested below
the example wrapper.
The class name can't be removed from the DOM, because `main.js` uses it.
|
|
More cleanup for 8846c0853d8687fda0e5f23f6687b03b243980ee, this time in trait
layouts when things are collapsed.
|
|
This line was added in c494a06064017f307a8d9dc4797e614d2ed99143, because at
the time, the headers had these classes on them. Now, the headers are
children of the `<section>` with the class on it.
This commit also adds a test case, to make sure the srclink font weight does
not regress again.
|
|
These rules were copied from normalize.css 3, and are mostly redundant.
* `optgroup` isn't used in rustdoc at all
* `textarea` is only used for the "copy" button, so it's not visible
* The remaining buttons and inputs mostly have styles set anyway.
* We should never be setting `color` without also setting the
background to something. Otherwise, you get white-on-gray
text. That seems to be [the reason] why `normalize.css` changed this.
[the reason]: https://github.com/necolas/normalize.css/pull/502
|
|
Fixes a regression caused by 8846c0853d8687fda0e5f23f6687b03b243980ee, where
a header's top margin used to be collapsed, but isn't any more.
|
|
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
|
|
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.
|
|
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:

stable:

We'll need to backport it to beta too to prevent it reaching stable.
r? `@notriddle`
|
|
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.
|
|
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.
|
|
|
|
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.
|
|
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.
|