Skip to content

Commit ba4ae13

Browse files
committed
rustdoc: remove left border from .src-line-numbers > a
1 parent 07bb2f7 commit ba4ae13

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

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

+5-3
Original file line numberDiff line numberDiff line change
@@ -578,11 +578,13 @@ ul.block, .block li {
578578
.src-line-numbers a {
579579
color: var(--src-line-numbers-span-color);
580580
}
581-
.src-line-numbers .line-highlighted {
582-
background-color: var(--src-line-number-highlighted-background-color);
583-
}
584581
.src-line-numbers :target {
585582
background-color: transparent;
583+
border-right: none;
584+
padding-right: 0;
585+
}
586+
.src-line-numbers .line-highlighted {
587+
background-color: var(--src-line-number-highlighted-background-color);
586588
}
587589

588590
.search-loading {

src/test/rustdoc-gui/source-code-page.goml

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ click: ".src-line-numbers > a:nth-child(4)" // This is the anchor for line 4.
66
// Ensure that the page URL was updated.
77
assert-document-property: ({"URL": "lib.rs.html#4"}, ENDS_WITH)
88
assert-attribute: ("//*[@id='4']", {"class": "line-highlighted"})
9+
// Ensure that the default style, with the right border, isn't used.
10+
assert-css: ("//*[@id='4']", {"border-right-width": "0px"})
11+
reload:
12+
assert-attribute: ("//*[@id='4']", {"class": "line-highlighted"})
13+
assert-css: ("//*[@id='4']", {"border-right-width": "0px"})
914
// We now check that the good anchors are highlighted
1015
goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#4-6"
1116
assert-attribute-false: (".src-line-numbers > a:nth-child(3)", {"class": "line-highlighted"})

0 commit comments

Comments
 (0)