From 69a74c029cfb4d9a4f289dabbd9e49899f6c8c04 Mon Sep 17 00:00:00 2001 From: Matt Furden Date: Mon, 21 Nov 2022 00:50:43 -0800 Subject: [PATCH] Firefox H2 print rendering fix (#1630) * Remove all print/view source/settings icons when printing * Move grey indicator for H2 into :before to fix Firefox rendering * Collapse border for groups of multiple code blocks * Remove bold from td to fix rendering --- assets/css/print-cheatsheet.css | 14 ++++++++++---- assets/css/print.css | 4 ++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/assets/css/print-cheatsheet.css b/assets/css/print-cheatsheet.css index e4f82ff8f..af3bce4a0 100644 --- a/assets/css/print-cheatsheet.css +++ b/assets/css/print-cheatsheet.css @@ -67,11 +67,18 @@ /* h2 styling */ - .page-cheatmd h2 { + .page-cheatmd h2.section-heading { margin: 1em 0 0.25em; column-span: all; - padding-left: 8px; + } + + /* for some reason Firefox extends the h2 border-left to the following h3 when printing, + moving the border-left to the :before pseudo-element fixes this */ + + .page-cheatmd h2.section-heading:before { border-left: solid 6px var(--gray100); + margin-right: 8px; + content: " "; } .page-cheatmd section.h2 { @@ -178,14 +185,13 @@ } .page-cheatmd td { - font-weight: bold; text-align: left; } /* Code Blocks */ .page-cheatmd pre { - margin: 0; + margin: -1px 0px -1px 0px; } /* Lists */ diff --git a/assets/css/print.css b/assets/css/print.css index 918a4425a..fcbf7710e 100644 --- a/assets/css/print.css +++ b/assets/css/print.css @@ -27,11 +27,11 @@ display: none; } - a.view-source { + .content-inner button.icon-action { display: none; } - button.display-settings { + .content-inner a.icon-action { display: none; }