about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2024-08-31 22:28:40 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2024-09-01 20:49:41 +0200
commit5afc4619d446fe7d7ad54e1cd192a23207bad3de (patch)
tree992d3a0978a43efd1b4061cbfd02c498a0e4f369
parent5b75f8a8927b2dfeaa5a35809c1d1f9a25cfc9b0 (diff)
downloadrust-5afc4619d446fe7d7ad54e1cd192a23207bad3de.tar.gz
rust-5afc4619d446fe7d7ad54e1cd192a23207bad3de.zip
Fix wrong rounded corners when line numbers are displayed on code examples
-rw-r--r--src/librustdoc/html/static/css/rustdoc.css18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index 1fad3cfd41e..afa3970f207 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -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 {