forked from tajmone/pandoc-goodies
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_github-markdown.scss
507 lines (412 loc) · 10.3 KB
/
_github-markdown.scss
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
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
// ==============================================================================
// GitHub Markdown by sindresorhus
// ==============================================================================
// Adaptation work by Tristano Ajmone, 2017/11/20.
//
// This file was ported to Sass scss from the GitHub Markdown CSS project:
//
// -- https://github.com/sindresorhus/github-markdown-css/blob/f7cd505/github-markdown.css
//
// GitHub Markdown CSS, by Sindre Sorhus, released under The MIT License (MIT):
// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
//
// Parts of code from the Primer project were also reused and adapted here:
// -- https://github.com/primer/primer
// -- http://primercss.io
//
// Primer (aka "Primer CSS"), by GitHub Inc., released under The MIT License (MIT):
// Copyright (c) 2017 GitHub Inc.
// ==============================================================================
// NOTE: I've done lots of cleaning-up here! The original CSS file by Sindre Sorhus
// was automatically generated by extracting the actual CSS stylesheet from
// GitHub content preview pages (which in turn is auto-generated from Primer).
// Therefore, there were lots of redundant definitions, or values-orvverrides.
// I've tried to simplify the whole thing in order to take advantage of Sass'
// rules-nesting feature, which provides a much cleaner source to work on.
// The main goal here is to make this stylesheet easy to maintain, and not
// to replicate 100% how GitHub styles its contents preveiwes -- we only
// aim to provide a GitHubbish look-&-feel, not 100% accuracy!
// -- Definitions for the same tags were dispersed all over the place, I've tried
// to gather them all together, in one place, and nest them.
// -- When conflicting values were found, I've peeked at which rules takes over
// in the actual browser, and discareded the overriden rule.
// -- I've removed all references to the "octicons-link" -- was supposed to mimick
// the chain link icon on Headers, but it's no use to use because we use this
// sytlesheet with pandoc (which doesn't provide <a> anchors).
nav {
margin-left: 1em;
position: absolute;
line-height: 45px;
a {
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
font-size: 18px;
color: #0366d6;
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
}
.markdown-body {
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
line-height: 1.5;
color: #24292e;
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
font-size: 16px;
line-height: 1.5;
word-wrap: break-word;
box-sizing: border-box;
min-width: 200px;
max-width: 980px;
margin: 0 auto;
padding: 45px 0;
a {
color: #0366d6;
background-color: transparent;
text-decoration: none;
-webkit-text-decoration-skip: objects;
&:active,
&:hover {
outline-width: 0;
}
&:hover {
text-decoration: underline;
}
&:not([href]) {
color: inherit;
text-decoration: none;
}
}
strong {
font-weight: 600;
}
// ------------------------------------------------------------------------------
// Headings
// ------------------------------------------------------------------------------
h1,
h2,
h3,
h4,
h5,
h6 {
margin-top: 24px;
margin-bottom: 16px;
font-weight: 600;
line-height: 1.25;
}
h1 {
font-size: 2em;
margin: 0.67em 0;
padding-bottom: 0.3em;
border-bottom: 1px solid #eaecef;
}
h2 {
padding-bottom: 0.3em;
font-size: 1.5em;
border-bottom: 1px solid #eaecef;
}
h3 {
font-size: 1.25em;
}
h4 {
font-size: 1em;
}
h5 {
font-size: 0.875em;
}
h6 {
font-size: 0.85em;
color: #6a737d;
}
// ------------------------------------------------------------------------------
img {
border-style: none;
}
svg:not(:root) {
overflow: hidden;
}
code,
kbd,
pre {
font-family: monospace, monospace;
font-size: 1em;
}
hr {
box-sizing: content-box;
height: 0.25em;
margin: 24px 0;
padding: 0;
overflow: hidden;
background-color: #e1e4e8;
border: 0;
&::before {
display: table;
content: "";
}
&::after {
display: table;
clear: both;
content: "";
}
}
input {
margin: 0;
overflow: visible;
font: inherit;
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
[type="checkbox"] {
box-sizing: border-box;
padding: 0;
}
* {
box-sizing: border-box;
}
p {
margin-top: 0;
margin-bottom: 10px;
}
blockquote {
margin: 0;
}
// ------------------------------------------------------------------------------
// Lists
// ------------------------------------------------------------------------------
ul,
ol {
padding-left: 2em;
margin-top: 0;
margin-bottom: 0;
ol {
list-style-type: lower-roman;
}
ul,
ol {
margin-top: 0;
margin-bottom: 0;
}
ul ol,
ol ol {
list-style-type: lower-alpha;
}
}
li>p {
margin-top: 16px;
}
li+li {
margin-top: 0.25em;
}
// ------------------------------------------------------------------------------
// Description Lists
// ------------------------------------------------------------------------------
dd {
margin-left: 0;
}
dl {
padding: 0;
& dt {
padding: 0;
margin-top: 16px;
font-size: 1em;
font-style: italic;
font-weight: 600;
}
& dd {
padding: 0 16px;
margin-bottom: 16px;
}
}
// ------------------------------------------------------------------------------
code {
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-size: 12px;
}
pre {
margin-top: 0;
margin-bottom: 0;
font: 12px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
// ------------------------------------------------------------------------------
p,
blockquote,
ul,
ol,
dl,
table,
pre {
margin-top: 0;
margin-bottom: 16px;
}
blockquote {
padding: 0 1em;
color: #6a737d;
border-left: 0.25em solid #dfe2e5;
&>:first-child {
margin-top: 0;
}
&>:last-child {
margin-bottom: 0;
}
}
kbd {
display: inline-block;
padding: 3px 5px;
font-size: 11px;
line-height: 10px;
color: #444d56;
vertical-align: middle;
background-color: #fafbfc;
border: solid 1px #c6cbd1;
border-bottom-color: #959da5;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #959da5;
}
// ------------------------------------------------------------------------------
// Tables
// ------------------------------------------------------------------------------
table {
display: block;
width: 100%;
overflow: auto;
border-spacing: 0;
border-collapse: collapse;
& th {
font-weight: 600;
}
& th,
& td {
padding: 6px 13px;
border: 1px solid #dfe2e5;
}
& tr {
background-color: #fff;
border-top: 1px solid #c6cbd1;
&:nth-child(2n) {
background-color: #f6f8fa;
}
}
}
// ------------------------------------------------------------------------------
img {
max-width: 100%;
box-sizing: content-box;
background-color: #fff;
}
code {
padding: 0;
padding-top: 0.2em;
padding-bottom: 0.2em;
margin: 0;
font-size: 85%;
background-color: rgba(27,31,35,0.05);
border-radius: 3px;
}
code::before,
code::after {
letter-spacing: -0.2em;
content: "\00a0";
}
pre {
word-wrap: normal;
}
pre>code {
padding: 0;
margin: 0;
font-size: 100%;
word-break: normal;
white-space: pre;
background: transparent;
border: 0;
}
.highlight {
margin-bottom: 16px;
}
.highlight pre {
margin-bottom: 0;
word-break: normal;
}
.highlight pre,
pre {
padding: 16px;
overflow: auto;
font-size: 85%;
line-height: 1.45;
background-color: #f6f8fa;
border-radius: 3px;
}
pre code {
display: inline;
max-width: auto;
padding: 0;
margin: 0;
overflow: visible;
line-height: inherit;
word-wrap: normal;
background-color: transparent;
border: 0;
}
pre code::before,
pre code::after {
content: normal;
}
.full-commit .btn-outline:not(:disabled):hover {
color: #005cc5;
border-color: #005cc5;
}
kbd {
display: inline-block;
padding: 3px 5px;
font: 11px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
line-height: 10px;
color: #444d56;
vertical-align: middle;
background-color: #fcfcfc;
border: solid 1px #c6cbd1;
border-bottom-color: #959da5;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #959da5;
}
// ------------------------------------------------------------------------------
// Task-Lists
// ------------------------------------------------------------------------------
:checked+.radio-label {
position: relative;
z-index: 1;
border-color: #0366d6;
}
.task-list-item {
list-style-type: none;
&+.task-list-item {
margin-top: 3px;
}
& input {
margin: 0 0.2em 0.25em -1.6em;
vertical-align: middle;
}
}
// ------------------------------------------------------------------------------
// .markdown-body
// ------------------------------------------------------------------------------
// .markdown-body::before
&::before {
display: table;
content: "";
}
// .markdown-body::after
&::after {
display: table;
clear: both;
content: "";
}
// .markdown-body >*:first-child
&>*:first-child {
margin-top: 0 !important;
}
// .markdown-body >*:child
&>*:last-child {
margin-bottom: 0 !important;
}
}