about summary refs log tree commit diff
path: root/src/librustdoc
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2024-10-29 15:44:25 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2024-12-05 22:50:21 +0100
commit448d9adc3804fcd7ecc7e89529b8565754028b91 (patch)
treeccbe77d956687293a018433f0a88e40bdc50cba3 /src/librustdoc
parent6e0dabd9e209a0fe902313b367df365d6476b875 (diff)
downloadrust-448d9adc3804fcd7ecc7e89529b8565754028b91.tar.gz
rust-448d9adc3804fcd7ecc7e89529b8565754028b91.zip
Use text ellipsis instead of bottom blurring
Diffstat (limited to 'src/librustdoc')
-rw-r--r--src/librustdoc/html/static/css/rustdoc.css27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index 52b3710ef16..cc69a2c4dad 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -2214,20 +2214,25 @@ details.toggle:not([open]) > summary .docblock {
 	max-height: calc(1.5em + 0.75em);
 	overflow-y: hidden;
 }
-details.toggle:not([open]) > summary .docblock::after {
-	content: '';
+details.toggle:not([open]) > summary .docblock > :first-child {
+	max-width: calc(100% - 1em);
+	overflow: hidden;
+	width: fit-content;
+	white-space: nowrap;
+	position: relative;
+	padding-right: 1em;
+}
+details.toggle:not([open]) > summary .docblock > :first-child::after {
+	content: "…";
 	position: absolute;
-	bottom: 0;
-	left: 0;
 	right: 0;
-	pointer-events: none;
-	background: linear-gradient(
-		to top,
-		var(--scrape-example-code-wrapper-background-start),
-		var(--scrape-example-code-wrapper-background-end)
-	);
-	height: 0.7em;
+	top: 0;
+	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;
 }
 details.toggle > summary .docblock {
 	margin-top: 0.75em;