~dricottone/blog

ref: d44855ff98122d2366681d3bda5bd9144ba90c95 blog/static/css/cgit.css -rw-r--r-- 11.2 KiB
d44855ffDominic Ricottone Minor change 2 years ago
                                                                                
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
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
/* Common classes and main content organization */
div#cgit {
  padding: 0em;
  margin: 0 0 0 calc(100px + 1em);
  font-family: sans-serif;
  font-size: 10pt;
  color: #333;
  background: white;
  padding: 4px;
}
@media (max-width: 800px) {
  div#cgit {
    margin: 0;
  }
}

div#cgit .left {
  text-align: left;
}
div#cgit .right {
  text-align: right;
}
div#cgit table.nowrap td {
  white-space: nowrap;
}


/* Tables
 *  + cgit uses table elements to render most, if not all, content
 *     + the `header` id is set on the page header
 *     + the `tabs` class is set on the navigation bar
 *     + the `list` class is set to all content tables
 *  + To simplify logic, I am moving all CSS for `list` tables up and
 *    stripping the `list` class selectors
 *  + I have adopted the cgit header into my other web pages, and therefore
 *    moved all relevent CSS into my common stylesheet
 */
div#cgit table {
  width: 100%;
  border: none;
  border-collapse: separate;
  border-spacing: 0;
}

/* Note: As a *very* hacky work-around:
 * In order to pad table rows, add padding to the cells *except* the first one
 */
div#cgit table td {
  padding: 0.5rem 1rem;
}
div#cgit table td:first-child {
  padding: 0 1rem 0 0;
}
div#cgit table th {
  font-weight: bold;
  padding: 0.5rem 1rem;
}
div#cgit table th:first-child {
  padding: 0 1rem 0 0;
}

div#cgit table td a {
  color: #000;
  text-decoration: none;
}
div#cgit table td a:hover {
  color: #00f;
}


/* Index page
 *  + the `reposection` class is set on Section rows
 *  + the `sublevel-repo` class is set on repository rows under a Section
 */
div#cgit table td.reposection {
  font-style: italic;
  color: #888;
}

div#cgit table td.sublevel-repo {
  padding-left: 1.5em;
}

div#cgit span.age-mins {
  font-weight: bold;
  color: #080;
}

div#cgit span.age-hours {
  color: #080;
}

div#cgit span.age-days {
  color: #040;
}

div#cgit span.age-weeks {
  color: #444;
}

div#cgit span.age-months {
  color: #888;
}

div#cgit span.age-years {
  color: #bbb;
}


/* Decorations
 *  + cgit renders small colored boxes for
 *    + tags (yellow)
 *    + branches (green)
 *    + HEAD (red)
 */
div#cgit .decoration a {
  display: inline; /* enforce inline incase I set other links to render as blocks */
  padding: 0 0.5rem;
  margin: 0 0.5rem;
}

div#cgit a.branch-deco {
  color: #000;
  background-color: #88ff88;
  border: solid 1px #007700;
}

div#cgit a.tag-deco {
  color: #000;
  background-color: #ffff88;
  border: solid 1px #777700;
}

div#cgit a.remote-deco {
  color: #000;
  background-color: #ccccff;
  border: solid 1px #000077;
}

div#cgit a.deco {
  color: #000;
  background-color: #ff8888;
  border: solid 1px #770000;
}


/* Navigation bar */
div#cgit table.tabs {
  border-bottom: solid 2px #808080;
}

div#cgit table.tabs td {
  padding: 0.5rem 0 0.5rem 1rem;
  vertical-align: bottom;
}

div#cgit table.tabs td a {
  padding: 0 1rem;
  color: #808080;
}

div#cgit table.tabs td a.active {
  color: #fff;
  background-color: #303030;
}

div#cgit table.tabs td.form form {
  white-space: nowrap; /* do not let search bar wrap lines */
}


/* Log page */
div#cgit table td.logsubject a {
  font-family: monospace;
  white-space: pre;
}

div#cgit table td.logmsg {
  font-family: monospace;
  white-space: pre;
}

div#cgit span.insertions {
  color: #080;
}

div#cgit span.deletions {
  color: #800;
}


/* Tree page
 */
div#cgit div.path {
  margin: 0px;
  padding: 0.5rem 0 0.5rem 2rem; /* need right padding to align wth navigation bar */
  color: #000;
  font-family: monospace;
  background-color: #eee;
}

div#cgit .ls-blob {
  font-family: monospace;
}

div#cgit .ls-dir {
  font-family: monospace;
}

div#cgit td.ls-mode {
  width: 10rem;
  font-family: monospace;
}

