Migration This is my new public git source viewer. Source coming soon. Please contact with concerns/bugs. Contact me

static/css/repo-list.css

554bcfc63721b22faf8bca78d5518d76e24a4d20 · 3.7 KB · 121 lines raw

1 /* Repo listing — owned by views/index.html */
2
3 /* ---- Grid variant (.repo-row) ------------------------------------------
4 minmax(0, …) lets the fr tracks shrink below their min-content width;
5 bare `2fr` is minmax(auto, 2fr), so one long unbroken repo name would
6 hold the track open and overflow the row. */
7 .repo-row {
8 display: grid;
9 grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) auto;
10 gap: 1rem;
11 align-items: center;
12 }
13 .repo-name a {
14 color: var(--fg);
15 font-weight: 600;
16 /* `anywhere` (unlike `break-word`) also lowers min-content width, which
17 is what actually lets the track shrink. */
18 overflow-wrap: anywhere;
19 }
20 .repo-name a:hover { color: var(--accent); }
21 .repo-owner {
22 display: inline-block;
23 margin-left: .5rem;
24 padding: .05rem .4rem;
25 border-radius: 999px;
26 background: var(--bg-subtle, rgba(127, 127, 127, .15));
27 color: var(--fg-subtle);
28 font-size: .7rem;
29 font-weight: 500;
30 vertical-align: middle;
31 }
32 .repo-desc {
33 color: var(--fg-muted);
34 font-size: .85rem;
35 overflow-wrap: anywhere;
36 }
37 .repo-meta {
38 color: var(--fg-subtle);
39 font-size: .8rem;
40 text-align: right;
41 overflow-wrap: break-word;
42 }
43
44 @media (max-width: 640px) {
45 .repo-row {
46 grid-template-columns: minmax(0, 1fr);
47 gap: .5rem;
48 }
49 .repo-meta { text-align: left; }
50 }
51
52 /* ---- Table variant (.table-repos) --------------------------------------
53 Each section is its own <table>. Fixed layout with shared percentages
54 keeps the columns aligned across sections. Two requirements:
55
56 - The table needs a non-auto width. Without it, browsers fall back to
57 auto layout (CSS 2.1 §17.5.2.1), which sizes columns from content
58 per table and produces the cross-section drift.
59 - The percentages must sum to 100%.
60
61 col-meta at 17% fits "2026-09-03 15:04" on one line down to roughly a
62 900px viewport. Narrower than that, the cell wraps at the space between
63 date and time. This only works because the cell isn't `nowrap`:
64 overflow-wrap never applies where white-space forbids wrapping. */
65 .table-repos {
66 table-layout: fixed;
67 width: 100%;
68 }
69 .table-repos .col-repo { width: 25%; }
70 .table-repos .col-desc { width: 58%; }
71 .table-repos .col-meta { width: 17%; }
72 .table-repos td:last-child { white-space: normal; }
73
74 /* Only the full header labels are shown. The narrow layout below hides the
75 header row visually, so the short labels are no longer used; delete
76 .label-short from the markup and this rule can go. */
77 .table-repos .label-short { display: none; }
78
79 /* Below 640px, columns are dropped and each row is stacked:
80
81 name ............ date
82 description
83
84 Once nothing sits side by side, cross-section alignment no longer
85 matters. The header is hidden visually but stays in the accessibility
86 tree. Changing `display` on table elements can remove their implicit
87 table roles in some engines, so add role="table" / "row" / "cell" in
88 the markup if screen-reader semantics matter. */
89 @media (max-width: 640px) {
90 .table-repos,
91 .table-repos tbody,
92 .table-repos td {
93 display: block;
94 width: auto;
95 }
96 .table-repos thead {
97 position: absolute;
98 width: 1px;
99 height: 1px;
100 overflow: hidden;
101 clip-path: inset(50%);
102 white-space: nowrap;
103 }
104 .table-repos tr {
105 display: grid;
106 grid-template-columns: minmax(0, 1fr) auto;
107 grid-template-areas:
108 "repo meta"
109 "desc desc";
110 gap: .25rem .75rem;
111 padding: .6rem 0;
112 }
113 .table-repos td:nth-child(1) { grid-area: repo; }
114 .table-repos td:nth-child(2) { grid-area: desc; }
115 .table-repos td:nth-child(3) {
116 grid-area: meta;
117 text-align: right;
118 /* Safe to keep on one line here: the `auto` track sizes to fit it. */
119 white-space: nowrap;
120 }
121 }