Skip to content

Commit

Permalink
Fixes #110: prevent dangling headings at the end of a page
Browse files Browse the repository at this point in the history
  • Loading branch information
danburzo committed Oct 5, 2020
1 parent 86f4789 commit a28c219
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion templates/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,27 @@ h6 {
font-family: var(--alt-font);
font-weight: bold;
page-break-after: avoid;
page-break-inside: avoid;
}

/*
Prevent dangling headings at the end of the page.
See:
* https://github.com/danburzo/percollate/issues/110
* https://stackoverflow.com/a/53742871/21613
*/
h1::after,
h2::after,
h3::after,
h4::after,
h5::after,
h6::after {
content: '';
display: block;
height: 5rem;
margin-bottom: -5rem;
}

a {
Expand Down Expand Up @@ -328,7 +349,7 @@ article:not(:last-of-type) {
padding: 0;
}

.type--pdf a:not(.no-href):after {
.type--pdf a:not(.no-href)::after {
content: ' → ' attr(href) '';
font-size: 0.8em;
word-break: break-all;
Expand Down

0 comments on commit a28c219

Please sign in to comment.