fix(print): wrap flex pages in block container to fix Chrome page breaks
Build pitch-deck / build-push-deploy (push) Successful in 1m38s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-consent (push) Successful in 31s
CI / test-python-voice (push) Successful in 31s
CI / test-bqas (push) Successful in 32s

Chrome's print engine silently ignores break-after/page-break-after on
flex containers. Wrapping each .print-page (flex) in a plain block
.print-page-break element gives Chrome a reliable page break anchor.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Sharang Parnerkar
2026-05-12 18:16:13 +02:00
parent edac3aca6c
commit f3e54180f0
3 changed files with 24 additions and 4 deletions
+20 -4
View File
@@ -8,8 +8,9 @@
margin: 0;
}
body {
margin: 0;
html, body {
margin: 0 !important;
padding: 0 !important;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
@@ -21,18 +22,33 @@
.print-deck-wrapper {
padding: 0 !important;
margin: 0 !important;
display: block !important;
}
.print-page {
/* Block wrapper handles page breaks — flex containers break unreliably in Chrome */
.print-page-break {
display: block !important;
page-break-after: always !important;
break-after: page !important;
page-break-inside: avoid !important;
break-inside: avoid !important;
margin: 0 !important;
box-shadow: none !important;
padding: 0 !important;
}
.print-page-break:last-child {
page-break-after: auto !important;
break-after: auto !important;
}
/* Flex container for internal layout only — no break properties here */
.print-page {
width: 297mm !important;
height: 210mm !important;
display: flex !important;
flex-direction: column !important;
overflow: visible !important;
margin: 0 !important;
box-shadow: none !important;
}
}