Skip to content

Commit 4a71d44

Browse files
fix: Avoid page break after heading in print version (#364)
After headings, text is expected that should be rendered on the same page. Avoid page breaks like here: <img width="759" height="306" alt="image" src="https://github.com/user-attachments/assets/18e990bc-e351-45dd-97d5-1de9f7d9ba6c" /> Unfortunately, the option is not properly considered in Firefox ([bug report](https://bugzilla.mozilla.org/show_bug.cgi?id=775617) opened 13 years ago :D), but in Chrome it works. Co-authored-by: Robert Schuster <77234379+therobrob@users.noreply.github.com>
1 parent e984abf commit 4a71d44

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

assets/sass/headings.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ h1 {
55
margin-top: 0;
66
font-weight: 700;
77
text-wrap: balance;
8+
break-after: avoid;
89
}
910

1011
h2 {
@@ -14,6 +15,7 @@ h2 {
1415
margin-top: 0;
1516
font-weight: 700;
1617
text-wrap: balance;
18+
break-after: avoid;
1719
}
1820

1921
h3 {
@@ -23,6 +25,7 @@ h3 {
2325
margin-top: 0;
2426
font-weight: 700;
2527
text-wrap: balance;
28+
break-after: avoid;
2629
}
2730

2831
h4 {
@@ -32,4 +35,5 @@ h4 {
3235
margin-top: 0;
3336
font-weight: 700;
3437
text-wrap: balance;
38+
break-after: avoid;
3539
}

0 commit comments

Comments
 (0)