1@layer components {
2 /* buttons: one shape for links and buttons that act */
3 .btn {
4 display: inline-flex; align-items: center; gap: var(--s2); white-space: nowrap;
5 height: 32px; padding: 0 var(--s3);
6 font: 600 var(--fs-s) / 1 var(--font); color: var(--ink); text-decoration: none;
7 background: var(--bg-raised); border: 1px solid var(--border-strong); border-radius: var(--r-s);
8 cursor: pointer;
9 &:hover { background: var(--bg-strong); color: var(--ink-hi); text-decoration: none; }
10 & kbd { margin-right: -4px; }
11 &.primary { background: var(--ink-hi); color: var(--on-ink); border-color: var(--ink-hi); }
12 &.primary:hover { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
13 &.danger:hover { color: var(--red); border-color: var(--red); }
14 &.icon { width: 32px; justify-content: center; padding: 0; }
15 &[aria-disabled="true"] { opacity: .45; pointer-events: none; }
16 &[aria-current="true"], &[aria-pressed="true"] { background: var(--bg-strong); color: var(--ink-hi); border-color: var(--ink-mute); }
17 }
18 /* icons: SVG files used as masks, so they take the colour of the text */
19 .ico { display: inline-block; width: 16px; height: 16px; flex: none; background: currentColor; mask: var(--i) center / contain no-repeat; }
20 .i-branch { --i: url(icons/branch.svg); }
21 .i-search { --i: url(icons/search.svg); }
22 .i-file { --i: url(icons/file.svg); }
23 .i-chevron { --i: url(icons/chevron.svg); }
24 .i-tag { --i: url(icons/tag.svg); }
25 .i-user { --i: url(icons/user.svg); }
26 .i-key { --i: url(icons/key.svg); }
27 .i-log-in { --i: url(icons/log-in.svg); }
28 .i-log-out { --i: url(icons/log-out.svg); }
29
30 .pill {
31 display: inline-flex; align-items: center; height: 20px; padding: 0 var(--s2); margin-left: var(--s1);
32 font: 600 var(--fs-xs) / 1 var(--mono); color: var(--ink-dim); vertical-align: 1px;
33 background: var(--bg-raised); border: 1px solid var(--border-strong); border-radius: 999px; white-space: nowrap;
34 &.tag::before { content: ""; width: 6px; height: 6px; margin-right: 6px; border: 1.5px solid currentColor; border-radius: 1px; transform: rotate(45deg); }
35 &.new { color: var(--teal); border-color: currentColor; }
36 }
37 .count {
38 display: inline-block; min-width: 22px; padding: 0 7px; margin-left: var(--s1);
39 font: 600 var(--fs-xs) / 20px var(--font); text-align: center; color: var(--ink-dim);
40 background: var(--bg-raised); border-radius: 999px; vertical-align: 1px;
41 }
42
43 /* header: identity, path and actions on top, the repository tabs below.
44 --hdr-h is its height, the offset of the sticky bars of the diffs. */
45 body { --hdr-h: 57px; }
46 body:has(.hdr .tabs) { --hdr-h: 101px; }
47 .hdr {
48 position: sticky; top: 0; z-index: 20;
49 background: var(--bg-surface); border-bottom: 1px solid var(--border);
50 }
51 .hdr-top {
52 display: flex; align-items: center; gap: var(--s4);
53 max-width: var(--page); margin: 0 auto; height: 56px; padding: 0 var(--pad);
54 }
55 .brand {
56 display: flex; align-items: center; flex: none; text-decoration: none;
57 &:hover { text-decoration: none; }
58 }
59 /* the hermit by his fire: a grey picture in its own rounded square */
60 .brand-mark { width: 32px; height: 32px; flex: none; background: url(icons/brand.svg) center / contain no-repeat; }
61 .crumbs {
62 min-width: 0; flex: 1 1 auto; overflow: hidden;
63 & ol { display: flex; align-items: center; min-width: 0; font-family: var(--mono); font-size: var(--fs); }
64 & li { display: flex; align-items: center; min-width: 0; white-space: nowrap; }
65 & li:last-child { overflow: hidden; }
66 & li::before { content: "/"; padding: 0 var(--s2); color: var(--border-strong); }
67 & a, & span { overflow: hidden; text-overflow: ellipsis; color: var(--ink-dim); text-decoration: none; }
68 & a:hover { color: var(--ink-hi); text-decoration: underline; }
69 & [aria-current] { color: var(--ink-hi); font-weight: 700; }
70 }
71 .hdr-acts { display: flex; align-items: center; gap: var(--s2); margin-left: auto; flex: none; }
72 .ref {
73 font-family: var(--mono); max-width: 28ch;
74 & .ref-name { overflow: hidden; text-overflow: ellipsis; }
75 & .sha { font-weight: 400; color: var(--ink-mute); }
76 }
77 .search {
78 min-width: 220px; justify-content: flex-start; color: var(--ink-mute); font-weight: 400;
79 background: var(--bg-inset);
80 & .search-label { flex: 1; }
81 }
82 .owner {
83 display: flex; align-items: center; gap: var(--s2);
84 & .owner-badge {
85 display: inline-flex; align-items: center; gap: 6px; max-width: 20ch; padding: 0 var(--s1);
86 font: 600 var(--fs-s) / 1 var(--mono); color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
87 }
88 }
89
90 .tabs {
91 max-width: var(--page); margin: 0 auto; padding: 0 var(--pad);
92 overflow-x: auto; scrollbar-width: none;
93 & ul { display: flex; gap: var(--s1); }
94 & a {
95 position: relative; display: flex; align-items: center; gap: var(--s2); height: 44px; padding: 0 var(--s3);
96 color: var(--ink-dim); text-decoration: none; white-space: nowrap; font-weight: 600;
97 }
98 & a::after { content: ""; position: absolute; left: var(--s2); right: var(--s2); bottom: -1px; height: 2px; border-radius: 2px; }
99 & a:hover { color: var(--ink-hi); }
100 & a:hover::after { background: var(--border-strong); }
101 & a[aria-current] { color: var(--ink-hi); }
102 & a[aria-current]::after { background: var(--ink-hi); }
103 & kbd { opacity: .55; }
104 & a:hover kbd, & a:focus-visible kbd, & a[aria-current] kbd { opacity: 1; }
105 }
106
107 /* work area: content and rail, centred, the page scrolls */
108 .work {
109 flex: 1; width: 100%; max-width: var(--page); margin: 0 auto;
110 padding: var(--s5) var(--pad) var(--s7);
111 display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); align-items: start;
112 /* .work grows to fill the page (flex: 1): without this, the rows share the
113 spare height and a short content pushes the rail down */
114 align-content: start;
115 }
116 .work.has-rail { grid-template-columns: minmax(0, 1fr) var(--rail); }
117 .rail { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
118 .work-lede { grid-column: 1 / -1; margin-bottom: calc(-1 * var(--s2)); }
119 main > * + * { margin-top: var(--s4); }
120
121 /* blocks: a surface with a header; rail sections are blocks too */
122 .card, .rail section {
123 background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r);
124 min-width: 0;
125 }
126 .card-h, .rail h2 {
127 display: flex; align-items: center; gap: var(--s2);
128 padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border);
129 font-size: var(--fs); line-height: 20px;
130 & a { margin-left: auto; font: 600 var(--fs-s) / 1 var(--font); color: var(--ink-dim); text-decoration: none; }
131 & a:hover { color: var(--ink-hi); text-decoration: underline; }
132 }
133 .rail section > :not(h2) { margin: var(--s3) var(--s4); }
134 .rail section > .list { margin: var(--s2) 0; }
135 .rail section > p + p { margin-top: calc(-1 * var(--s2)); }
136
137 /* newest tag in the summary rail */
138 .latest-tag {
139 display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2); font-size: var(--fs-s);
140 & .tag-name { display: inline-flex; align-items: center; gap: 6px; font: 700 var(--fs) / 20px var(--mono); color: var(--ink-hi); text-decoration: none; }
141 & .tag-name:hover { text-decoration: underline; }
142 & time { margin-left: auto; }
143 & .tag-sub { flex-basis: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
144 }
145
146 .kv {
147 display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: var(--s4); row-gap: var(--s1);
148 font-size: var(--fs-s);
149 & dt { color: var(--ink-mute); }
150 & dd { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
151 }
152 .outline {
153 font-size: var(--fs-s);
154 & a { display: block; padding: 2px var(--s2); margin: 0 calc(-1 * var(--s2)); border-radius: 4px; color: var(--ink-dim); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
155 & a:hover { background: var(--bg-raised); color: var(--ink-hi); }
156 & .l1 { font-weight: 700; color: var(--ink); }
157 & .l3 { padding-left: var(--s5); }
158 & .l4, & .l5, & .l6 { padding-left: var(--s6); }
159 }
160
161 /* footer: version and source (AGPL §13) */
162 .foot {
163 display: flex; flex-wrap: wrap; gap: var(--s4); align-items: center;
164 width: 100%; max-width: var(--page); margin: 0 auto; padding: var(--s4) var(--pad) var(--s5);
165 font-size: var(--fs-s); color: var(--ink-mute);
166 &::before { content: ""; flex-basis: 100%; height: 1px; margin-bottom: var(--s2); background: var(--border); }
167 & a { color: var(--ink-dim); }
168 & .foot-keys { margin-left: auto; color: var(--ink-dim); }
169 & .foot-keys:hover { color: var(--ink-hi); }
170 }
171
172 /* hint: bottom right, only while it has something to say */
173 .hint {
174 position: fixed; right: var(--s4); bottom: var(--s4); z-index: 25;
175 display: flex; gap: var(--s3); align-items: center;
176 padding: var(--s2) var(--s3); font: 600 var(--fs-s) / 18px var(--mono); color: var(--ink-hi);
177 background: var(--bg-overlay); border: 1px solid var(--border-strong); border-radius: var(--r); box-shadow: var(--shadow);
178 pointer-events: none;
179 & > :empty { display: none; }
180 & .hint-live { color: var(--red); }
181 }
182 /* empty, the badge is out of sight but stays a status region (display: none
183 would drop it from the accessibility tree and its next message would not be
184 announced) */
185 .hint:not(:has(> :not(:empty))) {
186 width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); box-shadow: none;
187 }
188
189 @media (max-width: 1080px) {
190 /* the rail goes under the content, in two columns while there is room */
191 .work.has-rail { grid-template-columns: minmax(0, 1fr); }
192 .rail { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; }
193 .search { min-width: 0; }
194 .search .search-label, .search kbd { display: none; }
195 .search { width: 32px; padding: 0; justify-content: center; }
196 }
197 @media (max-width: 720px) {
198 :root { --pad: var(--s4); }
199 .hdr-top { gap: var(--s3); height: 52px; }
200 .crumbs li:not(:last-child) { display: none; }
201 .ref .sha, .owner .owner-badge { display: none; }
202 .ref { max-width: 16ch; }
203 .work { padding-top: var(--s4); }
204 .rail { grid-template-columns: minmax(0, 1fr); }
205 .tabs kbd { display: none; }
206 .list .c-who, .list .c-desc, .list .c-sub, .list .c-ref, .list .c-size, .list .c-lang { display: none; }
207 }
208}