all repos

mugit @ d4f69f4

🐮 git server that your cow will love

mugit/web/static/style.css (view raw)

Oleksandr Smirnov Oleksandr Smirnov
olexsmir@gmail.com
ui: add line numbers to diffs, 2 months ago
1
:root {
2
  --white: #fff;
3
  --light: #f4f4f4;
4
  --cyan: #509c93;
5
  --light-gray: #eee;
6
  --medium-gray: #ddd;
7
  --gray: #6a6a6a;
8
  --dark: #444;
9
  --darker: #222;
10
  --diff-add: green;
11
  --diff-del: red;
12
13
  --sans-font: -apple-system, BlinkMacSystemFont, "Inter", "Roboto", "Segoe UI", sans-serif;
14
  --mono-font: 'SF Mono', SFMono-Regular, ui-monospace, 'DejaVu Sans Mono', 'Roboto Mono', Menlo, Consolas, monospace;
15
}
16
17
@media (prefers-color-scheme: dark) {
18
  :root {
19
    color-scheme: dark light;
20
    --light: #181818;
21
    --cyan: #76c7c0;
22
    --light-gray: #333;
23
    --medium-gray: #444;
24
    --gray: #aaa;
25
    --dark: #ddd;
26
    --darker: #f4f4f4;
27
    --white: #000;
28
  }
29
}
30
31
* {
32
  box-sizing: border-box;
33
  padding: 0;
34
  margin: 0;
35
}
36
37
html {
38
  background: var(--white);
39
  -webkit-text-size-adjust: none;
40
  -webkit-font-smoothing: antialiased;
41
  -moz-osx-font-smoothing: grayscale;
42
  font-family: var(--sans-font);
43
  font-weight: 400;
44
}
45
46
body {
47
  max-width: 1200px;
48
  padding: 0 13px;
49
  margin: 40px auto;
50
}
51
52
::selection {
53
  background: var(--medium-gray);
54
}
55
56
a {
57
  text-decoration: none;
58
  word-wrap: break-word;
59
  color: var(--darker);
60
  border-bottom: 0;
61
}
62
63
a:hover { border-bottom: 1.5px solid var(--gray); }
64
.link { border-bottom: 1.5px solid var(--medium-gray); }
65
66
pre {
67
  font-family: var(--mono-font);
68
  overflow-x: auto;
69
  tab-size: 4;
70
  -moz-tab-size: 4;
71
}
72
73
main, footer {
74
  padding: 0;
75
  line-height: 160%;
76
}
77
78
nav { padding: 0.4rem 0 1.5rem 0; }
79
nav ul {
80
  list-style: none;
81
  padding-bottom: 20px;
82
}
83
84
nav ul li {
85
  padding-right: 10px;
86
  display: inline-block;
87
}
88
89
/* utilities */
90
.nowrap { white-space: nowrap; }
91
.fill { width: 100%; }
92
.muted { color: var(--gray); }
93
.padtop { padding-top: 20px; }
94
95
.center {
96
  display: flex;
97
  justify-content: center;
98
}
99
100
.size { text-align: right; }
101
102
.mode, .size,
103
.commit-hash, .commit-email,
104
.diff-type { font-family: var(--mono-font); }
105
106
.mb { margin-bottom: 1rem; }
107
108
/* tables */
109
.table {
110
  width: 100%;
111
  border-collapse: collapse;
112
  table-layout: auto;
113
}
114
115
.table th {
116
  text-align: left;
117
  font-weight: 500;
118
  border-bottom: 1.5px solid var(--medium-gray);
119
  padding: 0.25em 0.5em;
120
}
121
122
.table td {
123
  border-bottom: 1px solid var(--light-gray);
124
  padding: 0.25em 0.5em;
125
  vertical-align: top;
126
}
127
128
.table tbody tr:hover { background: var(--light); }
129
.table tbody tr.nohover:hover { background: transparent; }
130
131
/* tooltip */
132
.tooltip {
133
  display: none;
134
  position: absolute;
135
  left: 0;
136
  top: 100%;
137
  margin-top: 0.25rem;
138
  padding: 0.5rem 0.7rem;
139
  background: var(--white);
140
  border: 1px solid var(--medium-gray);
141
  border-radius: 4px;
142
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
143
  z-index: 10;
144
  font-size: 0.85em;
145
  line-height: 1.3;
146
  max-width: 48ch;
147
  white-space: nowrap;
148
}
149
150
.author, .age { position: relative; }
151
152
.author:hover .tooltip,
153
.author:focus-within .tooltip,
154
.age:hover .tooltip,
155
.age:focus-within .tooltip {
156
  display: block;
157
}
158
159
/* box */
160
.box {
161
  background: var(--light-gray);
162
  padding: 0.6rem;
163
}
164
165
.box + .box {
166
  margin-top: 0.8rem;
167
}
168
169
/* repo header */
170
.repo-header { margin-bottom: 1.25rem; }
171
172
.repo-breadcrumb,
173
.repo-breadcrumb a {
174
  color: var(--gray);
175
}
176
177
.repo-breadcrumb:before { content: "<"; }
178
179
.repo-name {
180
  font-size: 1.6rem;
181
  line-height: 1.1;
182
  margin-top: 0.25rem;
183
}
184
185
.repo-header .desc { margin-top: 0.35rem; }
186
.repo-header .repo-nav { padding: 0.5rem 0 0 0; }
187
.repo-header .repo-nav ul { padding-bottom: 0; }
188
189
/* index page */
190
.index { margin-top: 2em; }
191
192
/* repo index */
193
.repo-index {
194
  display: flex;
195
  gap: 1.25rem;
196
  align-items: flex-start;
197
}
198
199
.repo-index-main { flex: 0 0 72ch; }
200
.repo-index-main .box { width: 100%; }
201
.repo-index-side {
202
  flex: 0 0 26rem;
203
  min-width: 0;
204
}
205
206
.repo-index-side h2 {
207
  font-size: 1.4rem;
208
  padding: 0;
209
}
210
211
/* log page */
212
.log td.author .author-short {
213
  display: inline-block;
214
  max-width: 25ch;
215
  overflow: hidden;
216
  text-overflow: ellipsis;
217
  vertical-align: top;
218
}
219
220
/* tree */
221
.tree, .log, .repo-index { margin-bottom: 2em; }
222
223
/* file View */
224
.file-wrapper {
225
  display: flex;
226
  flex-direction: row;
227
  gap: 1rem;
228
  padding: 0 0.5rem;
229
  background: var(--light-gray);
230
  overflow-x: auto;
231
}
232
233
.file-contents {
234
  width: 100%;
235
  padding: 0.3em 0 0.3em 0;
236
}
237
238
.line-number {
239
  width: 1%;
240
  -moz-user-select: -moz-none;
241
  -khtml-user-select: none;
242
  -webkit-user-select: none;
243
  -o-user-select: none;
244
}
245
246
.line-number a:hover { border-bottom: none; }
247
.line-number a {
248
    display: block;
249
    padding: 0 1rem;
250
    text-decoration: none;
251
}
252
253
.line:has(a:target) { background-color: rgba(0,0,0,0.4); }
254
255
.image-viewer, .binary-viewer { padding: 1rem 0; }
256
.image-viewer img {
257
  max-width: 100%;
258
  height: auto;
259
}
260
261
/* commit */
262
.commit { margin-bottom: 1rem; }
263
264
.commit pre {
265
  padding-bottom: 0;
266
  white-space: pre-wrap;
267
}
268
269
.commit .box { margin-bottom: 0.25rem; }
270
.commit .commit-info {
271
  padding-bottom: 0.25rem;
272
}
273
274
.commit-message {
275
  margin-top: 0.25rem;
276
  font-size: 1rem;
277
  line-height: 1.35;
278
  margin-bottom: 1rem;
279
}
280
281
.commit-info {
282
  color: var(--gray);
283
  font-size: 0.85rem;
284
}
285
286
.commit-date { float: right; }
287
288
.commit-email:before { content: '<'; }
289
.commit-email:after { content: '>'; }
290
291
.commit-refs {
292
  margin: 0.5rem 0 1rem 0;
293
}
294
295
.commit-refs td {
296
  padding: 0.15rem 0.5rem 0.15rem 0;
297
  border: none;
298
}
299
300
.commit-refs td.label {
301
  padding-right: 1rem;
302
}
303
304
/* diff */
305
.diff {
306
  margin: 1rem 0 1rem 0;
307
  padding: 0.6rem;
308
  border-bottom: 1.5px solid var(--medium-gray);
309
  background: var(--light-gray);
310
}
311
312
.diff pre {
313
  padding: 0;
314
  margin: 0;
315
}
316
317
.diff-line {
318
  display: flex;
319
}
320
321
.diff-line .line-number {
322
  flex-shrink: 0;
323
  user-select: none;
324
  -webkit-user-select: none;
325
  text-align: right;
326
  color: var(--gray);
327
  border-right: 1px solid var(--light-gray);
328
  padding: 0 0.5rem;
329
  min-width: 3rem;
330
}
331
332
.diff-line .line-number a {
333
  display: inline;
334
  padding: 0;
335
}
336
337
.diff-line > span:last-child {
338
  flex-grow: 1;
339
  padding: 0 0.5rem;
340
}
341
342
.diff-line:target {
343
  background: rgba(0, 0, 0, 0.05);
344
}
345
346
@media (prefers-color-scheme: dark) {
347
  .diff-line:target {
348
    background: rgba(255, 255, 255, 0.05);
349
  }
350
}
351
352
.diff-stat { padding: 1rem 0 1rem 0; }
353
.diff-add { color: var(--diff-add); }
354
.diff-del { color: var(--diff-del); }
355
.diff-mod { color: var(--cyan); }
356
.diff-noop { color: var(--gray); }
357
.diff-separator {
358
  justify-content: center;
359
  background: var(--medium-gray);
360
}
361
362
.jump { margin-top: 0.5rem; }
363
.jump-table { margin-top: 0.25rem; }
364
365
.jump-table td {
366
  padding: 0.15rem 0.5rem;
367
  border-color: var(--medium-gray);
368
}
369
370
.jump-table .diff-type {
371
  width: 2ch;
372
}
373
374
/* refs */
375
.ref {
376
  font-size: 1rem;
377
  color: var(--gray);
378
  display: inline-block;
379
  padding-top: 0.7em;
380
}
381
382
.refs strong { padding-right: 1em; }
383
.refs pre {
384
  padding-bottom: 0.5rem;
385
  white-space: pre-wrap;
386
}
387
388
.tag-message { margin-left: 0.5rem; }
389
.tag-message summary {
390
  cursor: pointer;
391
  color: var(--gray);
392
}
393
394
/* readme */
395
.readme {
396
  padding: 1.5rem 0;
397
  line-height: 1.6;
398
}
399
.readme > *:first-child { margin-top: 0; }
400
401
.readme h1, .readme h2, .readme h3,
402
.readme h4, .readme h5, .readme h6 {
403
  margin-top: 1.5em;
404
  margin-bottom: 0.5em;
405
  line-height: 1.25;
406
}
407
.readme h1 { font-size: 2rem; }
408
.readme h2 { font-size: 1.5rem; }
409
.readme h3 { font-size: 1.25rem; }
410
.readme h4, .readme h5, .readme h6 { font-size: 1rem; }
411
412
.readme p, .readme ul, .readme ol, .readme pre { margin-bottom: 1em; }
413
.readme ul, .readme ol { padding-left: 2em; }
414
.readme li { margin-bottom: 0.25em; }
415
.readme a { border-bottom: 1.5px solid var(--medium-gray); }
416
.readme a > img { border-bottom: none; }
417
.readme img { max-width: 100%; }
418
.readme pre {
419
  background: var(--light-gray);
420
  padding: 0.6rem;
421
}
422
423
.readme pre.raw {
424
  background: unset;
425
  padding: unset;
426
}
427
428
.readme details > * { padding-left: 1em; }
429
.readme details[data-callout] {
430
  border-left: 4px solid var(--gray);
431
  background: var(--light);
432
  padding: 0.5em 1em;
433
  margin: 1em 0;
434
}
435
.readme details[data-callout] .callout-content { padding-left: 0.5em; }
436
.readme details[data-callout] summary {
437
  font-weight: 600;
438
  cursor: pointer;
439
  margin-bottom: 0.5em;
440
}
441
442
.readme blockquote {
443
  border-left: 3px solid var(--gray);
444
  padding-left: 1em;
445
  color: var(--gray);
446
  margin: 1em 0;
447
}
448
449
@media (max-width: 600px) {
450
  .repo-index {
451
    flex-direction: column;
452
  }
453
454
  .repo-index-main,
455
  .repo-index-side {
456
    flex: none;
457
    width: 100%;
458
  }
459
460
  .commit-info:not(:last-child) {
461
    padding-bottom: 1.5rem;
462
  }
463
464
  pre {
465
    font-size: 0.8rem;
466
  }
467
}