Last active
December 10, 2019 20:52
-
-
Save sshymko/ea7fed4e316cba7f744970b065224272 to your computer and use it in GitHub Desktop.
CSS styling to print GitHub Markdown docs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Hide GitHub UI controls */ | |
header, | |
.pagehead, | |
.footer, | |
.repository-content > :not(.Box), | |
.repository-content > .Box--condensed:not(#readme), | |
.Box-header { | |
display: none !important; | |
} | |
.Box, | |
.Box-body { | |
border: 0 !important; | |
} | |
/* Break page before chapter when current page has <30% room left */ | |
h1, h2, h3, h4, h5, h6 { | |
page-break-inside: avoid !important; | |
} | |
h1:not(:last-of-type)::after, | |
h2:not(:last-of-type)::after, | |
h3:not(:last-of-type)::after, | |
h4:not(:last-of-type)::after, | |
h5:not(:last-of-type)::after, | |
h6:not(:last-of-type)::after { | |
content: ""; | |
display: block; | |
height: 30vh; | |
margin-bottom: -30vh; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bookmark the following in your browser as "Print GitHub":