Skip to content

Instantly share code, notes, and snippets.

@amcgregor
Last active January 18, 2022 05:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amcgregor/7c86bbb7909fd4427ef3115bb0629db4 to your computer and use it in GitHub Desktop.
Save amcgregor/7c86bbb7909fd4427ef3115bb0629db4 to your computer and use it in GitHub Desktop.
Some "user styles" overrides I use to make Github Gists more printable. Well, PDF-izable.
@media print {
div.js-header-wrapper,
.pagehead-actions,
.pagehead .note a,
.pagehead div.d-flex.flex-md-row,
.file-actions,
.js-discussion
{ display: none !important; }
.file { border-width: 0; }
.p-5 { border: 0; padding-left: 0 !important; padding-right: 0 !important; padding-top: 16px !important; }
.file-header { background: transparent; }
.markdown-body table { width: 100% !important; display: table; }
.markdown-body thead,
.markdown-body tbody,
.markdown-body tr,
.markdown-body th,
.markdown-body td
{ width: auto; page-break-inside: avoid; }
.markdown-body pre {
padding: 0 !important;
}
.markdown-body blockquote { color: #444; }
.markdown-body h3 { margin-top: 0; }
h1, h2, h3, h4, h5, h6 { page-break-after: avoid; break-after: avoid; }
h1 + *, h2 + *, h3 + *, h4 + *, h5 + *, h6 + * { page-break-before: avoid; break-before: avoid; }
.markdown-body a { color: black; font-weight: bold; }
.markdown-body a:not([href^="#"])::after {
display: inline;
content: ' (' attr(href) ')';
font-weight: normal;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment