Skip to content

Commit

Permalink
Firefox H2 print rendering fix (#1630)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
zolrath authored Nov 21, 2022
1 parent 623ac03 commit 69a74c0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
14 changes: 10 additions & 4 deletions assets/css/print-cheatsheet.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 */
Expand Down
4 changes: 2 additions & 2 deletions assets/css/print.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 69a74c0

Please sign in to comment.