about summary refs log tree commit diff
path: root/src/librustdoc/html
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2024-11-19 22:11:28 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2024-12-05 22:50:21 +0100
commit90feb9a64514b949b9a986e07c8eb14e4a5ca923 (patch)
tree58e9fe34714d048833620912533cdf48e9504473 /src/librustdoc/html
parent448d9adc3804fcd7ecc7e89529b8565754028b91 (diff)
downloadrust-90feb9a64514b949b9a986e07c8eb14e4a5ca923.tar.gz
rust-90feb9a64514b949b9a986e07c8eb14e4a5ca923.zip
Improve positioning of "..." in collapsed impl block
Diffstat (limited to 'src/librustdoc/html')
-rw-r--r--src/librustdoc/html/static/css/rustdoc.css11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index cc69a2c4dad..27496381b2c 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -2215,7 +2215,7 @@ details.toggle:not([open]) > summary .docblock {
 	overflow-y: hidden;
 }
 details.toggle:not([open]) > summary .docblock > :first-child {
-	max-width: calc(100% - 1em);
+	max-width: 100%;
 	overflow: hidden;
 	width: fit-content;
 	white-space: nowrap;
@@ -2230,10 +2230,15 @@ details.toggle:not([open]) > summary .docblock > :first-child::after {
 	bottom: 0;
 	z-index: 1;
 	background-color: var(--main-background-color);
-	/* In case this ends up in a heading or a `<code>` item. */
-	font-weight: normal;
 	font: 1rem/1.5 "Source Serif 4", NanumBarunGothic, serif;
+	/* To make it look a bit better and not have it stuck to the preceding element. */
+	padding-left: 0.2em;
 }
+details.toggle:not([open]) > summary .docblock > div:first-child::after {
+	/* This is to make the "..." always appear at the bottom. */
+	padding-top: calc(1.5em + 0.75em - 1.2rem);
+}
+
 details.toggle > summary .docblock {
 	margin-top: 0.75em;
 }