Skip to content

Commit

Permalink
Fix wrong rounded corners when line numbers are displayed on code exa…
Browse files Browse the repository at this point in the history
…mples
  • Loading branch information
GuillaumeGomez committed Sep 1, 2024
1 parent 5b75f8a commit 5afc461
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -745,10 +745,26 @@ ul.block, .block li {
margin-bottom: 10px;
}

.rustdoc .example-wrap > pre {
.rustdoc .example-wrap > pre,
.rustdoc .scraped-example .src-line-numbers {
border-radius: 6px;
}

/*
If the code example line numbers are displayed, there will be a weird radius in the middle from
both the code example and the line numbers, so we need to remove the radius in this case.
*/
.rustdoc .example-wrap > .example-line-numbers,
.rustdoc .scraped-example .src-line-numbers {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.rustdoc .example-wrap > .example-line-numbers + pre,
.rustdoc .scraped-example .rust {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}

/* For the last child of a div, the margin will be taken care of
by the margin-top of the next item. */
.rustdoc .example-wrap:last-child {
Expand Down

0 comments on commit 5afc461

Please sign in to comment.