add additional print styles
authorDan Allen <dan@opendevise.com>
Sun, 16 Jun 2019 09:53:49 +0000 (03:53 -0600)
committerDan Allen <dan@opendevise.com>
Sun, 16 Jun 2019 10:01:50 +0000 (04:01 -0600)
* set page margin to 0.5in
* reduce root font size to 90%
* show site title
* set font color to black
* add underline to non-local links
* avoid disruptive page breaks
* show language of source block

src/css/print.css
src/css/site.css

index 2f6550d..4141e35 100644 (file)
@@ -1,26 +1,78 @@
-body {
-  padding-top: 0;
+@page {
+  margin: 0.5in;
 }
 
-header,
-.toolbar,
-.toc {
-  display: none !important;
-}
+@media print {
+  html {
+    font-size: 90%;
+  }
 
-footer.footer {
-  border-top: 1px solid #ddd;
-  background-color: inherit;
-  padding: 0;
-}
+  a {
+    color: inherit !important;
+    text-decoration: underline;
+  }
 
-pre code {
-  white-space: pre-wrap;
-  word-wrap: break-word;
-}
+  a.bare,
+  a[href^="#"],
+  a[href^="mailto:"] {
+    text-decoration: none;
+  }
+
+  tr,
+  img,
+  object,
+  svg {
+    page-break-inside: avoid;
+  }
+
+  thead {
+    display: table-header-group;
+  }
+
+  pre {
+    hyphens: none;
+    white-space: pre-wrap;
+  }
+
+  body {
+    padding-top: 2rem;
+  }
+
+  .navbar {
+    background: none;
+    color: inherit;
+    position: absolute;
+  }
+
+  .navbar * {
+    color: inherit !important;
+  }
+
+  #topbar-nav,
+  .navigation-container,
+  .toolbar {
+    display: none;
+  }
+
+  .doc {
+    color: inherit;
+    margin: auto;
+    max-width: none;
+    padding-bottom: 2rem;
+  }
+
+  .doc .listingblock code[data-lang]::before {
+    display: block;
+  }
+
+  footer.footer {
+    background: none;
+    border-top: 1px solid #ddd;
+    color: #5d5d5d;
+    font-size: 0.9em;
+  }
 
-.doc {
-  max-width: 100%;
-  margin: auto;
-  padding: 0 1rem 1rem 1rem;
+  .footer * {
+    color: inherit;
+  }
 }
index 273b8ec..b081e3a 100644 (file)
@@ -12,4 +12,4 @@
 @import "header.css";
 @import "footer.css";
 @import "highlight.css";
-@import "print.css" print;
+@import "print.css";