Last active
December 5, 2016 16:21
-
-
Save Zodiase/b7f4a8591eea965816becc76338f652c to your computer and use it in GitHub Desktop.
Github code printing CSS
This file contains hidden or 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
@media print { | |
/* Hide everything other than code. */ | |
body.page-blob .header[role=banner], | |
body.page-blob [role=main] .pagehead.repohead, | |
body.page-blob [role=main] .repository-content > :not(.file), | |
body.page-blob [role=main] .repository-content > .file > .file-header > .file-actions, | |
body.page-blob .site-footer-container { | |
display: none; | |
} | |
/* Maximize code area. */ | |
body.page-blob [role=main] .repository-content > .file { | |
display: block; | |
position: absolute; | |
top: 0; | |
right: 0; | |
bottom: auto; | |
left: 0; | |
margin: 0; | |
background: white; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Existing issue:
body.page-blob
is used to determine if the current page is a code page. Withoutbody.page-blob
, the styling blanks all pages other than code since there's no code on those pages. However.page-blob
is added unreliably by Github; seems like it is only checked and added on page load and won't be updated for route changes.