From e741029fa6263df46882f1b370b28746c4f27495 Mon Sep 17 00:00:00 2001 From: Robert Verst Date: Sat, 9 Apr 2022 13:45:13 +0200 Subject: [PATCH] Improve print css --- embedded/www/css/colors.css | 4 ++-- embedded/www/css/print.css | 29 +++++++++++++++++++++-------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/embedded/www/css/colors.css b/embedded/www/css/colors.css index b757222..91bef6e 100644 --- a/embedded/www/css/colors.css +++ b/embedded/www/css/colors.css @@ -1,6 +1,6 @@ :root { - --color-print-bg: #ffffff - --color-print-fg: #303030 + --color-print-bg: #ffffff; + --color-print-fg: #303030; } .theme-light { diff --git a/embedded/www/css/print.css b/embedded/www/css/print.css index 7d0ae8c..c3d3b5c 100644 --- a/embedded/www/css/print.css +++ b/embedded/www/css/print.css @@ -1,7 +1,22 @@ /* Page breaks for printing */ -body { - padding: 1cm 1cm 1cm 2cm!important; +* { + background-color: var(--color-print-bg) !important; +} + +@page +{ + size: auto; +} + +body +{ + margin: 0; +} + +article { + margin: 15mm 5mm 15mm 15mm!important; + color: var(--color-print-fg) !important; } hr { @@ -34,6 +49,10 @@ blockquote { page-break-inside: avoid; } +ul { + page-break-inside: avoid; +} + pre { page-break-inside: avoid; background-color: #808080; @@ -42,9 +61,3 @@ pre { .switch { visibility: hidden; } - -.markdown-body { - color: var(--color-print-fg) !important; - background-color: var(--color-print-bg) !important; -} -