Packages

Rapport aims to provide a robust set of modules to generate HTML reports that both looks good in the browser and when being printed.

Current section

Files

Jump to
rapport lib paper.css
Raw

lib/paper.css

/*paper.css*/
@page { margin: 0 }
body { margin: 0 }
.sheet {
margin: 0;
overflow: hidden;
position: relative;
box-sizing: border-box;
page-break-after: always;
}
/** Paper sizes **/
body.A3 .sheet { width: 297mm; height: 419mm }
body.A3.landscape .sheet { width: 420mm; height: 296mm }
body.A4 .sheet { width: 210mm; height: 296mm }
body.A4.landscape .sheet { width: 297mm; height: 209mm }
body.A5 .sheet { width: 148mm; height: 209mm }
body.A5.landscape .sheet { width: 210mm; height: 147mm }
body.half_letter .sheet { width: 140mm; height: 216mm }
body.half_letter.landscape .sheet { width: 216mm; height: 140mm }
body.letter .sheet { width: 216mm; height: 279mm }
body.letter.landscape .sheet { width: 279mm; height: 216mm }
body.legal .sheet { width: 216mm; height: 356mm }
body.legal.landscape .sheet { width: 356mm; height: 216mm }
body.junior_legal .sheet { width: 127mm; height: 203mm }
body.junior_legal.landscape .sheet { width: 203mm; height: 127mm }
body.ledger .sheet { width: 279mm; height: 432mm }
body.ledger.landscape .sheet { width: 432mm; height: 279mm }
/** Padding area **/
.sheet.padding-10mm { padding: 10mm }
.sheet.padding-15mm { padding: 15mm }
.sheet.padding-20mm { padding: 20mm }
.sheet.padding-25mm { padding: 25mm }
/** For screen preview **/
@media screen {
body { background: #e0e0e0 }
.sheet {
background: white;
box-shadow: 0 .5mm 2mm rgba(0,0,0,.3);
margin: 5mm;
}
}
/** Fix for Chrome issue #273306 **/
@media print {
body.A3.landscape { width: 420mm }
body.A3, body.A4.landscape { width: 297mm }
body.A4, body.A5.landscape { width: 210mm }
body.A5 { width: 148mm }
body.half_letter { width: 140mm }
body.half_letter.landscape { width: 216mm }
body.letter { width: 216mm }
body.letter.landscape { width: 279mm }
body.legal { width: 216mm }
body.legal.landscape { width: 356mm }
body.junior_legal { width: 127mm }
body.junior_legal.landscape { width: 203mm }
body.ledger { width: 279mm }
body.ledger.landscape { width: 432mm }
}
.page-numbering {
position: absolute;
}
.bottom_left {
bottom: 2em;
left: 2em;
}
.bottom_right {
bottom: 2em;
right: 2em;
}
.top_right {
top: 2em;
right: 2em;
}
.top_left {
top: 2em;
left: 2em;
}