fix(print): set height:210mm on block wrapper, not flex container
Build pitch-deck / build-push-deploy (push) Successful in 1m39s
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 32s
CI / test-python-voice (push) Successful in 30s
CI / test-bqas (push) Successful in 29s
Build pitch-deck / build-push-deploy (push) Successful in 1m39s
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 32s
CI / test-python-voice (push) Successful in 30s
CI / test-bqas (push) Successful in 29s
Firefox doesn't honor height on flex containers in print mode — the container collapses to content height, causing all slides to fit on 2 pages. Moved the authoritative height to the display:block wrapper (.print-page-break) and changed .print-page to height:100% so it fills its reliably-sized block parent. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* Named page rule — must be outside @media print */
|
||||
/* Named page — must be outside @media print */
|
||||
@page slide-page {
|
||||
size: A4 landscape;
|
||||
margin: 0;
|
||||
@@ -38,35 +38,33 @@
|
||||
}
|
||||
|
||||
/*
|
||||
* Block wrapper owns the page break.
|
||||
* - `page: slide-page` assigns each wrapper its own named page type,
|
||||
* which forces Firefox/Chrome to start a new physical page per element.
|
||||
* - break-before/page-break-before are belt-and-suspenders for older engines.
|
||||
* - We use break-before (not break-after) to avoid a blank trailing page.
|
||||
* Block wrapper: carries the height AND the page break.
|
||||
* Firefox honors height:210mm on display:block reliably in print;
|
||||
* it does NOT reliably honor it on flex containers.
|
||||
*/
|
||||
.print-page-break + .print-page-break {
|
||||
.print-page-break {
|
||||
page: slide-page;
|
||||
display: block !important;
|
||||
break-before: page !important;
|
||||
page-break-before: always !important;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.print-page-break:first-child {
|
||||
page: slide-page;
|
||||
display: block !important;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
/* Flex layout inside each slide — no break properties here */
|
||||
.print-page {
|
||||
width: 297mm !important;
|
||||
height: 210mm !important;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
/* Force new page before every slide except the first */
|
||||
.print-page-break + .print-page-break {
|
||||
break-before: page !important;
|
||||
page-break-before: always !important;
|
||||
}
|
||||
|
||||
/* Inner flex container fills the block wrapper */
|
||||
.print-page {
|
||||
display: flex !important;
|
||||
flex-direction: column !important;
|
||||
overflow: visible !important;
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
overflow: hidden !important;
|
||||
margin: 0 !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user