div#cgit td.ls-size {
  width: 10rem;
  text-align: right;
}

div#cgit table.blob td.lines {
  padding: 0 0 0 0.5rem;
  color: #000;
}

div#cgit table.blob td.linenumbers {
  padding: 0 0.5rem 0 0;
  text-align: right;
  vertical-align: top;
  background: #eee;
  /* border-right: 1px solid #303030; */
}

div#cgit table.blob pre {
  padding: 0; margin: 0;
}

div#cgit table.bin-blob {
  margin-top: 0.5em;
  border: solid 1px black;
}

div#cgit table.bin-blob th {
  font-family: monospace;
  white-space: pre;
  border: solid 1px #777;
  padding: 0.5em 1em;
}

div#cgit table.bin-blob td {
  font-family: monospace;
  white-space: pre;
  border-left: solid 1px #777;
  padding: 0em 1em;
}


/* Commit page
 *  + decorations need to be made slightly smaller
 *  + tables with the `commit-info` class hold metadata about a commit, and are
 *    rendered as a vertical table (i.e. columns instead of rows)
 *     + table "headers" should not be bolded and should float to top-left
 *     + table should reflow with page, so spacing to the right needs to be
 *       added with padding
 *  + to render commit messages and SHA1 hashes as intended, need to apply both
 *    monospaced font and `white-space: pre`
 */

div#cgit table.commit-info {
  width: auto;
  padding: 0.5rem 0 0 0;
}

div#cgit table.commit-info th {
  font-weight: normal;
  padding: 0 1rem 0 0;
  text-align: left;
  vertical-align: top;
}

div#cgit table.commit-info td {
  padding: 0 1rem 0 0;
}

div#cgit div.commit-subject {
  font-weight: bold;
  margin: 1rem 0 0 0;
}

div#cgit div.commit-msg,
div#cgit .sha1 {
  white-space: pre;
  font-family: monospace;
}


/* Diff page, mode selector */
div#cgit div.cgit-panel {
  float: right;
}

div#cgit div.cgit-panel table {
  background-color: #eee;
}

div#cgit div.cgit-panel td {
  padding: 0 0 0.5rem 0.5rem;
}


/* Diff page, statistics */
div#cgit div.diffstat-header {
  font-weight: bold;
  padding: 0.5rem 0;
}

div#cgit table.diffstat {
  width: auto;
}

div#cgit table.diffstat td.mode {
  white-space: nowrap;
  font-family: monospace;
}

div#cgit table.diffstat td.upd {
  padding: 0 1rem;
  font-family: monospace;
}

div#cgit table.diffstat td {
}

div#cgit table.diffstat td.mode {
}

div#cgit table.diffstat td span.modechange {
  padding-left: 1em;
  color: red;
}

div#cgit table.diffstat td.add a {
  color: green;
}

div#cgit table.diffstat td.del a {
  color: red;
}

div#cgit table.diffstat td.upd a {
  color: blue;
}

div#cgit table.diffstat td.graph {
  width: 500px;
  vertical-align: middle;
}

div#cgit table.diffstat td.graph table {
  border: none;
}

div#cgit table.diffstat td.graph td {
  padding: 0px;
  border: 0px;
  height: 7pt;
}

div#cgit table.diffstat td.graph td.add {
  background-color: #5c5;
}

div#cgit table.diffstat td.graph td.rem {
  background-color: #c55;
}

div#cgit div.diffstat-summary {
  color: #888;
  padding-top: 0.5em;
}


/* Diff page, 'unified' mode
 *  + to render diffs correctly, need to apply both monospaced font and
 *  `white-space: pre`
 *  + `head` class is added to diff metadata
 *  + `hunk` class is added to diff context
 *  + `add` class is added to inserted content
 *  + `del` class is added to removed content
 */
div#cgit table.diff {
  margin: 1rem 0 0 0;
}

div#cgit table.diff td {
  font-family: monospace;
  white-space: pre;
}

div#cgit table.diff td div.head {
  font-weight: bold;
  color: #000;
}

div#cgit table.diff td div.hunk {
  color: #009;
}

div#cgit table.diff td div.add {
  color: green;
}

div#cgit table.diff td div.del {
  color: red;
}

/* Diff page, ssdiff mode
 *  + to render diffs correctly, need to apply both monospaced font and
 *  `white-space: pre`
 *  + `head` class is added to diff metadata, and should be bolded
 *  + `hunk` class is added to context, and should have top and bottom borders
 *  + `add` class is added to inserted content on the right-hand side, while
 *    `add-dark` is added to inserted content on the left-hand side
 *  + `del` class is added to removed content
 *  + line numbers (class `lineno`) need to be float to the top-right and
 *    darken on hover
 */
