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 .i-cards { --i: url(icons/cards.svg); }
30 .i-split { --i: url(icons/split.svg); }
31 .i-compact { --i: url(icons/compact.svg); }
32 .i-refresh-cw { --i: url(icons/refresh-cw.svg); }
33 .i-mailbox { --i: url(icons/mailbox.svg); }
34 .i-sun-moon { --i: url(icons/sun-moon.svg); }
35 .i-sun { --i: url(icons/sun.svg); }
36 .i-moon { --i: url(icons/moon.svg); }
37
38 .pill {
39 display: inline-flex; align-items: center; height: 18px; padding: 0 var(--s2); margin-left: var(--s1);
40 font: 600 var(--fs-2xs) / 1 var(--mono); color: var(--ink-dim); vertical-align: 1px;
41 background: var(--bg-raised); border: 1px solid var(--border-strong); border-radius: 999px; white-space: nowrap;
42 /* a link pill: no underline; the border lightens on hover and focus */
43 &:is(a) { text-decoration: none; cursor: pointer; transition: border-color .12s; }
44 &:is(a):hover, &:is(a):focus-visible { text-decoration: none; border-color: var(--ink-dim); }
45 &.tag::before { content: ""; width: 6px; height: 6px; margin-right: 6px; border: 1.5px solid currentColor; border-radius: 1px; transform: rotate(45deg); }
46 &.new { color: var(--teal); border-color: currentColor; }
47 /* the signature of a commit: the protocol, then the verdict, always as text
48 (colour never carries it alone). Verified takes the accent, a signature
49 that cannot be vouched for keeps the neutral pill with the ink of a
50 warning, a bad one is red, "unsigned" (commit page) is dim. */
51 &.sig { gap: 5px; }
52 &.sig .sig-proto { font-weight: 700; letter-spacing: .02em; }
53 &.sig-ok { color: var(--teal); border-color: currentColor; }
54 &.sig-warn { color: var(--ink-hi); border-style: dashed; }
55 &.sig-bad { color: var(--red); border-color: currentColor; }
56 &.sig-none { color: var(--ink-mute); border-style: dotted; font-weight: 400; }
57 }
58 /* Why a signature is or is not verified, as text: a title alone is not
59 reachable by keyboard, touch or every screen reader. */
60 .sig-why { display: block; margin-top: 2px; }
61 .count {
62 display: inline-block; min-width: 22px; padding: 0 7px; margin-left: var(--s1);
63 font: 600 var(--fs-xs) / 20px var(--font); text-align: center; color: var(--ink-dim);
64 background: var(--bg-raised); border-radius: 999px; vertical-align: 1px;
65 }
66
67 /* header: identity, path and actions on top, the repository tabs below.
68 --hdr-h is its height, the offset of the sticky bars of the diffs. */
69 body { --hdr-h: 57px; }
70 body:has(.hdr .tabs) { --hdr-h: 101px; }
71 /* A row the cursor scrolls to (j / k, scrollIntoView) stops below the
72 sticky header, not under it. */
73 [data-rows] > * { scroll-margin-top: calc(var(--hdr-h) + var(--s3)); scroll-margin-bottom: var(--s3); }
74 .hdr {
75 position: sticky; top: 0; z-index: 20;
76 background: var(--bg-surface); border-bottom: 1px solid var(--border);
77 }
78 .hdr-top {
79 display: flex; align-items: center; gap: var(--s4);
80 max-width: var(--page); margin: 0 auto; height: 56px; padding: 0 var(--pad);
81 }
82 .brand {
83 display: flex; align-items: center; flex: none; text-decoration: none;
84 &:hover { text-decoration: none; }
85 }
86 /* the hermit by his fire: a grey picture in its own rounded square */
87 .brand-mark { width: 32px; height: 32px; flex: none; background: url(icons/brand.svg) center / contain no-repeat; }
88 /* the inbox, right of the logo on the home page: its number in a darker badge */
89 .inbox-btn {
90 flex: none;
91 & .count { margin-left: 0; color: var(--ink-hi); background: var(--bg-canvas); box-shadow: inset 0 0 0 1px var(--border); }
92 }
93 .crumbs {
94 min-width: 0; flex: 1 1 auto; overflow: hidden;
95 & ol { display: flex; align-items: center; min-width: 0; font-family: var(--mono); font-size: var(--fs); }
96 & li { display: flex; align-items: center; min-width: 0; white-space: nowrap; }
97 & li:last-child { overflow: hidden; }
98 & li::before { content: "/"; padding: 0 var(--s2); color: var(--border-strong); }
99 & a, & span { overflow: hidden; text-overflow: ellipsis; color: var(--ink-dim); text-decoration: none; }
100 & a:hover { color: var(--ink-hi); text-decoration: underline; }
101 & [aria-current] { color: var(--ink-hi); font-weight: 700; }
102 }
103 .hdr-acts { display: flex; align-items: center; gap: var(--s2); margin-left: auto; flex: none; }
104 .ref {
105 font-family: var(--mono); max-width: 28ch;
106 & .ref-name { overflow: hidden; text-overflow: ellipsis; }
107 & .sha { font-weight: 400; color: var(--ink-mute); }
108 }
109 .search {
110 min-width: 220px; justify-content: flex-start; color: var(--ink-mute); font-weight: 400;
111 background: var(--bg-inset);
112 & .search-label { flex: 1; }
113 }
114 .owner {
115 display: flex; align-items: center; gap: var(--s2);
116 & .owner-badge {
117 display: inline-flex; align-items: center; gap: 6px; max-width: 20ch; padding: 0 var(--s1);
118 font: 600 var(--fs-s) / 1 var(--mono); color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
119 }
120 }
121
122 .tabs {
123 max-width: var(--page); margin: 0 auto; padding: 0 var(--pad);
124 overflow-x: auto; scrollbar-width: none;
125 & ul { display: flex; gap: var(--s1); }
126 & a {
127 position: relative; display: flex; align-items: center; gap: var(--s2); height: 44px; padding: 0 var(--s3);
128 color: var(--ink-dim); text-decoration: none; white-space: nowrap; font-weight: 600;
129 }
130 & a::after { content: ""; position: absolute; left: var(--s2); right: var(--s2); bottom: -1px; height: 2px; border-radius: 2px; }
131 & a:hover { color: var(--ink-hi); }
132 & a:hover::after { background: var(--border-strong); }
133 & a[aria-current] { color: var(--ink-hi); }
134 & a[aria-current]::after { background: var(--accent); }
135 & kbd { opacity: .55; }
136 & a:hover kbd, & a:focus-visible kbd, & a[aria-current] kbd { opacity: 1; }
137 }
138
139 /* work area: content and rail, centred, the page scrolls */
140 .work {
141 flex: 1; width: 100%; max-width: var(--page); margin: 0 auto;
142 padding: var(--s5) var(--pad) var(--s7);
143 display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); align-items: start;
144 /* .work grows to fill the page (flex: 1): without this, the rows share the
145 spare height and a short content pushes the rail down */
146 align-content: start;
147 }
148 .work.has-rail { grid-template-columns: minmax(0, 1fr) var(--rail); }
149 /* the wide mode (w, ermiteWide): every page takes the whole width of the
150 screen; the rail goes to the right edge, the content takes the rest */
151 html.wide :is(.work, .hdr-top, .tabs, .foot) { max-width: none; }
152 .rail { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
153 .work-lede { grid-column: 1 / -1; margin-bottom: calc(-1 * var(--s2)); }
154 main > * + * { margin-top: var(--s4); }
155
156 /* blocks: a surface with a header; rail sections are blocks too */
157 .card, .rail section {
158 background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r);
159 min-width: 0;
160 }
161 .card-h, .rail h2 {
162 display: flex; align-items: center; gap: var(--s2);
163 padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border);
164 font-size: var(--fs); line-height: 20px;
165 & a { margin-left: auto; font: 600 var(--fs-s) / 1 var(--font); color: var(--ink-dim); text-decoration: none; }
166 & a:hover { color: var(--ink-hi); text-decoration: underline; }
167 }
168 .rail section > :not(h2) { margin: var(--s3) var(--s4); }
169 .rail section > .list { margin: var(--s2) 0; }
170 .rail section > p + p { margin-top: calc(-1 * var(--s2)); }
171
172 /* newest tag, a row of About in the summary rail: one line of text like
173 the rows above it ("v0.9.0 · 36h ago · 9 tags") */
174 .kv dd.latest-tag {
175 & a { color: inherit; text-decoration: none; }
176 & .tag-name { font-weight: 700; color: var(--ink-hi); }
177 & a:hover { color: var(--ink-hi); text-decoration: underline; }
178 }
179
180 .kv {
181 display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: var(--s4); row-gap: var(--s1);
182 font-size: var(--fs-s);
183 & dt { color: var(--ink-mute); }
184 & dd { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
185 }
186 .outline {
187 font-size: var(--fs-s);
188 & 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; }
189 & a:hover { background: var(--bg-raised); color: var(--ink-hi); }
190 & .l1 { font-weight: 700; color: var(--ink); }
191 & .l3 { padding-left: var(--s5); }
192 & .l4, & .l5, & .l6 { padding-left: var(--s6); }
193 }
194
195 /* footer: version and source (AGPL §13), then shortcuts and theme */
196 .foot {
197 display: flex; flex-wrap: wrap; gap: var(--s4); align-items: center;
198 width: 100%; max-width: var(--page); margin: 0 auto; padding: var(--s4) var(--pad) var(--s5);
199 font-size: var(--fs-s); color: var(--ink-mute);
200 &::before { content: ""; flex-basis: 100%; height: 1px; margin-bottom: var(--s2); background: var(--border); }
201 & a { color: var(--ink-dim); }
202 & .foot-keys { margin-left: auto; color: var(--ink-dim); }
203 & .foot-keys:hover { color: var(--ink-hi); }
204 & .foot-theme {
205 display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
206 margin: -6px 0; color: var(--ink-dim); border-radius: var(--r-s);
207 }
208 & .foot-theme:hover { color: var(--ink-hi); background: var(--bg-raised); }
209 }
210
211 /* hint: bottom right, only while it has something to say */
212 .hint {
213 position: fixed; right: var(--s4); bottom: var(--s4); z-index: 25;
214 display: flex; gap: var(--s3); align-items: center;
215 padding: var(--s2) var(--s3); font: 600 var(--fs-s) / 18px var(--mono); color: var(--ink-hi);
216 background: var(--bg-overlay); border: 1px solid var(--border-strong); border-radius: var(--r); box-shadow: var(--shadow);
217 pointer-events: none;
218 & > :empty { display: none; }
219 & > [role="status"] { display: contents; }
220 & .hint-live { color: var(--red); }
221 }
222 /* empty, the badge is out of sight but stays a status region (display: none
223 would drop it from the accessibility tree and its next message would not be
224 announced) */
225 .hint:not(:has(.hint-nav:not(:empty), .hint-sel:not(:empty), .hint-flash:not(:empty), .hint-live:not(:empty))) {
226 width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); box-shadow: none;
227 }
228
229 @media (max-width: 1080px) {
230 /* the rail goes under the content, in two columns while there is room */
231 .work.has-rail { grid-template-columns: minmax(0, 1fr); }
232 .rail { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; }
233 .search { min-width: 0; }
234 .search .search-label, .search kbd { display: none; }
235 .search { width: 32px; padding: 0; justify-content: center; }
236 }
237 @media (max-width: 720px) {
238 :root { --pad: var(--s4); }
239 .hdr-top { gap: var(--s3); height: 52px; }
240 .crumbs li:not(:last-child) { display: none; }
241 .ref .sha, .owner .owner-badge { display: none; }
242 .ref { max-width: 16ch; }
243 .work { padding-top: var(--s4); }
244 .rail { grid-template-columns: minmax(0, 1fr); }
245 .tabs kbd { display: none; }
246 .list .c-who, .list .c-desc, .list .c-sub, .list .c-ref, .list .c-size, .list .c-lang { display: none; }
247 }
248}