-
Notifications
You must be signed in to change notification settings - Fork 166
/
default.css
393 lines (329 loc) · 5.72 KB
/
default.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
:root {
--main-font: Palatino, 'Palatino Linotype', 'Times New Roman', 'Droid Serif',
Times, 'Source Serif Pro', serif, 'Apple Color Emoji', 'Segoe UI Emoji',
'Segoe UI Symbol';
--alt-font: 'helvetica neue', ubuntu, roboto, noto, 'segoe ui', arial,
sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
--code-font: Menlo, Consolas, monospace;
--accent-color: black;
}
@page {
size: A5 portrait;
margin: 1cm 1cm 2cm;
}
html {
font-size: 12pt;
line-height: 1.3;
font-family: var(--main-font);
-webkit-print-color-adjust: exact;
tab-size: 2;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin-bottom: 0.5em;
font-family: var(--alt-font);
font-weight: bold;
page-break-after: avoid;
page-break-inside: avoid;
}
/*
Prevent dangling headings at the end of the page.
See:
* https://github.com/danburzo/percollate/issues/110
* https://stackoverflow.com/a/53742871/21613
*/
h1::after,
h2::after,
h3::after,
h4::after,
h5::after,
h6::after {
content: '';
display: block;
height: 5rem;
margin-bottom: -5rem;
}
a {
color: inherit;
text-decoration: underline;
}
/*
Going on a limb here,
but a.anchor in heading elements
is most likely a '#' or '§' anchor
we don't want to display in the PDF.
*/
h1 a.anchor,
h2 a.anchor,
h3 a.anchor,
h4 a.anchor,
h5 a.anchor,
h6 a.anchor {
visibility: hidden;
position: absolute;
}
th {
font-family: var(--alt-font);
}
code,
pre {
font-size: 0.85em;
}
pre code {
font-size: 1em;
}
/*
Don't display hidden elements
*/
[hidden],
[aria-hidden] {
display: none;
}
/*
Table of Contents page
----------------------------------------------------
*/
.toc {
page-break-before: always;
page-break-after: always;
}
/*
Article formatting
----------------------------------------------------
*/
article {
font-size: 1em;
hyphens: auto;
}
article:not(:last-of-type) {
page-break-after: always;
}
/*
Article Header
--------------
*/
.article__header {
margin: 0 0 1.3em;
}
.article__title {
font-size: 2.4em;
margin: 0 0 0.25em;
letter-spacing: -0.03em;
line-height: 1.1;
}
.article__url {
font-style: italic;
font-size: 0.9em;
}
/*
Article Content
---------------
*/
.article__content img {
max-width: 100%;
display: block;
margin: 0 auto;
}
.article__content figure {
display: block;
margin: 1.5em 0;
padding: 0;
text-align: center;
}
.article__content figcaption {
font-size: 0.8em;
font-family: var(--alt-font);
margin: 0.81em 0;
line-height: 1.625;
}
.article__content figure blockquote,
.article__content figure pre {
text-align: left;
}
.article__content table,
.article__content figure {
page-break-inside: avoid;
}
.article__content pre,
.article__content code {
font-family: var(--code-font);
}
.article__content pre {
border: 0.25pt solid #000;
padding: 0.75em;
font-size: 0.9em;
white-space: pre-wrap;
word-wrap: break-word;
}
.article__content kbd,
.article__content var,
.article__content samp {
padding: 0 0.5em;
box-shadow: 2pt 2pt 0 #ccc;
border: 0.5pt solid #000;
border-radius: 0.25em;
font-size: 0.9em;
}
.article__content p {
margin: 0;
orphans: 3;
widows: 3;
}
/*
Indent all subsequent paragraphs.
*/
.article__content p + p {
text-indent: 2em;
}
/*
Fixes the text indent for images
that get wrapped in a <p> tag
by Readability.
Reference:
https://github.com/danburzo/percollate/issues/48
*/
.article__content p + p > img:only-child {
margin-left: -2em;
}
.article__content hr {
border: none;
height: 0.5pt;
margin: 1.3em 0;
background: #000;
}
.article__content blockquote {
font-size: 0.9em;
line-height: 1.44;
padding-left: 2em;
border-left: 3pt solid #000;
margin-left: 0;
}
.article__content table {
width: 100%;
border-collapse: collapse;
page-break-inside: auto;
font-size: 0.9em;
line-height: 1.44;
margin: 1.44em 0;
}
.article__content th {
}
.article__content th,
.article__content td {
text-align: left;
vertical-align: top;
padding: 0.36em 1em 0.36em 0;
}
.article__content tr {
border-bottom: 0.25pt solid #000;
page-break-inside: avoid;
page-break-after: auto;
}
.article__content dt {
font-weight: bold;
}
.article__content ol,
.article__content ul {
padding-left: 2em;
list-style-position: outside;
margin: 0.65em 0;
}
.article__content aside {
font-family: var(--alt-font);
font-size: 0.9em;
line-height: 1.44;
padding-left: 2em;
}
.article__content details {
margin: 0.65em 0;
}
.article__content details > summary {
font-weight: bold;
font-size: 0.9em;
font-family: var(--alt-font);
}
/*
Page header / footer
--------------------
These are extracted when generating the PDF
and are not subject to the page's CSS cascade.
They're just placed here for easier style coordination
*/
.header-template {
}
.footer-template {
font-size: 10pt;
font-weight: bold;
}
/*
Cover page
----------
*/
.cover {
color: var(--accent-color);
border: 0.5em solid;
font-family: var(--cover-font, var(--alt-font));
padding: 2em;
}
.cover__author {
margin: 1em 0;
font-weight: bold;
}
.cover__title {
font-size: 2.4em;
margin: 0;
line-height: 1.1;
}
.cover__subtitle {
margin: 1em 0;
}
.cover__date {
font-weight: bold;
}
/*
Filetype specific
-----------------
*/
.type--pdf body {
margin: 0;
padding: 0;
}
.type--pdf a:not(.no-href)::after {
content: ' → ' attr(href) '';
font-size: 0.8em;
word-break: break-all;
word-wrap: break-word;
font-family: var(--alt-font);
}
.type--pdf .cover,
.type--epub .cover {
position: absolute;
overflow: hidden;
}
.type--pdf .cover {
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.type--epub .cover {
top: 2em;
left: 2em;
right: 2em;
bottom: 2em;
}
.type--pdf .cover__content,
.type--epub .cover__content {
position: absolute;
top: 30%;
left: 2em;
right: 2em;
transform: translate(0, -50%);
}
.type--pdf .cover__sentinel {
page-break-after: always;
}