mirror of
https://github.com/root-fr/jmap-webmail.git
synced 2026-10-04 08:00:32 +00:00
The previous print rules kept the visibility: hidden + visibility: visible pattern, which leaves the sidebar and email list in the layout tree — they still contribute height. The outer flex h-screen wrapper plus the long mailbox list made the printed document span several pages even for a one-line email, showing the email on page one and 6–7 blank pages after. Switch to a :has()-based display: none on every body descendant that isn't on the ancestor chain of #email-viewer-container (and isn't the viewer or its subtree). Those elements drop out of layout entirely, so the document height reflects only the viewer's own content. The ancestor chain keeps its flex styling but releases viewport-sized height constraints. Verified in a headless print run: a short message now renders as exactly one page.