div#cgit table.ssdiff td {
  font-family: monospace;
  white-space: pre;
  padding: 0; /* reset to no padding */
}

div#cgit table.ssdiff td.add,
div#cgit table.ssdiff td.add_dark,
div#cgit table.ssdiff td.del,
div#cgit table.ssdiff td.del_dark,
div#cgit table.ssdiff td.changed {
  min-width: 50%;
}

div#cgit table.ssdiff .add {
  color: #000;
  background: #cfc;
}
div#cgit table.ssdiff .add_dark {
  color: #000;
  background: #aca;
}
div#cgit table.ssdiff .del {
  color: #000;
  background: #fcc;
}
div#cgit table.ssdiff .del_dark {
  color: #000;
  background: #caa;
}
div#cgit table.ssdiff .changed {
  color: #000;
  background: #ffc;
}
div#cgit table.ssdiff .changed_dark {
  color: #000;
  background: #cca;
}

div#cgit table.ssdiff td.lineno {
  padding: 0 0.5rem 0 0;
  text-align: right;
  vertical-align: top;
  background: #eee;
  /* border-right: 1px solid #303030; */
}
div#cgit table.ssdiff td.lineno a {
  color: #808080;
}
div#cgit table.ssdiff td.lineno a:hover {
  color: #000;
}

div#cgit table.ssdiff td.hunk {
  color: black;
  background: #ccf;
  border-top: solid 1px #808080;
  border-bottom: solid 1px #808080;
}

div#cgit table.ssdiff td.head {
  font-weight: bold;
  color: black;
}

/* create space between diffs */
div#cgit table.ssdiff td.space div {
  min-height: 3rem;
}


/* color table rows on hover... */
div#cgit table.list tr:hover {
  background: #eee;
}
div#cgit .ctx:hover {
  background: #eee;
}
/* ...except for these rows */
div#cgit table.list tr.nohover:hover {
  background: #fff;
}



/* Footer */
div#cgit div.footer {
  text-align: center;
  color: #808080;
}
div#cgit div.footer a {
  color: #808080;
}


/* Style definition file generated by highlight 3.9, http://www.andre-simon.de/ */
/* Highlighting theme: Kwrite Editor */
/* adapted for cgit */
div#cgit table.blob .num { color:#b07e00; }
div#cgit table.blob .esc { color:#ff00ff; }
div#cgit table.blob .str { color:#bf0303; }
div#cgit table.blob .pps { color:#818100; }
div#cgit table.blob .slc { color:#838183; font-style:italic; }
div#cgit table.blob .com { color:#838183; font-style:italic; }
div#cgit table.blob .ppc { color:#008200; }
div#cgit table.blob .opt { color:#000000; }
div#cgit table.blob .lin { color:#555555; }
div#cgit table.blob .kwa { color:#000000; font-weight:bold; }
div#cgit table.blob .kwb { color:#0057ae; }
div#cgit table.blob .kwc { color:#000000; font-weight:bold; }
div#cgit table.blob .kwd { color:#010181; }

table.blob .num  { color:#2928ff; }
table.blob .esc  { color:#ff00ff; }
table.blob .str  { color:#ff0000; }
table.blob .dstr { color:#818100; }
table.blob .slc  { color:#838183; font-style:italic; }
table.blob .com  { color:#838183; font-style:italic; }
table.blob .dir  { color:#008200; }
table.blob .sym  { color:#000000; }
table.blob .kwa  { color:#000000; font-weight:bold; }
table.blob .kwb  { color:#830000; }
table.blob .kwc  { color:#000000; font-weight:bold; }
table.blob .kwd  { color:#010181; }

body.hl { background-color:#e0eaee; }
pre.hl  { color:#000000; background-color:#e0eaee; font-size:10pt; font-family:'Courier New',monospace;}
.hl.num { color:#b07e00; }
.hl.esc { color:#ff00ff; }
.hl.str { color:#bf0303; }
.hl.pps { color:#818100; }
.hl.slc { color:#838183; font-style:italic; }
.hl.com { color:#838183; font-style:italic; }
.hl.ppc { color:#008200; }
.hl.opt { color:#000000; }
.hl.ipl { color:#0057ae; }
.hl.lin { color:#555555; }
.hl.kwa { color:#000000; font-weight:bold; }
.hl.kwb { color:#0057ae; }
.hl.kwc { color:#000000; font-weight:bold; }
.hl.kwd { color:#010181; }