about summary refs log tree commit diff
path: root/src/librustdoc/html/static/css/rustdoc.css
AgeCommit message (Collapse)AuthorLines
2022-10-08rustdoc: remove mobile topbar from source pages instead of hiding itMichael Howell-4/+0
2022-10-08Rollup merge of #102798 - notriddle:notriddle/text-decoration-underline, ↵Matthias Krüger-7/+2
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.
2022-10-07rustdoc: add main-heading and example-wrap link CSS to big selectorMichael Howell-7/+2
This makes the stylesheet more consistent about how it handles link hover.
2022-10-07rustdoc: remove no-op CSS `.rightside { position: initial }`Michael Howell-1/+0
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
2022-10-08rustdoc: remove hover gap in file pickerRoland Strasser-1/+17
2022-10-07Rollup merge of #102747 - notriddle:notriddle/docblock-a-not-srclink, ↵Matthias Krüger-2/+3
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.
2022-10-07Rollup merge of #102744 - notriddle:notriddle/content-item-list, ↵Matthias Krüger-5/+0
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.
2022-10-06rustdoc: remove unused CSS `.docblock a:not(.srclink)`Michael Howell-2/+3
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.
2022-10-06rustdoc: remove unused CSS `.content .item-list`Michael Howell-5/+0
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.
2022-10-06Migrate search input color to CSS variableGuillaume Gomez-0/+1
2022-10-05rustdoc: remove unused CSS class `in-band`Michael Howell-15/+9
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.
2022-10-05Rollup merge of #102699 - GuillaumeGomez:fix-hamburger-button-color, r=Dylan-DPCDylan DPC-0/+1
Fix hamburger button color Before: ![Screenshot from 2022-10-05 11-14-20](https://user-images.githubusercontent.com/3050060/194026621-e4df5750-92df-4194-a163-9787b45ace26.png) After: ![Screenshot from 2022-10-05 11-14-15](https://user-images.githubusercontent.com/3050060/194026618-6a365623-5181-4174-b6af-66962e5ba6a5.png) No need to backport it, beta doesn't seem affected. r? `@notriddle`
2022-10-05Fix hamburger button color in mobile sidebarGuillaume Gomez-0/+1
2022-10-04rustdoc: remove no-op CSS `.code-header { display: block }`Michael Howell-4/+0
Since 76a3b609d0b93c5d8da5e4e3db37bd03e5cb1c30 converted code headers to real headers, `display: block` is now the default.
2022-10-04Rollup merge of #102624 - notriddle:notriddle/summary-before, r=GuillaumeGomezMatthias Krüger-4/+0
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.
2022-10-03Migrate search results theme style to CSS variablesGuillaume Gomez-0/+5
2022-10-03Rollup merge of #102620 - GuillaumeGomez:css-stab-migration, r=notriddleMatthias Krüger-0/+7
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`
2022-10-03rustdoc: remove font family CSS on `.rustdoc-toggle summary::before`Michael Howell-4/+0
This rule became irrelevant since c58246efe47bea09d4f3e70f536e4c9bb7770749 made it so that the `summary::before` pseudo-element contains an SVG instead of text.
2022-10-03Migrate stab elements style to CSS variablesGuillaume Gomez-0/+7
2022-10-03Rollup merge of #102550 - notriddle:notriddle/impl, r=GuillaumeGomezMatthias Krüger-12/+0
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.
2022-10-01rustdoc: remove no-op CSS `.impl { position: relative }` etcMichael Howell-11/+0
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.
2022-10-01rustdoc: remove no-op CSS `.impl { flex-basis: 100% }` etcMichael Howell-1/+0
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
2022-10-01Rollup merge of #102533 - notriddle:notriddle/a-source, r=Dylan-DPCMatthias Krüger-1/+0
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
2022-10-01Auto merge of #102237 - GuillaumeGomez:sidebar-links-color, r=notriddlebors-0/+8
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`
2022-09-30rustdoc: remove unused CSS selector `a.source`Michael Howell-1/+0
The link with this class attribute was removed in 4d16de01d0beb84dc4a351022ea5cb587b4ab557.
2022-09-30Rollup merge of #102521 - notriddle:notriddle/impl-items-section, ↵Matthias Krüger-1/+4
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 ![image](https://user-images.githubusercontent.com/1593513/193318777-2bc082fb-6579-4bd8-a0e3-d23a32b4820f.png) # After ![image](https://user-images.githubusercontent.com/1593513/193318968-b6ccacad-940b-4ed3-a0ae-dcf2079c2bae.png) </details> See how it looks at https://doc.rust-lang.org/nightly/nightly-rustc/rustdoc/clean/types/trait.AttributesExt.html <details> # Before ![image](https://user-images.githubusercontent.com/1593513/193319636-7ff9c99e-0208-462c-99de-7672e92ce4d6.png) # After ![image](https://user-images.githubusercontent.com/1593513/193322675-403bd165-7394-43e2-8ab4-d1f364666093.png) </details>
2022-09-30rustdoc: add missing margin to no-docblock trait itemsMichael Howell-1/+2
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
2022-09-30Rollup merge of #102505 - notriddle:sub-variant-h4, r=GuillaumeGomezMatthias Krüger-2/+0
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.`
2022-09-30rustdoc: add missing margin to no-docblock methodsMichael Howell-1/+3
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
2022-09-30* Migrate sidebar links color to new CSS theme handlingGuillaume Gomez-0/+8
* Remove specific color handling for ".current" items in the sidebar.
2022-09-30Rollup merge of #102491 - notriddle:notriddle/sidebar-opacity, r=GuillaumeGomezMatthias Krüger-2/+0
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.
2022-09-30Rollup merge of #102481 - notriddle:notriddle/rust-example-rendered, ↵Matthias Krüger-5/+0
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.
2022-09-30rustdoc: remove no-op CSS `h3.variant, .sub-variant h4 { border-bottom: none }`Michael Howell-2/+0
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.`
2022-09-29rustdoc: remove no-op source sidebar `opacity`Michael Howell-2/+0
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.
2022-09-29Rollup merge of #102447 - notriddle:notriddle/method-toggle, r=jshaMichael Howell-1/+2
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 ![image](https://user-images.githubusercontent.com/1593513/192914353-ed17e1eb-df1d-480b-9998-3b5e8283b0ee.png) ## After ![image](https://user-images.githubusercontent.com/1593513/192914570-bdd0f2e1-5254-4e2e-9576-a797b82b3b3b.png) * 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 ![image](https://user-images.githubusercontent.com/1593513/192914503-1c3f39d5-690f-44ec-8f11-385302477d04.png) ## After ![image](https://user-images.githubusercontent.com/1593513/192914702-cbce4b3b-5cc6-49dc-b7f8-73be9e76791c.png)
2022-09-29Rollup merge of #102442 - notriddle:notriddle/header-weight, r=GuillaumeGomezMichael Howell-1/+0
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.
2022-09-29Rollup merge of #102437 - notriddle:notriddle/margin-top-h2, r=jshaMichael Howell-0/+7
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 ![image](https://user-images.githubusercontent.com/1593513/192893092-8e158bf7-ae18-41ef-8f11-6f34c724d345.png) ## After ![image](https://user-images.githubusercontent.com/1593513/192893139-d6ee06bf-9c0b-4194-bd5d-636312c89367.png)
2022-09-29rustdoc: remove unneeded CSS `.rust-example-rendered { position }`Michael Howell-5/+0
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.
2022-09-28rustdoc: add method spacing to trait methodsMichael Howell-1/+2
More cleanup for 8846c0853d8687fda0e5f23f6687b03b243980ee, this time in trait layouts when things are collapsed.
2022-09-28rustdoc: remove bad CSS font-weight on `.impl`, `.method`, etcMichael Howell-1/+0
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.
2022-09-28rustdoc: clean up "normalize.css 8" input override CSSMichael Howell-12/+9
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
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.