Skip to content

Commit 80f7041

Browse files
cscheidjjallaire
authored andcommitted
add print media, closes #1824
1 parent 5b7ac03 commit 80f7041

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

src/resources/formats/html/_quarto-rules.scss

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,3 +538,25 @@ table.gt_table tbody.gt_table_body {
538538
border-bottom-color: var(--quarto-border-color);
539539
border-top-color: currentColor;
540540
}
541+
542+
@media print {
543+
:root {
544+
font-size: 11pt;
545+
}
546+
#quarto-sidebar,
547+
#TOC,
548+
.nav-page {
549+
display: none;
550+
}
551+
.page-columns .content {
552+
grid-column-start: page-start;
553+
}
554+
.fixed-top {
555+
position: relative;
556+
}
557+
.panel-caption,
558+
.figure-caption,
559+
figcaption {
560+
color: #666;
561+
}
562+
}

src/resources/formats/html/bootstrap/_bootstrap-rules.scss

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,4 +1655,60 @@ div.observablehq table thead tr th {
16551655

16561656
input, button, select, optgroup, textarea {
16571657
background-color: var(--bs-body-bg);
1658+
}
1659+
1660+
// change .column-screen-* to behave like .column-page (which hugs the body margins)
1661+
// cf https://github.com/quarto-dev/quarto-cli/issues/1824#issuecomment-1216018434
1662+
@media print {
1663+
.page-columns .column-screen-inset {
1664+
grid-column: page-start-inset / page-end-inset;
1665+
z-index: $zindex-pagelayout;
1666+
transform: translate3d(0, 0, 0);
1667+
@include column-spanning-element();
1668+
}
1669+
1670+
.page-columns .column-screen-inset-left {
1671+
grid-column: page-start-inset / body-content-end;
1672+
z-index: $zindex-pagelayout;
1673+
transform: translate3d(0, 0, 0);
1674+
@include column-spanning-element();
1675+
}
1676+
1677+
.page-columns .column-screen-inset-right {
1678+
grid-column: body-content-start / page-end-inset;
1679+
z-index: $zindex-pagelayout;
1680+
transform: translate3d(0, 0, 0);
1681+
@include column-spanning-element();
1682+
}
1683+
1684+
.page-columns .column-screen {
1685+
grid-column: page-start / page-end;
1686+
z-index: $zindex-pagelayout;
1687+
transform: translate3d(0, 0, 0);
1688+
@include column-spanning-element();
1689+
}
1690+
1691+
.page-columns .column-screen-left {
1692+
grid-column: page-start / body-content-end;
1693+
z-index: $zindex-pagelayout;
1694+
transform: translate3d(0, 0, 0);
1695+
@include column-spanning-element();
1696+
}
1697+
1698+
.page-columns .column-screen-right {
1699+
grid-column: body-content-start / page-end;
1700+
z-index: $zindex-pagelayout;
1701+
transform: translate3d(0, 0, 0);
1702+
@include column-spanning-element();
1703+
}
1704+
1705+
.page-columns .column-screen-inset-shaded {
1706+
grid-column: page-start-inset / page-end-inset;
1707+
padding: 1em;
1708+
background: $light;
1709+
z-index: $zindex-pagelayout;
1710+
transform: translate3d(0, 0, 0);
1711+
margin-bottom: 1em;
1712+
}
1713+
16581714
}

0 commit comments

Comments
 (0)