demo · v149
Print Table Borders
Print stylesheets often set color to ensure good contrast on paper — dark print on white background, or inverted for PDF exports. Chrome 149's fix means table borders automatically follow the print color without a separate border-color rule, and dark-themed reports no longer suffer from gray borders in print mode.
The fix is most noticeable for dark-themed print reports: before Chrome 149, the gray UA border on a dark background produced near-invisible 1:1 contrast. With Chrome 149, the border inherits
currentColor and the text-color contrast carries over to borders. Toggle between modes to see the difference.
Report theme:
Border source:
Quarterly Sales Report
The following table shows regional performance for Q3. All figures are in USD thousands.
| Region | Target | Actual | Variance |
|---|---|---|---|
| North | $420k | $438k | +4.3% |
| South | $385k | $362k | -6.0% |
| East | $510k | $534k | +4.7% |
| West | $460k | $471k | +2.4% |
/* Print stylesheet — no explicit border-color needed in Chrome 149+ */
@media print {
body {
background: white;
color: black; /* this is all you need */
}
/* Chrome 149: table border inherits currentColor = black → high contrast */
/* Pre-149: border was UA gray (#808080) on white → 3.95:1 ratio (passes barely) */
table { border-collapse: collapse; }
th, td { border: 1px solid; } /* currentColor = black in print mode */
}
/* Dark PDF export */
@media print {
body.dark-report {
background: #1a1a2e;
color: #e8e6df;
}
/* Chrome 149: border = #e8e6df on #1a1a2e → 11.3:1 ratio (excellent) */
/* Pre-149: border = gray (#808080) on #1a1a2e → 1.05:1 (invisible!) */
th, td { border: 1px solid; }
}
see also
implementation reference
Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