From 0b5000776083365b71fe78a3379f87a75cf9fb8a Mon Sep 17 00:00:00 2001 From: Infra <1011X@users.noreply.github.com> Date: Fri, 8 Jul 2022 01:29:35 -0400 Subject: [PATCH 1/3] improve print styles this change removes some interactive elements in `@media print` form. more specifically, it removes the 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. --- src/librustdoc/html/static/css/rustdoc.css | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index b3dc60d880b..a37cb6f6fe0 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-left: 15px; + } } @media (max-width: 464px) { From 933cbd40692709e810a5c2a3c4caf50345c9d394 Mon Sep 17 00:00:00 2001 From: Infra <1011X@users.noreply.github.com> Date: Fri, 8 Jul 2022 01:54:55 -0400 Subject: [PATCH 2/3] try to fix tidy issues --- src/librustdoc/html/static/css/rustdoc.css | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index a37cb6f6fe0..c145942c843 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -2057,18 +2057,18 @@ in storage.js plus the media query with (min-width: 701px) @media print { 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 { + 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-left: 15px; - } + + .docblock { + margin-left: 0; + } + + main { + padding-left: 15px; + } } @media (max-width: 464px) { From aa7bcaa8c33be862c9802d64979c3202decd554b Mon Sep 17 00:00:00 2001 From: Infra <1011X@users.noreply.github.com> Date: Fri, 8 Jul 2022 12:44:16 -0400 Subject: [PATCH 3/3] set all padding for main element in print --- src/librustdoc/html/static/css/rustdoc.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index c145942c843..294b0a1e9c9 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -2067,7 +2067,7 @@ in storage.js plus the media query with (min-width: 701px) } main { - padding-left: 15px; + padding: 10px; } }