diff options
Diffstat (limited to 'static/css/print.css')
-rw-r--r-- | static/css/print.css | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/static/css/print.css b/static/css/print.css new file mode 100644 index 0000000..afaff43 --- /dev/null +++ b/static/css/print.css @@ -0,0 +1,52 @@ +/* Print stylesheet inspired by https://www.jotform.com/blog/css-perfect-print-stylesheet-98272/ */ +@media print { + /* Page layout */ + #content, #page { + width: 100%; + margin: 0; + float: none; + } + @page { margin: 2cm } + h2.entry-title { margin-bottom: 0 } + + /* Font */ + body { + font: 13pt Arial, sans-serif; + line-height: 1.3; + background: #fff !important; + color: #000; + } + h1 { font-size: 24pt } + h2 { font-size: 18pt } + h3, h4 { + font-size: 14pt; + margin-top: 25px; + } + + /* Page break */ + a, blockquote { page-break-inside:avoid } + h1, h2, h3, h4, h5, h6 { + page-break-after:avoid; + page-break-inside:avoid; + } + img { + page-break-inside:avoid; + page-break-after:avoid; + } + table, pre { page-break-inside:avoid } + ul, ol, dl { page-break-before:avoid } + + /* Link */ + a:link, a:visited, a { + background: transparent; + color: #520; + text-align: left; + } + a[href^=http]:after { content:" <" attr(href) "> " } + $a:after > img { content: "" } + article a[href^="#"]:after { content: "" } + a:not(:local-link):after { content:" <" attr(href) "> " } + + /* Hide stuff that's needed on paper */ + nav, .translations { display: none } +} |