From b867f8989daf14a35e8d1cfa527fe3dd231b63da Mon Sep 17 00:00:00 2001 From: Lynne Date: Thu, 5 Mar 2020 19:27:35 +1000 Subject: [PATCH] add css for printing recipes --- _layouts/default.html | 2 +- assets/style.css | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/_layouts/default.html b/_layouts/default.html index 6e1c475..9dd01a5 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -5,7 +5,7 @@ - {{ page.title }} + {% if page.layout == "recipe" %}{{ page.name }}{% else %}{{ page.title }}{% endif %} diff --git a/assets/style.css b/assets/style.css index fcf48ca..0eb04e5 100644 --- a/assets/style.css +++ b/assets/style.css @@ -40,6 +40,7 @@ h2.no-bg { } h1, h2, h3, h4, h5, h6 { font-weight: 400; + page-break-after: avoid; } h3 { font-size: 1.3em; @@ -204,3 +205,43 @@ footer, .subtle { font-family: 'stars'; src: url("/assets/fonts/stars.woff") format("woff"), url("/assets/fonts/stars.woff2") format("woff2"); } + +/* print css */ +@page { + size: A4; + @bottom-center { + content: counter(page) " of " counter(pages); + } +} +@media print { + body { + display: block; + } + li { + padding: 0; + } + input[type="checkbox"], footer { + display: none; + } + h1.scrolling { + position: relative; + } + h1.invisible { + display: none; + } + .subrecipe-output { + height: min-content; + } + .subrecipe, p { + margin-left: 0; + margin-right: 0; + } + .subrecipe { + border-top: thin black solid; + border-bottom: thin black solid; + border-radius: 0; + } + .subrecipe .subrecipe-toggle::after { + content: ""; + } +}