Fix header overlap in invoice PDF and Bongbetic wordmark on light theme

react-pdf wraps text once at the first flex measure; when yoga then shrank
the vendor column the cached lines ran under the INVOICE meta column. The
header now pins column widths (299 + 24 + 192 pt), sizes the logo from its
own aspect (stacked above the text when it would leave under 160 pt), uses
absolute per-Text line heights, and turns hyphenation off.

Also: repeating table header with an orphan-header guard, wrap=false rows,
Page n of N footer, GSTIN printed only when present, one Text per address
line, HTML twin header grid. The light-theme header showed the white-text
wordmark; the ternary was inverted.

Adds vitest + pdfjs-dist harness that fails on the old document (address
overlaps Invoice No.) and passes on the new one.
This commit is contained in:
2026-10-04 03:57:47 +05:30
parent d2ee9e32b3
commit f7a1302e94
12 changed files with 1269 additions and 126 deletions
+10 -4
View File
@@ -201,10 +201,10 @@ body {
}
.inv-top {
display: flex;
justify-content: space-between;
display: grid;
grid-template-columns: minmax(0, 1fr) 220px;
gap: 24px;
align-items: flex-start;
align-items: start;
}
.inv-vendor {
@@ -214,6 +214,11 @@ body {
min-width: 0;
}
.inv-vendor > div {
flex: 1 1 0;
min-width: 0;
}
.inv-vendor__logo {
max-height: 56px;
max-width: 220px;
@@ -229,11 +234,12 @@ body {
.inv-vendor__line {
margin: 0;
white-space: pre-line;
overflow-wrap: anywhere;
}
.inv-meta {
text-align: right;
min-width: 220px;
min-width: 0;
}
.inv-meta__title {