about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-07-10 11:52:14 +0200
committerGitHub <noreply@github.com>2022-07-10 11:52:14 +0200
commit0dd5c75efffa3c5178fa32d3fbd99f682faa4e33 (patch)
tree2b4b1dcc7fad0833f4d3a11c56638970b00ffd09
parent95e77648e466c780a9adce2fa3d3eb5e423dc04e (diff)
parentaa7bcaa8c33be862c9802d64979c3202decd554b (diff)
downloadrust-0dd5c75efffa3c5178fa32d3fbd99f682faa4e33.tar.gz
rust-0dd5c75efffa3c5178fa32d3fbd99f682faa4e33.zip
Rollup merge of #99045 - 1011X:patch-1, r=GuillaumeGomez
improve print styles

this change removes some interactive elements in ``@media` print` form.

more specifically, it removes the sidebar, source links, the expand/collapse toggle buttons, and the `#copy-path` button.
it also adjusts some spacing and removes the `.top-doc` description completely if it's currently collapsed.
-rw-r--r--src/librustdoc/html/static/css/rustdoc.css12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index b3dc60d880b..294b0a1e9c9 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -2056,9 +2056,19 @@ in storage.js plus the media query with (min-width: 701px)
 }
 
 @media print {
-	nav.sub, .content .out-of-band {
+	nav.sidebar, nav.sub, .content .out-of-band, a.srclink, #copy-path,
+	details.rustdoc-toggle[open] > summary::before, details.rustdoc-toggle > summary::before,
+	details.rustdoc-toggle.top-doc > summary {
 		display: none;
 	}
+
+	.docblock {
+		margin-left: 0;
+	}
+
+	main {
+		padding: 10px;
+	}
 }
 
 @media (max-width: 464px) {