Skip to content

Commit a7d45de

Browse files
authoredSep 26, 2022
Rollup merge of rust-lang#102280 - notriddle:notriddle/band, r=GuillaumeGomez
rustdoc: clean up `.out-of-band`/`.in-band` CSS | | method | impl |--------|--------|------ | before | ![image](https://user-images.githubusercontent.com/1593513/192164603-dea9befb-0f5f-4bd5-a44d-1f8328e27955.png) | ![image](https://user-images.githubusercontent.com/1593513/192164642-06f958cb-8fd5-4b73-bdb7-d2778f358f80.png) | after | ![image](https://user-images.githubusercontent.com/1593513/192164612-f72ee8db-c87c-477c-99e8-283b1cf0c14b.png) | ![image](https://user-images.githubusercontent.com/1593513/192164653-8e628dc3-5bf3-4ce8-829b-06e27a90fe06.png) * 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 rust-lang@593d6d1 * 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. Preview: http://notriddle.com/notriddle-rustdoc-demos/band/std/fs/struct.File.html
2 parents beb2240 + a50081e commit a7d45de

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+159
-165
lines changed
 

‎src/librustdoc/html/render/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1790,7 +1790,7 @@ pub(crate) fn render_impl_summary(
17901790
write!(w, "<section id=\"{}\" class=\"impl has-srclink\"{}>", id, aliases);
17911791
render_rightside(w, cx, &i.impl_item, containing_item, RenderMode::Normal);
17921792
write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id);
1793-
write!(w, "<h3 class=\"code-header in-band\">");
1793+
write!(w, "<h3 class=\"code-header\">");
17941794

17951795
if let Some(use_absolute) = use_absolute {
17961796
write!(w, "{}", inner_impl.print(use_absolute, cx));

‎src/librustdoc/html/static/css/rustdoc.css

+7-12
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ h4.code-header {
176176
border-bottom-style: none;
177177
margin: 0;
178178
padding: 0;
179-
margin-top: 0.6em;
180-
margin-bottom: 0.4em;
179+
margin-top: 0.6rem;
180+
margin-bottom: 0.4rem;
181181
}
182182
.impl,
183183
.impl-items .method,
@@ -658,18 +658,17 @@ h2.location a {
658658
overflow-x: auto;
659659
}
660660

661-
.content .out-of-band {
661+
.out-of-band {
662662
flex-grow: 0;
663663
font-size: 1.125rem;
664664
font-weight: normal;
665-
float: right;
666665
}
667666

668667
.method > .code-header, .trait-impl > .code-header {
669668
display: block;
670669
}
671670

672-
.content .in-band {
671+
.in-band {
673672
flex-grow: 1;
674673
margin: 0px;
675674
padding: 0px;
@@ -682,10 +681,6 @@ h2.location a {
682681
background-color: var(--main-background-color);
683682
}
684683

685-
.in-band > code, .in-band > .code-header {
686-
display: inline-block;
687-
}
688-
689684
.docblock code, .docblock-short code,
690685
pre, .rustdoc.source .example-wrap {
691686
background-color: var(--code-block-background-color);
@@ -1731,13 +1726,13 @@ in storage.js plus the media query with (min-width: 701px)
17311726
flex-direction: column;
17321727
}
17331728

1734-
.content .out-of-band {
1729+
.out-of-band {
17351730
text-align: left;
17361731
margin-left: initial;
17371732
padding: initial;
17381733
}
17391734

1740-
.content .out-of-band .since::before {
1735+
.out-of-band .since::before {
17411736
content: "Since ";
17421737
}
17431738

@@ -1969,7 +1964,7 @@ in storage.js plus the media query with (min-width: 701px)
19691964
}
19701965

19711966
@media print {
1972-
nav.sidebar, nav.sub, .content .out-of-band, a.srclink, #copy-path,
1967+
nav.sidebar, nav.sub, .out-of-band, a.srclink, #copy-path,
19731968
details.rustdoc-toggle[open] > summary::before, details.rustdoc-toggle > summary::before,
19741969
details.rustdoc-toggle.top-doc > summary {
19751970
display: none;

0 commit comments

Comments
 (0)