Skip to content

Commit 1683025

Browse files
committed
doc/: Improve css for printing
1 parent c5d0717 commit 1683025

File tree

2 files changed

+29
-17
lines changed

2 files changed

+29
-17
lines changed

doc/site.css

+9-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ body > * {
131131
.author {
132132
display: none
133133
}
134-
@media(min-width: 55rem) {
134+
@media screen and (min-width: 55rem) {
135135
.meta {
136136
position: fixed;
137137
width: 20rem;
@@ -146,3 +146,11 @@ body > * {
146146
overflow: auto;
147147
}
148148
}
149+
@media print {
150+
section.level1 {
151+
page-break-inside: avoid
152+
}
153+
nav a::after {
154+
content: leader('.') target-counter(attr(href url), page, decimal)
155+
}
156+
}

doc/template.html

+20-16
Original file line numberDiff line numberDiff line change
@@ -68,24 +68,28 @@ <h3 class="date">$date$</h3>
6868
$include-after$
6969
$endfor$
7070
<style type="text/css">
71-
li.collapsible {
72-
color: #212121;
73-
cursor: pointer;
74-
list-style-type: none;
75-
}
76-
li.collapsible:before {
77-
margin-left: -1rem; /* undo ul's padding-left */
78-
width: 1rem;
79-
display: inline-block;
80-
text-align: center;
81-
content: '-';
82-
}
83-
li.collapsible[state="collapsed"]:before {
84-
content: '+';
85-
}
86-
li.collapsible[state="collapsed"] > ul {
71+
li.collapsible > ul {
8772
display: none;
8873
}
74+
@media screen {
75+
li.collapsible {
76+
cursor: pointer;
77+
list-style-type: none;
78+
}
79+
li.collapsible:before {
80+
margin-left: -1rem; /* undo ul's padding-left */
81+
width: 1rem;
82+
display: inline-block;
83+
text-align: center;
84+
content: '-';
85+
}
86+
li.collapsible[state="collapsed"]:before {
87+
content: '+';
88+
}
89+
li.collapsible:not([state="collapsed"]) > ul {
90+
display: block;
91+
}
92+
}
8993
</style>
9094
<script type="text/javascript">
9195
document.querySelectorAll('nav > ul > li > ul > li').forEach(function(element) {

0 commit comments

Comments
 (0)