[OCaml] Mobile-friendly clone of cgit.
feat body max-width 80rem, show commit author after timestamp
- Set body max-width to 80rem on all pages. - Add a monospace commit-author span after the relative timestamp on /summary and /commits commit lists. - Hide commit-author on mobile (max-width: 600px).
Changed files
lib/static/styles.css
@@ -2,7 +2,7 @@
2
2
3
3
body {
4
4
font-family: Inter, sans-serif;
5
Removed:
max-width: 50em;
5
Added:
max-width: 80rem;
6
6
margin: auto;
7
7
padding: 0;
8
8
background-color: #181818;
@@ -250,6 +250,14 @@
250
250
white-space: nowrap;
251
251
}
252
252
253
Added:
.commit-author {
254
Added:
flex-shrink: 0;
255
Added:
font-family: monospace;
256
Added:
font-size: 0.85em;
257
Added:
color: #b0b0b0;
258
Added:
white-space: nowrap;
259
Added:
}
260
Added:
253
261
.commit-pill {
254
262
display: inline-flex;
255
263
align-items: center;
@@ -806,6 +814,10 @@
806
814
}
807
815
808
816
.timestamp {
817
Added:
display: none;
818
Added:
}
819
Added:
820
Added:
.commit-author {
809
821
display: none;
810
822
}
811
823
lib/views/repo.ml
@@ -354,11 +354,15 @@
354
354
[ class_ "commit-ago" ]
355
355
[ txt "%s" (Time_fmt.relative_time commit.author.date) ])
356
356
in
357
Added:
let author_span =
358
Added:
HTML.(span [ class_ "commit-author" ] [ txt "%s" commit.author.name ])
359
Added:
in
357
360
HTML.(
358
361
li []
359
362
[
360
363
span [ class_ "commit-left" ] [ timestamp_span; pill; title_span ];
361
364
ago_span;
365
Added:
author_span;
362
366
])
363
367
364
368
let rec li_of_preloaded repo (pe : Resolvers.Tree.preloaded_entry) =