From bb6ac3eaaa5e6c509303de6310a3f0be8f663510 Mon Sep 17 00:00:00 2001 From: Jonas Date: Sat, 28 Oct 2023 00:04:03 +0200 Subject: [PATCH] fix(css): Fix CSS to print full page without border and background Also resolves the problem with empty page before first page content on Firefox. Fixes: #542 Fixes: #543 Signed-off-by: Jonas --- src/Collectives.vue | 24 +++++++++++++++++++----- src/components/Page/RichText.vue | 2 +- src/components/PagePrint.vue | 2 ++ 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/Collectives.vue b/src/Collectives.vue index c70b6cee5c..067c59396f 100644 --- a/src/Collectives.vue +++ b/src/Collectives.vue @@ -162,6 +162,15 @@ export default { } @media print { + html, body { + background: var(--color-main-background, white) !important; + } + + /* hide toast notifications for printing */ + .toastify.dialogs { + display: none; + } + #header { display: none !important; } @@ -170,12 +179,17 @@ export default { display: block !important; } - #text-wrapper #text div.ProseMirror { - margin-top: 0; - margin-bottom: 0; - padding-top: 0; - padding-bottom: 0; + #text-wrapper #text .content-wrapper { + display: block; + + div.ProseMirror { + margin-top: 0; + margin-bottom: 0; + padding-top: 0; + padding-bottom: 0; + } } + } /* Align toggle with page list header bar */ diff --git a/src/components/Page/RichText.vue b/src/components/Page/RichText.vue index b64947b209..c7d16619b6 100644 --- a/src/components/Page/RichText.vue +++ b/src/components/Page/RichText.vue @@ -252,9 +252,9 @@ export default { diff --git a/src/components/PagePrint.vue b/src/components/PagePrint.vue index 0197c8da04..d6503aaf00 100644 --- a/src/components/PagePrint.vue +++ b/src/components/PagePrint.vue @@ -106,6 +106,7 @@ export default { &-subpage { page-break-before: always; + break-before: always; } } @@ -114,6 +115,7 @@ export default { } .editor__content { + display: block; position: relative; }