fix(exam): stop print margins doubling up, fitting far fewer questions per page

body had its own 40px padding + max-width:800px for the on-screen preview
tab, which stacked with @page's own margin once actual printing kicked in
— the preview tab never shows @page at all, so it looked like one
continuous page while the real printed output wasted ~150px+ of page
height per side and was capped to 800px wide regardless of the physical
page width. In @media print specifically: padding:0, max-width:none —
@page's margin is the only inset that should apply once printing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
mihretue
2026-08-18 12:59:08 +00:00
parent 20b7de2310
commit 59bb8cefb9

View File

@@ -294,7 +294,12 @@ export function ExamDetailPage() {
never overlaps question text on the last page. */ never overlaps question text on the last page. */
@media print { @media print {
@page { margin: 20mm 20mm 28mm 20mm; } @page { margin: 20mm 20mm 28mm 20mm; }
body { -webkit-print-color-adjust: exact; padding-bottom: 0; } /* @page's margin already insets content from the physical page
edge — body's own 40px padding (needed on-screen, for the
preview tab before printing) would double up with it here,
wasting real page height on every side and fitting noticeably
fewer questions per page than the paper actually has room for. */
body { -webkit-print-color-adjust: exact; padding: 0; max-width: none; }
.footer { position: fixed; bottom: 0; left: 0; right: 0; margin-top: 0; } .footer { position: fixed; bottom: 0; left: 0; right: 0; margin-top: 0; }
} }
</style></head><body> </style></head><body>