forge
Explore
Log in

Don't you dare go Hollow

in

Clone
★ 0

0 watching0 forksRustAGPL-3.0528.7 KiB9215377Tahinli27 days ago37 commits

_components.scss598 lines, 10.9 KiBHistoryRawDownload
1//! Components: buttons, form controls, cards, alerts, tables, badges, the empty state, the 404 page
2//! and the "server restarting" bar. Each is one class (or one element) with its states.
3
4// --- Buttons -----------------------------------------------------------------------------------
5
6.button {
7 display: inline-flex;
8 align-items: center;
9 justify-content: center;
10 gap: var(--space-2);
11 min-height: 2.25rem;
12 padding: var(--space-2) var(--space-4);
13 border: 1px solid var(--border);
14 border-radius: var(--radius-sm);
15 background: var(--surface);
16 color: var(--text);
17 font: inherit;
18 font-weight: 550;
19 text-decoration: none;
20 cursor: pointer;
21 box-shadow: var(--shadow);
22 transition: background-color 120ms ease, border-color 120ms ease;
23}
24
25.button:hover {
26 background: var(--surface-2);
27 color: var(--text);
28}
29
30.button:disabled,
31.button[aria-disabled="true"] {
32 opacity: 0.55;
33 cursor: not-allowed;
34}
35
36.button.primary {
37 background: var(--accent);
38 border-color: var(--accent);
39 color: var(--accent-text);
40}
41
42.button.primary:hover {
43 background: var(--accent-strong);
44 border-color: var(--accent-strong);
45 color: var(--accent-text);
46}
47
48.button.danger {
49 color: var(--danger);
50 border-color: var(--danger);
51}
52
53.button.ghost {
54 background: transparent;
55 box-shadow: none;
56 border-color: transparent;
57}
58
59// --- Form controls ----------------------------------------------------------------------------
60
61label {
62 display: block;
63 font-weight: 550;
64 font-size: var(--text-sm);
65 margin-bottom: var(--space-1);
66}
67
68input:not([type="checkbox"]):not([type="radio"]),
69select,
70textarea {
71 width: 100%;
72 min-height: 2.25rem;
73 padding: var(--space-2) var(--space-3);
74 border: 1px solid var(--border);
75 border-radius: var(--radius-sm);
76 background: var(--surface);
77 color: var(--text);
78 font: inherit;
79}
80
81textarea {
82 min-height: 6rem;
83 resize: vertical;
84}
85
86input:focus,
87select:focus,
88textarea:focus {
89 outline: 2px solid var(--focus);
90 outline-offset: 0;
91 border-color: transparent;
92}
93
94input::placeholder,
95textarea::placeholder {
96 color: var(--muted);
97 opacity: 0.8;
98}
99
100.field {
101 display: grid;
102 gap: var(--space-1);
103}
104
105.field + .field {
106 margin-top: var(--space-4);
107}
108
109.field-hint {
110 color: var(--muted);
111 font-size: var(--text-sm);
112}
113
114// --- Cards and text ---------------------------------------------------------------------------
115
116.card {
117 padding: var(--space-6);
118 background: var(--surface);
119 border: 1px solid var(--border);
120 border-radius: var(--radius);
121 box-shadow: var(--shadow);
122}
123
124.card > :last-child {
125 margin-bottom: 0;
126}
127
128.card-title {
129 margin-bottom: var(--space-2);
130}
131
132.muted {
133 color: var(--muted);
134}
135
136.kicker {
137 margin-bottom: var(--space-2);
138 color: var(--muted);
139 font-size: var(--text-sm);
140 font-weight: 600;
141 letter-spacing: 0.04em;
142 text-transform: uppercase;
143}
144
145// --- Alerts -----------------------------------------------------------------------------------
146
147.alert,
148.notice {
149 padding: var(--space-3) var(--space-4);
150 border-radius: var(--radius-sm);
151 border: 1px solid transparent;
152}
153
154.alert {
155 background: var(--danger-soft);
156 color: var(--danger);
157 border-color: var(--danger);
158}
159
160.notice {
161 background: var(--accent-soft);
162 color: var(--text);
163 border-color: var(--accent-soft);
164}
165
166.warning {
167 padding: var(--space-3) var(--space-4);
168 border-radius: var(--radius-sm);
169 border: 1px solid var(--warn);
170 background: var(--warn-soft);
171 color: var(--warn);
172}
173
174// --- Tables and badges ------------------------------------------------------------------------
175
176.table-wrap {
177 overflow-x: auto;
178 border: 1px solid var(--border);
179 border-radius: var(--radius);
180 background: var(--surface);
181}
182
183.table {
184 width: 100%;
185 border-collapse: collapse;
186 font-size: var(--text-sm);
187}
188
189.table th,
190.table td {
191 padding: var(--space-2) var(--space-3);
192 text-align: left;
193 border-bottom: 1px solid var(--border);
194 vertical-align: top;
195}
196
197.table th {
198 color: var(--muted);
199 font-weight: 600;
200 background: var(--surface-2);
201}
202
203.table tr:last-child td {
204 border-bottom: 0;
205}
206
207.badge {
208 display: inline-block;
209 padding: 0.1rem var(--space-2);
210 border-radius: 999px;
211 background: var(--surface-2);
212 color: var(--muted);
213 font-size: 0.8rem;
214 font-weight: 600;
215 white-space: nowrap;
216}
217
218.badge.accent {
219 background: var(--accent-soft);
220 color: var(--accent-strong);
221}
222
223// --- Empty state and the 404 page -------------------------------------------------------------
224
225.empty-state {
226 display: grid;
227 justify-items: center;
228 gap: var(--space-3);
229 padding: var(--space-8) var(--space-6);
230 text-align: center;
231 color: var(--muted);
232 border: 1px dashed var(--border);
233 border-radius: var(--radius);
234}
235
236.empty-state h2 {
237 margin: 0;
238 color: var(--text);
239}
240
241.empty-state p {
242 margin: 0;
243 max-width: 34rem;
244}
245
246.not-found {
247 text-align: center;
248 padding-block: var(--space-8);
249}
250
251.not-found-code {
252 margin: 0;
253 font-size: 3.5rem;
254 font-weight: 700;
255 letter-spacing: -0.03em;
256 color: var(--accent);
257 line-height: 1;
258}
259
260// --- Server restarting bar --------------------------------------------------------------------
261
262// Pinned to the bottom edge. nav.js creates it only while the server is unreachable, so a page
263// that never loses the server never shows it.
264.restart-bar {
265 position: fixed;
266 left: 50%;
267 bottom: var(--space-4);
268 z-index: 50;
269 transform: translateX(-50%);
270 display: flex;
271 align-items: center;
272 gap: var(--space-3);
273 max-width: calc(100vw - 2 * var(--space-4));
274 padding: var(--space-2) var(--space-4);
275 border-radius: 999px;
276 background: var(--warn-soft);
277 color: var(--warn);
278 border: 1px solid var(--warn);
279 box-shadow: var(--shadow-lift);
280 font-size: var(--text-sm);
281 font-weight: 550;
282 animation: restart-in 180ms ease-out;
283}
284
285.restart-bar::before {
286 content: "";
287 width: 0.55rem;
288 height: 0.55rem;
289 border-radius: 50%;
290 background: currentColor;
291 animation: restart-pulse 1.2s ease-in-out infinite;
292}
293
294@keyframes restart-in {
295 from {
296 opacity: 0;
297 transform: translate(-50%, 0.5rem);
298 }
299}
300
301@keyframes restart-pulse {
302 50% {
303 opacity: 0.25;
304 }
305}
306
307// While the page is loading a soft navigation or a refresh, its content dims a little.
308.is-loading main {
309 opacity: 0.6;
310 transition: opacity 120ms ease;
311}
312
313@media (prefers-reduced-motion: reduce) {
314 .restart-bar,
315 .restart-bar::before {
316 animation: none;
317 }
318
319 .is-loading main,
320 .button {
321 transition: none;
322 }
323}
324
325// The drive: listings, forms that sit in a row, row menus, breadcrumbs, the quota bar and the pickers.
326.drive {
327 display: flex;
328 flex-direction: column;
329 gap: 1rem;
330}
331
332.crumbs ol {
333 display: flex;
334 flex-wrap: wrap;
335 gap: 0.35rem;
336 list-style: none;
337 margin: 0;
338 padding: 0;
339 color: var(--muted);
340}
341
342.crumbs li + li::before {
343 content: "/";
344 padding-inline-end: 0.35rem;
345}
346
347.toolbar {
348 display: flex;
349 flex-wrap: wrap;
350 gap: 0.75rem;
351 align-items: center;
352}
353
354.inline-form {
355 display: inline-flex;
356 flex-wrap: wrap;
357 gap: 0.4rem;
358 align-items: center;
359 margin: 0;
360}
361
362.inline-form input[type="text"],
363.inline-form input:not([type]),
364.inline-form input[type="search"],
365.inline-form input[type="file"] {
366 min-width: 12rem;
367}
368
369.actions {
370 display: flex;
371 flex-wrap: wrap;
372 gap: 0.5rem;
373 align-items: center;
374}
375
376.row-menu summary {
377 cursor: pointer;
378 color: var(--accent);
379}
380
381.row-menu-body {
382 display: flex;
383 flex-wrap: wrap;
384 gap: 0.5rem;
385 align-items: center;
386 margin-block-start: 0.5rem;
387}
388
389.details {
390 display: grid;
391 grid-template-columns: max-content 1fr;
392 gap: 0.35rem 1rem;
393 margin: 0;
394}
395
396.details dt {
397 color: var(--muted);
398}
399
400.details dd {
401 margin: 0;
402}
403
404.quota {
405 display: flex;
406 flex-direction: column;
407 align-items: flex-end;
408 font-size: 0.85rem;
409}
410
411.quota progress {
412 width: 9rem;
413}
414
415.pick-list {
416 list-style: none;
417 margin: 0;
418 padding: 0;
419 display: flex;
420 flex-direction: column;
421 gap: 0.35rem;
422}
423
424.pick-list .button {
425 justify-content: flex-start;
426 width: 100%;
427 text-align: start;
428}
429
430.bulk {
431 margin-block-start: 0.5rem;
432}
433
434.trash .table td form {
435 display: inline-flex;
436}
437
438// --- Upload queue and drop overlay ---------------------------------------------------------------
439// The queue panel sits outside <main>, so a soft refresh of the listing does not drop it. The overlay
440// shows while files are dragged over a drive page.
441
442.upload-queue {
443 position: fixed;
444 right: var(--space-4);
445 bottom: var(--space-4);
446 z-index: 40;
447 width: min(24rem, calc(100vw - 2 * var(--space-4)));
448 max-height: 50vh;
449 overflow: auto;
450 padding: var(--space-3);
451 border: 1px solid var(--border);
452 border-radius: var(--radius-sm);
453 background: var(--surface);
454 box-shadow: var(--shadow);
455}
456
457.upload-list {
458 display: grid;
459 gap: var(--space-2);
460 margin: 0;
461 padding: 0;
462 list-style: none;
463}
464
465.upload-item {
466 display: grid;
467 grid-template-columns: 1fr auto;
468 gap: var(--space-1) var(--space-2);
469 align-items: center;
470
471 progress {
472 grid-column: 1 / -1;
473 width: 100%;
474 }
475
476 &[data-state="failed"] .upload-status {
477 color: var(--danger);
478 }
479
480 &[data-state="done"] .upload-status {
481 color: var(--ok);
482 }
483}
484
485.upload-name {
486 overflow: hidden;
487 white-space: nowrap;
488 text-overflow: ellipsis;
489}
490
491.upload-status {
492 color: var(--muted);
493 font-size: 0.875rem;
494}
495
496.drop-overlay {
497 position: fixed;
498 inset: var(--space-3);
499 z-index: 50;
500 display: none;
501 align-items: center;
502 justify-content: center;
503 border: 2px dashed var(--accent);
504 border-radius: var(--radius);
505 background: var(--accent-soft);
506 color: var(--accent-strong);
507 font-weight: 600;
508 pointer-events: none;
509}
510
511.drop-overlay.drop-overlay-show {
512 display: flex;
513}
514
515// --- Thumbnails and the viewer ---------------------------------------------------------------
516
517.name-cell {
518 display: flex;
519 align-items: center;
520 gap: var(--space-3);
521}
522
523.thumb {
524 flex: none;
525 width: 2.5rem;
526 height: 2.5rem;
527 border-radius: var(--radius-sm);
528 object-fit: cover;
529 background: var(--surface-2);
530}
531
532.thumb-icon {
533 display: inline-flex;
534 align-items: center;
535 justify-content: center;
536 border: 1px solid var(--border);
537 color: var(--muted);
538 font-family: var(--font-mono);
539 font-size: 0.7rem;
540}
541
542.viewer-page .viewer-nav {
543 display: flex;
544 justify-content: space-between;
545 gap: var(--space-2);
546 margin-block: var(--space-3);
547}
548
549.viewer-stage {
550 display: flex;
551 flex-direction: column;
552 align-items: center;
553 gap: var(--space-3);
554 min-height: 12rem;
555}
556
557.viewer-image {
558 max-width: 100%;
559 max-height: 75vh;
560 object-fit: contain;
561 border-radius: var(--radius-sm);
562}
563
564.viewer-video,
565.viewer-audio {
566 max-width: 100%;
567}
568
569.viewer-video {
570 max-height: 75vh;
571}
572
573.viewer-frame {
574 width: 100%;
575 height: 75vh;
576 border: 1px solid var(--border);
577 border-radius: var(--radius-sm);
578}
579
580.viewer-text {
581 align-self: stretch;
582 max-height: 75vh;
583 overflow: auto;
584 margin: 0;
585 padding: var(--space-4);
586 border: 1px solid var(--border);
587 border-radius: var(--radius-sm);
588 background: var(--surface);
589 font-family: var(--font-mono);
590 font-size: 0.875rem;
591 white-space: pre-wrap;
592 overflow-wrap: anywhere;
593}
594
595.viewer-card {
596 padding: var(--space-6);
597 text-align: center;
598}