Skip to content

Commit

Permalink
fix(css): Fix CSS to print full page without border and background
Browse files Browse the repository at this point in the history
Also resolves the problem with empty page before first page content on
Firefox.

Fixes: #544
Fixes: #542

Signed-off-by: Jonas <[email protected]>
  • Loading branch information
mejo- committed Oct 27, 2023
1 parent f1915d5 commit 35507f3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
24 changes: 19 additions & 5 deletions src/Collectives.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion src/components/Page/RichText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ export default {

<style lang="scss">
@media print {
h1, h2, h3 {
page-break-after: avoid;
break-after: avoid;
}
}
</style>
2 changes: 2 additions & 0 deletions src/components/PagePrint.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export default {
&-subpage {
page-break-before: always;
break-before: always;
}
}
Expand All @@ -114,6 +115,7 @@ export default {
}
.editor__content {
display: block;
position: relative;
}
Expand Down

0 comments on commit 35507f3

Please sign in to comment.