summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorVincent Douillet <vincent@vdouillet.fr>2021-09-21 22:45:09 +0200
committerVincent Douillet <vincent@vdouillet.fr>2021-09-21 22:45:09 +0200
commit81ad4a975304cfcbe8eb6e5bcbdbdb2e8bc7f7c7 (patch)
treec34e4f5450266fb4695fd05887cdf290aaa869b6 /static
parentf672eec006097841f288370de0e4d1a06eaae318 (diff)
Add print stylesheet
Diffstat (limited to 'static')
-rw-r--r--static/css/print.css52
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 }
+}