[OCaml] Mobile-friendly clone of cgit.
fix repo link is block with ellipsis, not flex container
The anchor in each repo li is now display:block with text-overflow: ellipsis. Content is two inline spans (repo-name + repo-description) joined by an emdash, truncating naturally when the line overflows.
Changed files
lib/static/styles.css
@@ -225,7 +225,6 @@
225
225
div#main ul li > a {
226
226
display: flex;
227
227
align-items: center;
228
Removed:
justify-content: space-between;
229
228
gap: 1em;
230
229
padding: 0.75em;
231
230
min-height: var(--target-size);
@@ -244,24 +243,32 @@
244
243
#repositories li {
245
244
display: flex;
246
245
align-items: center;
247
Removed:
justify-content: space-between;
248
Removed:
gap: 1em;
246
Added:
flex-wrap: wrap;
247
Added:
gap: 0 1em;
249
248
}
250
249
251
Removed:
#repositories li > a {
250
Added:
div#main #repositories li > a {
251
Added:
display: flex;
252
Added:
align-items: center;
252
253
flex: 1;
253
254
min-width: 0;
254
255
overflow: hidden;
255
Removed:
text-overflow: ellipsis;
256
Removed:
white-space: nowrap;
257
256
padding: 0.75em;
258
257
min-height: var(--target-size);
259
Removed:
display: flex;
260
Removed:
align-items: center;
261
258
box-sizing: border-box;
259
Added:
gap: 0.5em;
262
260
}
263
261
262
Added:
.repo-name {
263
Added:
flex-shrink: 0;
264
Added:
white-space: nowrap;
265
Added:
}
266
Added:
264
267
.repo-description {
268
Added:
overflow: hidden;
269
Added:
text-overflow: ellipsis;
270
Added:
white-space: nowrap;
271
Added:
min-width: 0;
265
272
color: #b0b0b0;
266
273
font-size: 0.85em;
267
274
}
lib/views/root.ml
@@ -11,7 +11,7 @@
11
11
let desc_span =
12
12
if description = Resolvers.default_repo_description then HTML.null []
13
13
else
14
Removed:
HTML.(span [ class_ "repo-description" ] [ txt " — %s" description ])
14
Added:
HTML.(span [ class_ "repo-description" ] [ txt "%s" description ])
15
15
in
16
16
let ago_span =
17
17
match List.assoc_opt full_path dates with
@@ -26,7 +26,10 @@
26
26
li []
27
27
[
28
28
Routes.link_to (Routes.Repo full_path)
29
Removed:
(null [ txt "%s" repo_name; desc_span ]);
29
Added:
(null
30
Added:
[
31
Added:
span [ class_ "repo-name" ] [ txt "%s" repo_name ]; desc_span;
32
Added:
]);
30
33
ago_span;
31
34
])
32
35
| Resolvers.Directory (dir_name, children) ->