about summary refs log tree commit diff
path: root/src/librustdoc/html/static
AgeCommit message (Collapse)AuthorLines
2022-09-18rustdoc: remove unused CSS `td.summary-column`Michael Howell-4/+0
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.
2022-09-18Rollup merge of #101954 - notriddle:notriddle/location-a-first-of-type, ↵Matthias Krüger-4/+0
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
2022-09-17rustdoc: remove redundant `.location a { font-weight: 500 }`Michael Howell-4/+0
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
2022-09-17Auto merge of #101949 - matthiaskrgr:rollup-xu5cqnd, r=matthiaskrgrbors-4/+0
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
2022-09-17Rollup merge of #101934 - GuillaumeGomez:theme-links-cleanup, r=notriddleMatthias Krüger-78/+67
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``
2022-09-17Rollup merge of #101918 - notriddle:notriddle/all, r=GuillaumeGomezMatthias Krüger-6/+3
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 ![image](https://user-images.githubusercontent.com/1593513/190735035-c66b2664-3783-483c-9bc6-89f80e4a5490.png) ![image](https://user-images.githubusercontent.com/1593513/190735134-1d5df81d-58c5-4c86-b066-6dd3031ffc2e.png) # After ![image](https://user-images.githubusercontent.com/1593513/190735261-fc3878bb-0cab-4c4e-a6da-b5f7abd06588.png) ![image](https://user-images.githubusercontent.com/1593513/190735389-935a7836-f2c0-4349-a7d0-7fe5378f6b9a.png)
2022-09-17rustdoc: remove unused CSS `.non-exhaustive { margin-bottom }`Michael Howell-4/+0
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.
2022-09-16Rollup merge of #101911 - notriddle:notriddle/source-content, r=GuillaumeGomezMichael Howell-2/+0
rustdoc: remove no-op CSS on `.source .content` # `margin-left: 0` 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. # `max-width: none` 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).
2022-09-16Rollup merge of #101898 - GuillaumeGomez:rm-unused-css, r=notriddleMichael Howell-105/+46
Remove some unused CSS rules Since we now have list of items for the ones on the page, we don't need the CSS rules anymore in the sidebar (`.sidebar a`). As for the `.content` ones, they are used to highlight the items in the page (for definitions and others). Surprisingly enough, `method` and `tymethod` are all replaced with `fnname`. I also used this opportunity to remove these rules in `ayu.css`: ```css .stab.unstable {} h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {} ``` In the second commit, I removed the `.block a.current*` CSS rules as they're overridden by `.sidebar a.current*` CSS rules. In the third commit I removed unneeded empty rules (that were there to satisfy the `--check-theme` option). cc ``@jsha`` r? ``@notriddle``
2022-09-16rustdoc: clean up CSS for All Items and All Crates listsMichael Howell-6/+3
This reduces the amount of CSS, and makes these two pages more consistent (which, necessarily, means changing them a bit).
2022-09-16rustdoc: remove no-op CSS `.source .content { max-width: none }`Michael Howell-1/+0
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).
2022-09-16rustdoc: remove no-op CSS `.source .content { margin-left: 0 }`Michael Howell-1/+0
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.
2022-09-16Create new CSS variables for links colorGuillaume Gomez-78/+67
2022-09-16Remove unneeded empty ayu CSS rulesGuillaume Gomez-21/+3
2022-09-16Remove unused `.block a.current*` rulesGuillaume Gomez-48/+51
2022-09-16Remove some unused CSS rulesGuillaume Gomez-62/+18
2022-09-16Rollup merge of #101877 - notriddle:notriddle/block, r=Dylan-DPCGuillaume Gomez-3/+0
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.
2022-09-16Rollup merge of #101494 - jsha:notable-traits-right, r=GuillaumeGomezGuillaume Gomez-6/+0
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`
2022-09-15rustdoc: remove no-op CSS `.block { padding: 0 }`Michael Howell-3/+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.
2022-09-15rustdoc: remove no-op CSS `h1-4 { color: --main-color }`Michael Howell-1/+0
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.
2022-09-15Rollup merge of #101820 - notriddle:notriddle/a, r=GuillaumeGomezMatthias Krüger-1/+0
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.
2022-09-15Rollup merge of #101812 - notriddle:notriddle/titles-button, r=GuillaumeGomezMatthias Krüger-23/+6
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 ![image](https://user-images.githubusercontent.com/1593513/190215034-253c0f58-07c6-41c9-8848-0442c0522070.png) # After ![image](https://user-images.githubusercontent.com/1593513/190215065-d2453dca-edf0-4353-8fc8-3a3b31f03892.png)
2022-09-15Rollup merge of #101778 - notriddle:notriddle/docblock-short-p, r=GuillaumeGomezMatthias Krüger-5/+1
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
2022-09-14rustdoc: remove no-op rule `a { background: transparent }`Michael Howell-1/+0
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.
2022-09-14rustdoc: clean up CSS `#titles` using flexboxMichael Howell-23/+6
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.
2022-09-14Rollup merge of #101773 - notriddle:notriddle/content-table, r=GuillaumeGomezDylan DPC-9/+1
rustdoc: remove outdated CSS `.content table` etc # Screenshot before ![image](https://user-images.githubusercontent.com/1593513/189992665-238aab28-d224-4466-901c-6e35e79182fb.png) # Screenshot after ![image](https://user-images.githubusercontent.com/1593513/189992762-35c8efe4-e980-40bd-b72c-3ae4cfd6f830.png) # 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.
2022-09-14Rollup merge of #101769 - notriddle:notriddle/out-of-band-span-since, ↵Dylan DPC-1/+0
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."
2022-09-13rustdoc: clean up DOM by removing `.dockblock-short p`Michael Howell-5/+1
On https://doc.rust-lang.org/nightly/std/ this reduces the number out of `document.querySelectorAll("*").length` from 1278 to 1103.
2022-09-13Rollup merge of #101737 - ↵Matthias Krüger-6/+0
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.
2022-09-13rustdoc: remove outdated CSS `.content table` etcMichael Howell-9/+1
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.
2022-09-13rustdoc: remove redundant CSS `.out-of-band > span.since { position }`Michael Howell-1/+0
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."
2022-09-12rustdoc: remove redundant CSS `#source-sidebar, #sidebar-toggle`Michael Howell-1/+0
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`.
2022-09-12rustdoc: remove no-op CSS `.search-results .result-name > span`Michael Howell-6/+0
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.
2022-09-11rustdoc: remove no-op `#search`Michael Howell-4/+0
The padding rule was added in 135281ed1525db15edd8ebd092aa10aa40df2386 when converting the rule for #main, but didn't do anything even then.
2022-09-11rustdoc: remove no-op `#search { margin-left: 0 }`Michael Howell-1/+0
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.
2022-09-10Auto merge of #101613 - GuillaumeGomez:codeblock-tooltip, r=notriddlebors-70/+72
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`
2022-09-10Simplify DOM for codeblocks tooltipsGuillaume Gomez-70/+72
2022-09-10Rollup merge of #101624 - notriddle:notriddle/search, r=GuillaumeGomezMatthias Krüger-5/+0
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`.
2022-09-09rustdoc: remove unused CSS `#search { position: relative }`Michael Howell-5/+0
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`.
2022-09-09Rollup merge of #101600 - notriddle:notriddle/li, r=GuillaumeGomezGuillaume Gomez-33/+10
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.
2022-09-09rustdoc: simplify the codeblock tooltipMichael Howell-33/+10
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.
2022-09-09Rollup merge of #101593 - GuillaumeGomez:cleanup-theme-tooltip, r=notriddleMatthias Krüger-144/+48
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`
2022-09-09Clean up themes a bit moreGuillaume Gomez-144/+48
2022-09-08Rollup merge of #101584 - notriddle:notriddle/settings-menu, r=GuillaumeGomezMichael Goulet-3/+1
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
2022-09-08Rollup merge of #101580 - notriddle:notriddle/div-impl-items-div, ↵Michael Goulet-5/+0
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).
2022-09-08rustdoc: remove no-op CSS `#settings-menu { padding: 0 }`Michael Howell-3/+1
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.
2022-09-08rustdoc: remove unused CSS `div.impl-items > div`Michael Howell-5/+0
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).
2022-09-07rustdoc: remove unused CSS `#implementations-list > h3 > span.in-band`Michael Howell-4/+0
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.
2022-09-07Rollup merge of #101538 - notriddle:notriddle/content-methods-div, ↵Matthias Krüger-5/+0
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
2022-09-07Rollup merge of #101534 - rust-lang:notriddle/rustdoc-flex-direction, ↵Matthias Krüger-1/+0
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