about summary refs log tree commit diff
path: root/src/librustdoc/html/static
AgeCommit message (Collapse)AuthorLines
2022-10-11rustdoc: remove unneeded `.content` selector from link colorsMichael Howell-28/+28
Since 98f05a0282625a5fda6e90ebf3b05a4bd7608f65 and b5963f07e611cf2a09a310eb74c1a93adfaeb9de removed color classes from sidebar items, there's no need for the selectors to be so specific any more. This commit does have to change `h1.fqn a` to just be `h1 a`, so that the header link color selector is less specific than the typed link at the end. Since #89506 made docblocks start at `h2`, the main page link header should be the only h1 in the page now.
2022-10-11rustdoc: remove unused classes from sidebarMichael Howell-5/+3
Since 98f05a0282625a5fda6e90ebf3b05a4bd7608f65 removed separate colors from the currently-selected item, there's no need to have item classes on sidebar links.
2022-10-11Rollup merge of #102898 - notriddle:notriddle/sidebar-block, r=GuillaumeGomezYuki Okushi-17/+14
rustdoc: remove unneeded `<div>` wrapper from sidebar DOM When this was added, the sidebar had a bit more complex style. It can be removed, now. Preview: https://notriddle.com/notriddle-rustdoc-demos/sidebar-block/std/index.html
2022-10-11Migrate highlight style to CSS variablesGuillaume Gomez-54/+89
2022-10-10rustdoc: remove unneeded `<div>` wrapper from sidebar DOMMichael Howell-17/+14
When this was added, the sidebar had a bit more complex style. It can be removed, now.
2022-10-09rustdoc: clean up overly complex `.trait-impl` CSS selectorsMichael Howell-3/+1
When added in 45964368f4a2e31c94e9bcf1cef933c087d21544, these multi-class selectors were present in the initial commit, but no reason was given why the shorter selector wouldn't work.
2022-10-10Rollup merge of #102799 - rol1510:issue-100421-fix, r=notriddleYuki Okushi-1/+22
rustdoc: remove hover gap in file picker Fixes #100421 Before: <img width="385" alt="image" src="https://user-images.githubusercontent.com/29011024/194677087-fda2db3e-126d-47cf-8152-c554e3c25a54.png"> After: <img width="388" alt="image" src="https://user-images.githubusercontent.com/29011024/194676774-7a50ace9-4060-492e-849a-ad85d9132630.png"> longe module names also wrap nicely: <img width="389" alt="image" src="https://user-images.githubusercontent.com/29011024/194678516-f2497b3a-8d50-439b-9d69-3fa9fb43b84d.png"> Also if you zoom out very far, the arrows did move to the left, in relation to the text below. This is now also fixed. <img width="818" alt="image" src="https://user-images.githubusercontent.com/29011024/194677652-cfdf129d-f5db-4f26-ac3c-3d0853e89619.png"> CSS doesn't have a lot of controll over the `::marker` element, so now the `::after` element is used to draw the arrows. Now the whole line is clickable wihtout gaps.
2022-10-09rustdoc: fix file picker marker renders twice on iosRoland Strasser-0/+5
2022-10-08Rollup merge of #102815 - notriddle:notriddle/mobile-topbar, r=GuillaumeGomezMatthias Krüger-10/+8
rustdoc: remove mobile topbar from source pages instead of hiding it
2022-10-08rustdoc: remove mobile topbar from source pages instead of hiding itMichael Howell-10/+8
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-8/+4
2022-10-05rustdoc: remove unused CSS class `in-band`Michael Howell-16/+10
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-84/+8
2022-10-03Rollup merge of #102620 - GuillaumeGomez:css-stab-migration, r=notriddleMatthias Krüger-20/+13
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-20/+13
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-63/+14
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-63/+14
* 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-13/+11
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