Skip to content

Commit

Permalink
Rollup merge of rust-lang#102034 - notriddle:notriddle/border-bottom,…
Browse files Browse the repository at this point in the history
… r=GuillaumeGomez

rustdoc: remove no-op CSS `h1-6 { border-bottom-color }`

For this rule to have an actual effect, the border-bottom width needs specified, elsewhere, without also specifying the color. This doesn't happen. Ever since 88b137d, every spot where headers get a border assigned to them also assigns the color.

Preview: https://notriddle.com/notriddle-rustdoc-test/border-bottom/rustc_monomorphize/collector/index.html
  • Loading branch information
notriddle authored Sep 20, 2022
2 parents 2f08c7a + 17259c3 commit 6f78011
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
7 changes: 0 additions & 7 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,6 @@ h1, h2, h3, h4 {
h1.fqn {
margin: 0;
padding: 0;
border-bottom-color: var(--headings-border-bottom-color);
}
h2, h3, h4 {
border-bottom-color: var(--headings-border-bottom-color);
}
.main-heading {
display: flex;
Expand Down Expand Up @@ -659,9 +655,6 @@ h2.location a {

.docblock h5 { font-size: 1rem; }
.docblock h6 { font-size: 0.875rem; }
.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5, .docblock h6 {
border-bottom-color: var(--headings-border-bottom-color);
}

.docblock {
margin-left: 24px;
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-gui/docblock-details.goml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ assert-css: (
// We now check that the `<summary>` doesn't have a bottom border and has the correct display.
assert-css: (
".top-doc .docblock summary h4",
{"border-bottom": "0px none rgb(210, 210, 210)"},
{"border-bottom-width": "0px"},
)
// This allows to ensure that summary is on one line only!
assert-property: (".top-doc .docblock summary h4", {"offsetHeight": "33"})
Expand Down
24 changes: 12 additions & 12 deletions src/test/rustdoc-gui/headings.goml
Original file line number Diff line number Diff line change
Expand Up @@ -168,19 +168,19 @@ assert-css: (
)
assert-css: (
".top-doc .docblock h5",
{"color": "rgb(0, 0, 0)", "border-bottom": "0px none rgb(221, 221, 221)"},
{"color": "rgb(0, 0, 0)", "border-bottom-width": "0px"},
)
assert-css: (
"#implementations-list .docblock h4",
{"color": "rgb(0, 0, 0)", "border-bottom": "0px none rgb(221, 221, 221)"},
{"color": "rgb(0, 0, 0)", "border-bottom-width": "0px"},
)
assert-css: (
"#implementations-list .docblock h5",
{"color": "rgb(0, 0, 0)", "border-bottom": "0px none rgb(221, 221, 221)"},
{"color": "rgb(0, 0, 0)", "border-bottom-width": "0px"},
)
assert-css: (
"#implementations-list .docblock h6",
{"color": "rgb(0, 0, 0)", "border-bottom": "0px none rgb(221, 221, 221)"},
{"color": "rgb(0, 0, 0)", "border-bottom-width": "0px"},
)

local-storage: {"rustdoc-theme": "dark"}
Expand All @@ -199,19 +199,19 @@ assert-css: (
)
assert-css: (
".top-doc .docblock h5",
{"color": "rgb(221, 221, 221)", "border-bottom": "0px none rgb(210, 210, 210)"},
{"color": "rgb(221, 221, 221)", "border-bottom-width": "0px"},
)
assert-css: (
"#implementations-list .docblock h4",
{"color": "rgb(221, 221, 221)", "border-bottom": "0px none rgb(210, 210, 210)"},
{"color": "rgb(221, 221, 221)", "border-bottom-width": "0px"},
)
assert-css: (
"#implementations-list .docblock h5",
{"color": "rgb(221, 221, 221)", "border-bottom": "0px none rgb(210, 210, 210)"},
{"color": "rgb(221, 221, 221)", "border-bottom-width": "0px"},
)
assert-css: (
"#implementations-list .docblock h6",
{"color": "rgb(221, 221, 221)", "border-bottom": "0px none rgb(210, 210, 210)"},
{"color": "rgb(221, 221, 221)", "border-bottom-width": "0px"},
)

local-storage: {"rustdoc-theme": "ayu"}
Expand All @@ -230,19 +230,19 @@ assert-css: (
)
assert-css: (
".top-doc .docblock h5",
{"color": "rgb(197, 197, 197)", "border-bottom": "0px none rgb(92, 103, 115)"},
{"color": "rgb(197, 197, 197)", "border-bottom-width": "0px"},
)
assert-css: (
"#implementations-list .docblock h4",
{"color": "rgb(255, 255, 255)", "border-bottom": "0px none rgb(92, 103, 115)"},
{"color": "rgb(255, 255, 255)", "border-bottom-width": "0px"},
)
assert-css: (
"#implementations-list .docblock h5",
{"color": "rgb(197, 197, 197)", "border-bottom": "0px none rgb(92, 103, 115)"},
{"color": "rgb(197, 197, 197)", "border-bottom-width": "0px"},
)
assert-css: (
"#implementations-list .docblock h6",
{"color": "rgb(197, 197, 197)", "border-bottom": "0px none rgb(92, 103, 115)"},
{"color": "rgb(197, 197, 197)", "border-bottom-width": "0px"},
)

local-storage: {"rustdoc-theme": "light"}
Expand Down

0 comments on commit 6f78011

Please sign in to comment.