reportCssPrint function
Implementation
String reportCssPrint(String pageSize) => '''
/* aa ### flutter extension
Print version: same appearance as the screen preview, with the
"reader" decoration stripped out — the gray backdrop, shadow, and
inter-page gaps shouldn't be printed on paper; the sheet should lie
flat and use all of the printable area. */
html, body { margin: 0; padding: 0; }
body {
font-family: "Microsoft JhengHei", "Noto Sans TC", -apple-system, "Segoe UI", sans-serif;
font-size: 13.3px;
color: #2C2C2A;
background: #F5F4F0;
padding: 20px 0;
}
body > table {
background: #ffffff;
margin: 0 auto 20px auto;
padding: 14px 22px 18px 22px;
box-shadow: 0 1px 5px rgba(0,0,0,.16);
border-collapse: separate;
}
body > table table { width: 100%; border-collapse: collapse; }
body > table > tbody > tr > td { padding: 0; border: 0; }
big { font-size: 1.35em; font-weight: 700; letter-spacing: 1px; color: #1a1a18;
display: block; line-height: 1.4; }
/* Header block (the first nested table): collapse <p>/<td> spacing,
otherwise it ends up far too tall */
p { margin: 0; padding: 0; }
body > table td > table:first-of-type td { /* @@@ allow an extra nesting level in case the WML brings its own centering frame */
border-bottom: 0; padding: 1px 4px; font-size: 12.3px; color: #5F5E5A;
}
th {
background: #D0CFC9; color: #2C2C2A; font-weight: 600; font-size: 13.3px;
padding: 6px; text-align: center; white-space: normal; word-break: break-word;
}
tr.row th { background: #D0CFC9; color: #2C2C2A; }
tr.row { background: transparent; }
/* @@@ Data tables use a fixed layout so <th width>/column widths are
strictly honored (auto layout would not shrink below content width) */
body > table td > table:not(:first-of-type) { table-layout: fixed; width: 100%; }
td { padding: 6px; font-size: 13.3px; font-weight: 500; color: #2C2C2A; border-bottom: 1px solid #E8E7E1; vertical-align: top; }
tr.grp td { background: #EDEAE3; font-weight: 700; color: #185FA5; padding: 7px 6px; }
tr.sub td { background: #FAFAF8; font-size: 12.3px; color: #5F5E5A; padding: 4px 6px; }
tr.sub td:first-child { padding-left: 22px; }
.row1 { background: \${WapColors.hexTrRow1}; }
.row2 { background: \${WapColors.hexTrRow2}; }
/* ── Print: strip the reader chrome, let the sheet lie flat ── */
@media print {
@page { size: $pageSize; margin: 10mm; } /* smaller margins → maximize printable area */
body {
background: #ffffff;
padding: 0;
-webkit-print-color-adjust: exact; /* keep header/group-row background colors */
print-color-adjust: exact;
}
body > table {
box-shadow: none;
margin: 0;
padding: 0;
width: 100% !important;
}
tr, td, th { page-break-inside: avoid; } /* don't let a row split across two pages */
}
/* zz ### flutter extension */
''';