Implements a comprehensive @media print stylesheet that produces clean, professional PDF and printed output for revenue reports, distribution statements, and transaction receipts.
src/index.css— Added ~500 lines of@media printrules:- Global print reset: black text on white background, removal of glass effects/shadows/gradients
- Hidden interactive UI: navigation, buttons, forms, search/filter controls, tooltips, modals
- Page break rules:
break-inside: avoidon tables, headings, cards, report items - Print headers & footers via
@pagemargin-box syntax with fallback classes - Table optimization: zebra striping, repeated headers, numeric alignment, bold totals
- Chart-to-table fallback: CSS hides SVG charts, shows table alternatives
- WCAG 2.1 AA: forced
#000000on#ffffff(7:1+ contrast), readable link URLs - RTL support, dark mode override, long text wrapping
- Utility classes:
.print-break-before,.print-break-after,.print-only,.no-print
src/hooks/usePrintMode.ts— New hook detectingbeforeprint/afterprinteventssrc/hooks/usePrintMode.test.ts— 5 tests covering print mode detection and cleanupsrc/components/PerformanceTrendWidget.tsx— Forces table view when printingsrc/components/AllocationWidget.tsx— Forces bar view when printing
docs/uiux/ux171-print-friendly-stylesheet.md— Complete design-system documentation
- Centralized in
src/index.css— Print styles co-located with design tokens for maintainability - Token reuse — References existing
--spacing-*,--font-size-*,--line-height-*variables - Black-on-white default — All dark backgrounds, glass effects, and shadows explicitly overridden
- Dual fallback mechanism — CSS-only rules + React hook for chart widgets
- No breaking changes — All modifications are additive (
@media printrules, new hook)
| Component | Print Behavior |
|---|---|
AppShell |
Header, nav, drawer, overlay hidden |
RevenueReportingCalendar |
Calendar grid + details panel, no nav buttons |
PerformanceTrendWidget |
Forces table view |
AllocationWidget |
Forces bar view |
EmptyState |
Actions hidden, title/body preserved |
InvestorDiscovery |
Cards print as simple bordered boxes |
- Lint:
npm run lintpasses (2 pre-existing errors inRevenueReportingCalendar.tsx, unrelated) - TypeScript: No errors in new
usePrintModefiles - Tests: Pre-existing ESM/CJS compatibility issues in test environment; new test file written and ready
- Chrome/Edge: Full
@pagemargin-box support - Firefox: Supports
@pagesize and margins; margin boxes limited - Safari: Basic
@media printsupport; margin boxes not supported - Fallback:
.print-header/.print-footerclasses for unsupported browsers