Skip to content

Commit c865377

Browse files
committed
improve: Reduce spacers for print
* Remove containers padding in print. * Remove top margin for h1. * Reduce or remove margins, paddings for all elements in print.
1 parent 32c5c99 commit c865377

File tree

3 files changed

+28
-8
lines changed

3 files changed

+28
-8
lines changed

assets/styles/_header.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
display: none;
3131
}
3232
}
33+
34+
p {
35+
margin: $spacer-small 0 0 0;
36+
font-size: $font-size-smaller;
37+
}
3338
}
3439
}
3540

assets/styles/_main.scss

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,6 @@ h3 {
7676
h1 {
7777
font-size: $font-size * 2;
7878
border-bottom: $spacer-2 dotted;
79-
80-
@media print, ($phone) {
81-
margin-top: 0;
82-
font-size: $font-size * 2;
83-
}
8479
}
8580

8681
h2 {
@@ -106,6 +101,7 @@ h6 {
106101

107102
@media print {
108103
break-after: avoid-page;
104+
margin: $spacer-small 0;
109105
}
110106

111107
> a.hanchor {
@@ -123,6 +119,12 @@ h6 {
123119
}
124120
}
125121

122+
@media print {
123+
h1 {
124+
margin-top: 0;
125+
}
126+
}
127+
126128
a {
127129
text-decoration: none;
128130

@@ -295,15 +297,19 @@ td {
295297

296298
ul,
297299
ol {
298-
margin: $spacer-normal 0 $spacer-normal $spacer-large;
300+
margin: 0 0 $spacer-normal $spacer-large;
299301
padding: 0;
300302

303+
@media print {
304+
margin-bottom: 0;
305+
}
306+
301307
li {
302308
position: relative;
303309

304310
@media print {
305311
> p {
306-
margin: $spacer-small 0;
312+
margin: 0 0 $spacer-smallest 0;
307313
}
308314

309315
break-inside: avoid-page;
@@ -357,6 +363,10 @@ hr {
357363
@include themed {
358364
background: t($accent);
359365
}
366+
367+
@media print {
368+
margin: 0;
369+
}
360370
}
361371

362372
.container {
@@ -378,6 +388,7 @@ hr {
378388

379389
@media print {
380390
display: initial;
391+
padding: 0;
381392
}
382393
}
383394

assets/styles/_post.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
position: relative;
4040
border-bottom: $border-title;
4141
width: 100%;
42-
padding: $spacer-smallest 0;
42+
padding-bottom: $spacer-smallest;
4343

4444
@include themed {
4545
border-color: t($accent);
@@ -118,6 +118,10 @@
118118

119119
&-footer {
120120
margin: $spacer-largest 0;
121+
122+
@media print {
123+
margin: $spacer-small 0 0 0;
124+
}
121125
}
122126

123127
&-support {

0 commit comments

Comments
 (0)