Skip to content

fix: make printed page look somewhat decent #527

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 44 additions & 8 deletions static/print.css
Original file line number Diff line number Diff line change
@@ -1,16 +1,52 @@
@media print {
/* Get rid of frames emulation, which breaks printing */
/* Remove header */
header {
display: none;
}
.with-toc {
display: block;
height: unset;
margin-top: 0;
}
.with-toc > * {
grid-area: unset;

/* Remove nav bar */
.with-toc > main {
padding-left: 0;
}
.with-toc > header {
#toc {
display: none;
}
#toc {

/* Fix scroll bars appearing in some code snippets */
pre {
white-space: pre-wrap;
}
pre.hl.lean {
white-space: pre-wrap;
}
.hl.lean.block {
white-space: pre-wrap;
}

/* Fix look of footnotes */
span.marginalia span.note {
float: none;
margin: 0 0 0 1ch;
padding: 0 .5ch 0 1.5ch;
border: 1px solid #98B2C0;
border-radius: .5rem;
}
span.marginalia .note::before {
content: "i";
width: 1rem;
height: 1rem;
top: .1rem;
left: -.5rem;
line-height: 1.1rem;
text-align: center;
border: 1px solid #98B2C0;
border-radius: 1rem;
background-color: #fff;
}
span.marginalia::after {
display: none;
}

Expand All @@ -25,4 +61,4 @@
orphans: 3;
widows: 3;
}
}
}