Skip to content

Commit

Permalink
rustdoc: remove left border from .src-line-numbers > a
Browse files Browse the repository at this point in the history
  • Loading branch information
notriddle committed Oct 31, 2022
1 parent 07bb2f7 commit ba4ae13
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -578,11 +578,13 @@ ul.block, .block li {
.src-line-numbers a {
color: var(--src-line-numbers-span-color);
}
.src-line-numbers .line-highlighted {
background-color: var(--src-line-number-highlighted-background-color);
}
.src-line-numbers :target {
background-color: transparent;
border-right: none;
padding-right: 0;
}
.src-line-numbers .line-highlighted {
background-color: var(--src-line-number-highlighted-background-color);
}

.search-loading {
Expand Down
5 changes: 5 additions & 0 deletions src/test/rustdoc-gui/source-code-page.goml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ click: ".src-line-numbers > a:nth-child(4)" // This is the anchor for line 4.
// Ensure that the page URL was updated.
assert-document-property: ({"URL": "lib.rs.html#4"}, ENDS_WITH)
assert-attribute: ("//*[@id='4']", {"class": "line-highlighted"})
// Ensure that the default style, with the right border, isn't used.
assert-css: ("//*[@id='4']", {"border-right-width": "0px"})
reload:
assert-attribute: ("//*[@id='4']", {"class": "line-highlighted"})
assert-css: ("//*[@id='4']", {"border-right-width": "0px"})
// We now check that the good anchors are highlighted
goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#4-6"
assert-attribute-false: (".src-line-numbers > a:nth-child(3)", {"class": "line-highlighted"})
Expand Down

0 comments on commit ba4ae13

Please sign in to comment.