Skip to content

Commit 69a74c0

Browse files
authored
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
1 parent 623ac03 commit 69a74c0

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

assets/css/print-cheatsheet.css

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,18 @@
6767

6868
/* h2 styling */
6969

70-
.page-cheatmd h2 {
70+
.page-cheatmd h2.section-heading {
7171
margin: 1em 0 0.25em;
7272
column-span: all;
73-
padding-left: 8px;
73+
}
74+
75+
/* for some reason Firefox extends the h2 border-left to the following h3 when printing,
76+
moving the border-left to the :before pseudo-element fixes this */
77+
78+
.page-cheatmd h2.section-heading:before {
7479
border-left: solid 6px var(--gray100);
80+
margin-right: 8px;
81+
content: " ";
7582
}
7683

7784
.page-cheatmd section.h2 {
@@ -178,14 +185,13 @@
178185
}
179186

180187
.page-cheatmd td {
181-
font-weight: bold;
182188
text-align: left;
183189
}
184190

185191
/* Code Blocks */
186192

187193
.page-cheatmd pre {
188-
margin: 0;
194+
margin: -1px 0px -1px 0px;
189195
}
190196

191197
/* Lists */

assets/css/print.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
display: none;
2828
}
2929

30-
a.view-source {
30+
.content-inner button.icon-action {
3131
display: none;
3232
}
3333

34-
button.display-settings {
34+
.content-inner a.icon-action {
3535
display: none;
3636
}
3737

0 commit comments

Comments
 (0)