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

static/css/base.css

d640ddbb8ad06f0e54d9c6e33c347acf247818e6 · 13.7 KB · 531 lines raw

1 /* gsg — a quiet, text-first interface in the spirit of cgit: hairlines
2 instead of boxes, no shadows, no hover animation. The one indulgence is
3 a black-and-purple signal color -- used for links, hashes, and a thin
4 two-tone stripe at the very top of the page -- so the theme still reads
5 as its own thing rather than "yet another dark git UI".
6
7 Loaded on every page: design tokens, reset, nav, page chrome, and the
8 handful of components (cards, tables, chips, facts-bar, footer,
9 notices) shared by more than one view. View-specific rules live in the
10 other files under static/css/, linked only by the views that need
11 them. */
12
13 :root {
14 /* Base — near-black ink */
15 --bg: #0F111A;
16 --bg-elev: #141725;
17 --surface: #1C2032;
18 --surface-2: #24283C;
19 --line: #2A3045;
20 --line-soft: #2E354E;
21
22 /* Foreground */
23 --fg: #FFFFFF;
24 --fg-muted: #9AA0B3;
25 --fg-subtle: #6B7280;
26
27 /* Accent — one signal color, not a rainbow */
28 --accent: #A78BFA;
29 --accent-2: #7C3AED;
30 --accent-grad: linear-gradient(90deg, var(--accent), var(--accent-2));
31
32 /* Status colors */
33 --add: #10B981;
34 --add-bg: rgba(16, 185, 129, 0.15);
35 --del: #EF4444;
36 --del-bg: rgba(239, 68, 68, 0.15);
37
38 /* Operator notice severities. One token pair per type; the .notice-*
39 modifiers below are the only place the palette is applied. */
40 --notice-critical: #EF4444;
41 --notice-critical-bg: rgba(239, 68, 68, 0.15);
42 --notice-warning: #F59E0B;
43 --notice-warning-bg: rgba(245, 158, 11, 0.15);
44 --notice-info: #60A5FA;
45 --notice-info-bg: rgba(96, 165, 250, 0.15);
46 --notice-fix: #10B981;
47 --notice-fix-bg: rgba(16, 185, 129, 0.15);
48
49 /* Counterpart to --accent -- tags and other "second kind of thing"
50 markers use this instead of a shade too close to the purple accent. */
51 --tag: #FAA78B;
52
53 /* Syntax highlighting -- deliberately just four colours (keyword,
54 string, number, name) plus a muted comment, not a full-spectrum
55 scheme. Blob view only; see static/css/blob.css. */
56 --syn-kw: #818CF8;
57 --syn-str: #34D399;
58 --syn-num: #FAA78B;
59 --syn-fn: #60A5FA;
60
61 /* Lane colors — spectrum for telling graph lanes apart, independent
62 of the brand accent above */
63 --lane-0: #818CF8;
64 --lane-1: #10B981;
65 --lane-2: #F59E0B;
66 --lane-3: #EC4899;
67 --lane-4: #3B82F6;
68 --lane-5: #84CC16;
69
70 /* Typography */
71 --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "Cascadia Mono",
72 Menlo, Consolas, "Liberation Mono", monospace;
73 --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
74
75 /* Spacing & radius */
76 --r: 8px;
77 --r-sm: 4px;
78 --pad: clamp(.85rem, 2.5vw, 1.5rem);
79 }
80
81 /**@media (prefers-color-scheme: light) {
82 :root {
83 --bg: #F3F4F6;
84 --bg-elev: #FFFFFF;
85 --surface: #FFFFFF;
86 --surface-2: #F9FAFB;
87 --line: #E5E7EB;
88 --line-soft: #E5E7EB;
89 --fg: #111827;
90 --fg-muted: #6B7280;
91 --fg-subtle: #9CA3AF;
92 --accent: #7C3AED;
93 --accent-2: #5B21B6;
94 --add: #059669;
95 --del: #DC2626;
96 --tag: #B45309;
97 --notice-critical: #DC2626;
98 --notice-warning: #B45309;
99 --notice-info: #1D4ED8;
100 --notice-fix: #059669;
101 --syn-kw: #4F46E5;
102 --syn-str: #047857;
103 --syn-num: #B45309;
104 --syn-fn: #1D4ED8;
105 }
106 } **/
107
108 /* ---------------------------------------------------------------- reset & base */
109
110 *, *::before, *::after { box-sizing: border-box; }
111
112 html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
113
114 body {
115 margin: 0;
116 background: var(--bg);
117 color: var(--fg);
118 font-family: var(--mono);
119 font-size: 0.78rem;
120 line-height: 1.3;
121 font-variant-ligatures: none;
122 -webkit-font-smoothing: antialiased;
123 }
124
125 a { color: var(--accent); text-decoration: none; }
126 a:hover { text-decoration: underline; }
127
128 /* Full viewport width, minus a small gutter -- no centered max-width
129 column. Anything wide (tables, diffs, the graph) scrolls inside its own
130 container instead of forcing the page to scroll horizontally. */
131 .wrap { width: 100%; margin: 0; padding-inline: var(--pad); }
132
133 /* ---------------------------------------------------------------- navigation */
134
135 .nav {
136 /* position: sticky; z-index: 100; top: 0; */
137 background: #311345;
138 }
139 .nav-inner {
140 display: grid;
141 grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
142 align-items: center;
143 height: 2.3rem;
144 }
145
146 .nav-start {
147 display: flex; align-items: center; gap: .75rem;
148 grid-column: 1;
149 min-width: 0;
150 }
151
152 .nav-end {
153 grid-column: 3;
154 justify-self: end;
155 display: flex; align-items: center; gap: .75rem;
156 }
157
158 .nav-user {
159 font-size: .78rem;
160 color: var(--fg-muted);
161 white-space: nowrap;
162 }
163 .nav-user a { color: var(--fg-muted); }
164 .nav-user a:hover { color: var(--accent); }
165
166 .brand {
167 display: flex; align-items: center; gap: .5rem;
168 color: var(--fg); font-weight: 700; font-size: .95rem;
169 letter-spacing: -.02em;
170 }
171 .brand .logo {
172 height: 24px;
173 width: 24px;
174 background: var(--accent);
175 border-radius: var(--r-sm);
176 display: grid; place-items: center;
177 color: var(--bg); font-weight: 700; font-size: .78rem;
178 margin-right: 0.4rem;
179 }
180 .brand:hover { color: var(--accent); text-decoration: none; }
181
182 .repo-name {
183 color: var(--fg); font-weight: 600;
184 margin-left: .5rem;
185 }
186 .nav-repo-name:hover { color: var(--accent); }
187
188 /* Tabs — plain text, an underline marks the current page */
189 .tabs {
190 display: flex; gap: 1rem;
191 grid-column: 2;
192 justify-self: center;
193 }
194 .tab {
195 padding: .2rem 0;
196 color: var(--fg-muted);
197 font-size: .78rem;
198 border-bottom: 2px solid transparent;
199 }
200 .tab:hover {
201 color: var(--fg);
202 text-decoration: none;
203 }
204 .tab.active {
205 color: var(--fg);
206 border-bottom-color: var(--accent);
207 }
208
209 /* Ref picker — plain, borderless select */
210 .refpicker {
211 position: relative;
212 }
213 .refpicker select {
214 font: inherit; font-size: .78rem;
215 color: var(--fg-muted);
216 background: none;
217 border: 1px solid var(--line);
218 border-radius: var(--r-sm);
219 padding: .25rem 1.75rem .25rem .6rem;
220 cursor: pointer;
221 appearance: none;
222 background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
223 background-repeat: no-repeat;
224 background-position: right .6rem center;
225 background-size: 10px 10px;
226 }
227 .refpicker select:hover { border-color: var(--accent); color: var(--fg); }
228 .refpicker select:focus-visible {
229 outline: 2px solid var(--accent);
230 outline-offset: -2px;
231 }
232
233 /* ---------------------------------------------------------------- page layout */
234
235 main.wrap { padding-bottom: 1.25rem; }
236
237 /* Hero: a plain text header with a hairline underneath -- no box, no
238 gradient. The page title carries the weight instead of a card. */
239 .hero {
240 margin-bottom: 1.25rem;
241 padding: 1rem 0 1rem 0;
242 border-bottom: 1px solid var(--line);
243 }
244
245 .page-head { margin: 1rem 0 1rem 0; }
246
247 .page-title {
248 margin: 0;
249 font-size: 1.3rem;
250 font-weight: 700;
251 letter-spacing: -.02em;
252 line-height: 1.25;
253 /* Repository titles are often long unbroken slugs ("my-project-name").
254 Without this they push past the viewport instead of wrapping. Balance
255 avoids a single dangling word on the second line. */
256 overflow-wrap: anywhere;
257 text-wrap: balance;
258 }
259 .page-subtitle {
260 margin: .35rem 0 0;
261 color: var(--fg-muted);
262 font-size: .82rem;
263 }
264
265 .breadcrumbs {
266 display: flex; flex-wrap: wrap; gap: .4rem;
267 align-items: baseline;
268 margin-top: 1rem;
269 font-size: .9rem;
270 color: var(--fg-muted);
271 }
272 .breadcrumbs a { color: var(--accent); }
273 .breadcrumbs .here { color: var(--fg); }
274
275 /* ---------------------------------------------------------------- cards & containers */
276
277 /* Reserved for content that genuinely needs a boundary (a diff, a grouped
278 sub-section) -- a thin border, nothing else. Most pages don't use it. */
279 .card {
280 border: 1px solid var(--line);
281 border-radius: var(--r);
282 padding: .7rem .9rem;
283 margin-bottom: .75rem;
284 }
285
286 /* Facts bar — a plain line of label: value pairs, cgit-style, not a grid
287 of stat tiles. */
288 .facts-bar {
289 display: flex;
290 flex-wrap: wrap;
291 column-gap: 1.5rem;
292 row-gap: .3rem;
293 margin-bottom: 1rem;
294 font-size: .82rem;
295 }
296 .fact { display: flex; gap: .4rem; align-items: baseline; }
297 .fact-label {
298 color: var(--fg-subtle);
299 }
300 .fact-label::after { content: ":"; }
301 .fact-value {
302 color: var(--fg);
303 font-weight: 600;
304 }
305
306 /* ---------------------------------------------------------------- tables */
307
308 /* Borderless, hairline-separated rows -- like cgit's listings -- rather
309 than a bordered card. Tables can still be wider than the viewport (long
310 paths, many columns on mobile); scrolling lives on the table itself so
311 the page body never gains a horizontal scrollbar. */
312 .table-wrap { overflow-x: auto; line-height: 1.2; }
313 .table {
314 width: 100%;
315 border-collapse: collapse;
316 }
317 .table th {
318 color: var(--fg-subtle);
319 font-size: .68rem;
320 text-transform: uppercase;
321 letter-spacing: .07em;
322 padding: .4rem .6rem;
323 text-align: left;
324 font-weight: 600;
325 border-bottom: 1px solid var(--line);
326 }
327 .table td {
328 padding: .4rem .6rem;
329 border-bottom: 1px solid var(--line-soft);
330 vertical-align: middle;
331 }
332 .table tr:hover td {
333 background: var(--surface-2);
334 }
335
336 /* ---------------------------------------------------------------- chips & badges */
337
338 .chips {
339 display: flex;
340 flex-wrap: wrap;
341 gap: .4rem;
342 list-style: none;
343 margin: 0;
344 padding: 0;
345 }
346 /* Plain bordered tags, not filled pill badges. */
347 .chip {
348 display: inline;
349 align-items: center;
350 gap: .35rem;
351 font-size: .7rem;
352 padding: .2rem .5rem;
353 border: 1px solid var(--line);
354 border-radius: var(--r-sm);
355 color: var(--fg-muted);
356 background: none;
357 }
358 .chip:hover {
359 border-color: var(--accent);
360 color: var(--fg);
361 text-decoration: none;
362 }
363 .chip-tag:hover {
364 border-color: var(--tag);
365 }
366 .chip-branch { color: var(--accent); border-color: currentColor; }
367 .chip-tag { color: var(--tag); border-color: currentColor; }
368 .chip-ok { color: var(--add); border-color: currentColor; }
369 .chip-bad { color: var(--del); border-color: currentColor; }
370
371 .compare-form {
372 display: flex;
373 align-items: center;
374 gap: .4rem;
375 }
376 .compare-input {
377 font: inherit; font-size: .78rem;
378 color: var(--fg);
379 background: none;
380 border: 1px solid var(--line);
381 border-radius: var(--r-sm);
382 padding: .25rem .6rem;
383 min-width: 0;
384 flex: 1 1 20rem;
385 }
386 .compare-input:hover { border-color: var(--accent); }
387 .compare-input:focus-visible {
388 outline: 2px solid var(--accent);
389 outline-offset: -2px;
390 }
391 .compare-form .chip {
392 cursor: pointer;
393 font: inherit;
394 font-size: .7rem;
395 }
396
397 /* ---------------------------------------------------------------- footer */
398
399 footer {
400 margin-top: 1.5rem;
401 padding: 0.35rem 0;
402 border-top: 1px solid var(--line);
403 display: flex;
404 justify-content: space-between;
405 align-items: center;
406 flex-wrap: wrap;
407 gap: .75rem;
408 font-size: .8rem;
409 }
410 footer .footer-left {
411 display: flex;
412 gap: .75rem;
413 align-items: center;
414 }
415 footer .footer-right {
416 color: var(--fg-subtle);
417 font-size: .75rem;
418 }
419 footer a { color: var(--accent); }
420
421 /* ---------------------------------------------------------------- notices */
422
423 .notice {
424 padding: .5rem .8rem;
425 /*border-left: 2px solid var(--accent);*/
426 color: var(--fg-muted);
427 font-size: .8rem;
428 margin: .75rem 0;
429 }
430
431 /* Operator notices. The severity only changes the left rule and the
432 background tint; the base .notice keeps the shared shape. */
433 .notices { margin: .75rem 0 1rem; }
434 .notice-critical { background: var(--notice-critical-bg); }
435 .notice-warning { background: var(--notice-warning-bg); }
436 .notice-info { background: var(--notice-info-bg); }
437 .notice-fix { background: var(--notice-fix-bg); }
438 .notice-title { display: block; color: var(--fg); }
439 .notice-body { white-space: pre-wrap; }
440 .notice-link { margin-left: .35rem; }
441
442 /* ---------------------------------------------------------------- error page */
443
444 .error-page { padding-top: 3rem; padding-bottom: 3rem; text-align: center; }
445 .error-code {
446 font-size: 3rem;
447 font-weight: 700;
448 color: var(--accent);
449 margin: 0;
450 letter-spacing: -.03em;
451 }
452 .error-page .page-title { margin-top: .25rem; }
453 .error-page .page-subtitle { margin-bottom: 1rem; }
454
455 /* ---------------------------------------------------------------- responsive */
456
457 @media (max-width: 640px) {
458 .nav-inner {
459 display: flex;
460 flex-wrap: wrap;
461 height: auto; padding-block: .5rem;
462 }
463 .nav-start {
464 flex: 1 1 auto;
465 /* Let the repo name drop below the brand rather than overflow the row. */
466 flex-wrap: wrap;
467 row-gap: .15rem;
468 }
469 .nav-repo-name {
470 min-width: 0;
471 margin-left: 0;
472 overflow-wrap: anywhere;
473 }
474 .nav-end { margin-left: auto; }
475 .tabs {
476 justify-self: auto;
477 width: 100%;
478 order: 3;
479 gap: .75rem;
480 }
481 .facts-bar {
482 flex-direction: column;
483 gap: .25rem;
484 }
485 .hero { padding-bottom: .7rem; }
486 .page-title {
487 font-size: 1.1rem;
488 }
489 }
490
491 @media (prefers-reduced-motion: reduce) {
492 *, *::before, *::after {
493 animation: none !important;
494 transition: none !important;
495 }
496 }
497
498 /* ---------------------------------------------------------------- utilities */
499
500 .hidden { display: none !important; }
501 .muted { color: var(--fg-muted); }
502 .text-accent { color: var(--accent); }
503 .font-mono { font-family: var(--mono); }
504 .w-full { width: 100%; }
505 .text-right { text-align: right !important; }
506 .text-center { text-align: center !important; }
507 .text-sm { font-size: .78rem; }
508 .text-xs { font-size: .63rem; }
509
510 /* Focus states for accessibility */
511 :focus-visible {
512 outline: 2px solid var(--accent);
513 outline-offset: 2px;
514 }
515
516 /* Scrollbar styling */
517 ::-webkit-scrollbar {
518 height: 8px;
519 width: 8px;
520 }
521 ::-webkit-scrollbar-track {
522 background: var(--bg-elev);
523 border-radius: 4px;
524 }
525 ::-webkit-scrollbar-thumb {
526 background: var(--line);
527 border-radius: 4px;
528 }
529 ::-webkit-scrollbar-thumb:hover {
530 background: var(--fg-subtle);
531 }