Skip to content

Commit 5afc461

Browse files
Fix wrong rounded corners when line numbers are displayed on code examples
1 parent 5b75f8a commit 5afc461

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,10 +745,26 @@ ul.block, .block li {
745745
margin-bottom: 10px;
746746
}
747747

748-
.rustdoc .example-wrap > pre {
748+
.rustdoc .example-wrap > pre,
749+
.rustdoc .scraped-example .src-line-numbers {
749750
border-radius: 6px;
750751
}
751752

753+
/*
754+
If the code example line numbers are displayed, there will be a weird radius in the middle from
755+
both the code example and the line numbers, so we need to remove the radius in this case.
756+
*/
757+
.rustdoc .example-wrap > .example-line-numbers,
758+
.rustdoc .scraped-example .src-line-numbers {
759+
border-top-right-radius: 0;
760+
border-bottom-right-radius: 0;
761+
}
762+
.rustdoc .example-wrap > .example-line-numbers + pre,
763+
.rustdoc .scraped-example .rust {
764+
border-top-left-radius: 0;
765+
border-bottom-left-radius: 0;
766+
}
767+
752768
/* For the last child of a div, the margin will be taken care of
753769
by the margin-top of the next item. */
754770
.rustdoc .example-wrap:last-child {

0 commit comments

Comments
 (0)