Use viewport units in print so pages adapt to actual paper size
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 13s
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 13s
100vh/100vw makes each .page span the full physical page regardless of whether the user prints to A4 or US Letter, eliminating the white band on A4 while keeping the footer visible on Letter. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
14de85c392
commit
c560d4a6dd
@ -452,9 +452,11 @@
|
||||
@page { size: A4; margin: 0; }
|
||||
@media print {
|
||||
body { background: var(--bg); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
|
||||
html, body { width: 100%; height: 100%; }
|
||||
.page {
|
||||
width: 210mm;
|
||||
height: 297mm;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
padding: 0;
|
||||
page-break-after: always;
|
||||
break-after: page;
|
||||
page-break-inside: avoid;
|
||||
@ -463,8 +465,7 @@
|
||||
overflow: hidden;
|
||||
}
|
||||
.page:last-child { page-break-after: auto; break-after: auto; }
|
||||
.page { padding: 0; }
|
||||
.frame { height: 297mm; border: none; }
|
||||
.frame { width: 100%; height: 100%; border: none; }
|
||||
.row, article, .section-header, .topbar, .hero { page-break-inside: avoid; break-inside: avoid; }
|
||||
|
||||
/* Global print compaction — all pages */
|
||||
|
||||
@ -352,16 +352,17 @@
|
||||
@page { size: A4; margin: 0; }
|
||||
@media print {
|
||||
body { background: var(--bg); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
|
||||
html, body { width: 100%; height: 100%; }
|
||||
.page {
|
||||
width: 100%;
|
||||
height: 270mm; /* fits both A4 (297mm) and US Letter (279mm) */
|
||||
width: 100vw;
|
||||
height: 100vh; /* adapts to actual paper size (A4 or US Letter) */
|
||||
padding: 0;
|
||||
page-break-after: auto;
|
||||
break-after: auto;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.frame { height: 270mm; border: none; overflow: hidden; }
|
||||
.frame { width: 100%; height: 100%; border: none; overflow: hidden; }
|
||||
|
||||
/* Tighten content so it fits on US Letter too */
|
||||
.hero h1 { font-size: 32pt; }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user