forge
Explore
Log in

Don't you dare go Hollow

forge

Clone
★ 0

0 watching0 forksRustAGPL-3.07.1 MiB490f099Tahinli7 hours ago322 commits

_one_admin.scss435 lines, 10.1 KiBHistoryRawDownload
1// admin: page parts in the one page language (docs/ui-language.md). Tokens only.
2// Page families, found by what each page is: settings (the user's own tabs), admin (the admin tabs),
3// and repo settings (the repo head with its Settings tab). Each family is one selector, so a rule
4// here never reaches a page outside these three.
5$settings: 'main:has(> nav.tabs[data-section="settings"])';
6$admin: 'main:has(> nav.tabs[data-section="admin"])';
7$repo: 'main:has(> section.repo-head .tab.active[href$="/settings"])';
8
9// Fit sheets take the room, like Appearance: the topics sit on one width, not a card in the corner.
10#{$settings} .sheet.fit {
11 align-self: stretch;
12}
13
14// Beside a rail the sheet is as tall as its content, not as the rail.
15#{$settings} .work > .sheet.fit {
16 align-self: start;
17}
18
19// Code chips take a radius the page language allows.
20#{$settings} code,
21#{$admin} code,
22#{$repo} code {
23 border-radius: 6px;
24}
25
26
27// Settings forms: the topics are one column, each topic with a hairline above it.
28#{$settings} .sheet > form:not(.appearance) > .sec + .sec {
29 border-top: 1px solid var(--border);
30}
31
32// The submit or a test link sits on the control column, under the fields.
33#{$settings} form > .sec > .acts {
34 margin-left: calc(var(--label-w, 130px) + 16px);
35
36 > .act:first-child {
37 margin-left: -10px;
38 }
39
40 @media (max-width: 700px) {
41 margin-left: 0;
42 }
43}
44
45// Log rows: an event is its line, then the notes that belong to it, then a hairline before the next event.
46#{$settings} .sheet > .line:has(+ .hint),
47#{$admin} .sheet > .line:has(+ .hint) {
48 border-bottom: 0;
49}
50
51#{$settings} .sheet > .hint,
52#{$admin} .sheet > .hint {
53 margin: 0;
54 padding: 0 18px;
55}
56
57// The last note of an event closes it with the hairline.
58#{$settings} .sheet > .hint:not(:has(+ .hint)),
59#{$admin} .sheet > .hint:not(:has(+ .hint)) {
60 padding-bottom: 10px;
61 border-bottom: 1px solid var(--border);
62}
63
64#{$settings} .sheet > .hint:last-child,
65#{$admin} .sheet > .hint:last-child {
66 border-bottom: 0;
67}
68
69// The audit filter: the actor field, then the action select with its label beside it, on one line.
70#{$admin} .sheet-tools form {
71 display: flex;
72 flex-wrap: wrap;
73 align-items: center;
74 gap: 8px;
75}
76
77#{$admin} .sheet-tools label {
78 display: inline-flex;
79 flex-direction: row;
80 align-items: center;
81 gap: 8px;
82 text-align: left;
83 font-size: 14px;
84 color: var(--muted);
85}
86
87
88// Server settings: one setting a line. Its name, then its control on one fixed width, then its notes,
89// so every control and every note starts on the same edge. A page is short enough to need no scroll.
90#{$admin} .sheet:has(.srv-row) {
91 --label-w: 210px;
92
93 .fields {
94 --label-w: 210px;
95 }
96}
97
98#{$admin} .srv-row {
99 display: grid;
100 grid-template-columns: var(--label-w) 280px minmax(0, 1fr);
101 column-gap: 16px;
102 align-items: center;
103 min-height: 52px;
104 padding: 7px 18px;
105 box-sizing: border-box;
106 border-bottom: 1px solid var(--border);
107}
108
109#{$admin} .srv-name {
110 color: var(--text);
111 font-size: 15px;
112 font-weight: 500;
113 line-height: 20px;
114}
115
116#{$admin} .srv-value {
117 display: flex;
118 align-items: center;
119 min-width: 0;
120 overflow-wrap: anywhere;
121 color: var(--text);
122 font-size: 14px;
123
124 > :is(input:not([type="checkbox"]), select) {
125 width: 100%;
126 max-width: none;
127 }
128}
129
130#{$admin} .srv-hints {
131 display: flex;
132 flex-wrap: wrap;
133 align-items: baseline;
134 column-gap: 4px;
135 min-width: 0;
136
137 > .hint {
138 margin: 0;
139 font-size: 13px;
140 line-height: 18px;
141 }
142
143 > .hint + .hint::before {
144 content: "· ";
145 }
146
147 .act {
148 height: auto;
149 padding: 0;
150 }
151}
152
153#{$admin} .srv-row:not(:has(+ .srv-row)):not(:has(+ .srv-save)) {
154 border-bottom: 0;
155}
156
157// Save sits under the controls, on their edge.
158#{$admin} .srv-save {
159 margin: 0;
160 padding: 14px 18px 16px calc(18px + var(--label-w) + 16px);
161}
162
163#{$admin} .sec .srv-row {
164 padding-inline: 0;
165}
166
167#{$admin} .sec .srv-save {
168 padding-inline: calc(var(--label-w) + 16px) 0;
169}
170
171@media (max-width: 700px) {
172 #{$admin} .srv-row {
173 grid-template-columns: minmax(0, 1fr);
174 row-gap: 6px;
175 padding: 10px 14px;
176 }
177
178 #{$admin} .srv-save {
179 padding-left: 14px;
180 }
181
182 #{$admin} .sec .srv-row,
183 #{$admin} .sec .srv-save {
184 padding-inline: 0;
185 }
186}
187
188// The server form takes the sheet's width, so its rows reach the same edge as the topic rules.
189#{$admin} .sheet form.fields {
190 max-width: none;
191}
192
193// The live wrapper around the server page is not a part of the page: its children are.
194#{$admin} > div[data-live]:not(.sheet) {
195 display: contents;
196}
197
198// Health: a hollow status dot is drawn by its colour alone, not a box, and the words after a dot keep a gap.
199#{$admin} .health-dot {
200 margin-right: 6px;
201}
202
203#{$admin} .health-dot.off {
204 margin-right: 6px;
205 border: 0;
206 box-shadow: inset 0 0 0 1.5px var(--muted);
207}
208
209// Runner graphs: each panel has the sheet's padding and the small topic heading of every other topic.
210// The charts inside keep their own look.
211#{$admin} .mx-panels {
212 gap: 0;
213 margin-top: 0;
214 padding-top: 0;
215 border-top: 1px solid var(--border);
216}
217
218#{$admin} .mx-panel {
219 padding: 14px 18px;
220}
221
222@media (min-width: 900px) {
223 #{$admin} .mx-panel + .mx-panel {
224 border-left: 1px solid var(--border);
225 }
226}
227
228#{$admin} .mx-caption {
229 color: var(--muted);
230 font-size: 13px;
231 font-weight: 600;
232 line-height: 20px;
233 white-space: normal;
234}
235
236// A group's label in a topic sits on the topic's own edge, like the topic heading.
237#{$repo} .sheet .field-title {
238 margin: 0;
239 padding: 0;
240 color: var(--muted);
241 font-size: 13px;
242 font-weight: 600;
243}
244
245// Repo settings: the form takes the sheet's width, and its topics keep the form's inset.
246#{$repo} .sheet form.fields {
247 max-width: none;
248}
249
250#{$repo} .sheet form.fields > .sec {
251 padding: 14px 0;
252}
253
254#{$repo} .sheet form.fields > .sec + .sec {
255 border-top: 1px solid var(--border);
256}
257
258// Security shows one topic at a time, the one its rail has current.
259@each $topic in password, email, two-factor, passkeys, sessions, danger {
260 .sheet[data-topic="#{$topic}"] > .sec:not(##{$topic}) {
261 display: none;
262 }
263}
264
265// Health: the verdict leads the head's line with its dot.
266.head-sub .health-sum::before {
267 content: "";
268 display: inline-block;
269 width: 8px;
270 height: 8px;
271 margin: 0 8px 1px 0;
272 border-radius: 50%;
273 background: var(--ok);
274 vertical-align: middle;
275}
276
277.head-sub .health-sum.bad::before {
278 background: var(--bad);
279}
280
281// An alert's note belongs to its line: no hairline between them, the hairline closes the pair.
282#{$admin} .sec[role="alert"] > .line:has(+ .hint) {
283 border-bottom: 0;
284}
285
286#{$admin} .sec[role="alert"] > .line + .hint {
287 margin-top: -8px;
288 padding-bottom: 10px;
289 border-bottom: 1px solid var(--border);
290}
291
292// A wide window holds Storage and Services side by side under the alerts, so the page needs no scroll.
293@media (min-width: 1000px) {
294 .health-sheet {
295 display: grid;
296 grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
297 align-items: start;
298 }
299
300 .health-sheet > .sec[role="alert"] {
301 grid-column: 1 / -1;
302 }
303
304 .sheet.health-sheet > .sec + .sec {
305 border-top: 0;
306 }
307
308 .sheet.health-sheet > .sec[role="alert"] ~ .sec {
309 border-top: 1px solid var(--border);
310 }
311
312 .sheet.health-sheet > .sec:last-child {
313 align-self: stretch;
314 border-left: 1px solid var(--border);
315 }
316}
317
318// A runner's recent jobs scroll in their own pane under the tabs, so the Jobs tab fits the window.
319// The pane reaches the sheet's edges, as its rows do.
320#{$admin} .runner-recent {
321 max-height: calc(100dvh - 430px);
322 min-height: 140px;
323 margin: 0 -18px -14px;
324 overflow-y: auto;
325
326 > .line {
327 padding: 8px 18px;
328 }
329
330 > .line:last-child {
331 border-bottom: 0;
332 }
333}
334
335// Branch rules. The form has two groups, Pushes and Pull requests, each with a heading and its
336// fields stacked. Its options are toggles: the checkbox itself is drawn as a switch, so it stays the
337// control for the keyboard and the label, and its focus ring shows.
338#{$repo} .rule-section,
339#{$repo} .rule-pr {
340 display: flex;
341 flex-direction: column;
342 gap: 6px;
343 min-width: 0;
344}
345
346// Each group is named in the label column beside its first toggles; a little air between groups.
347#{$repo} .rule-pr {
348 margin-top: 10px;
349}
350
351#{$repo} .branch-rule-form label.switch {
352 align-items: center;
353 gap: 12px;
354 cursor: pointer;
355 font-weight: 400;
356
357 > input[type="checkbox"] {
358 position: relative;
359 flex: none;
360 appearance: none;
361 width: 36px;
362 height: 20px;
363 margin: 0;
364 border: 0;
365 border-radius: 10px;
366 background: var(--surface-2);
367 box-shadow: inset 0 0 0 1.5px var(--border-strong);
368 transition: background 0.15s;
369
370 &::after {
371 content: "";
372 position: absolute;
373 top: 3px;
374 left: 3px;
375 width: 14px;
376 height: 14px;
377 border-radius: 50%;
378 background: var(--muted);
379 transition: transform 0.15s, background 0.15s;
380 }
381
382 &:checked {
383 background: var(--accent);
384 box-shadow: none;
385
386 &::after {
387 transform: translateX(16px);
388 background: var(--surface);
389 }
390 }
391
392 &:focus-visible {
393 outline: 2px solid var(--focus);
394 outline-offset: 2px;
395 }
396 }
397}
398
399// Pull requests show only while the rule is restricted to pull requests, live as its switch is ticked.
400// A rule that already keeps a pull request setting keeps the group in view, so no saved value is hidden.
401#{$repo} .branch-rule-form:has(input[name="restrict_push"]:not(:checked)) .rule-pr:not(.rule-pr-set) {
402 display: none;
403}
404
405// The actions sit under the form on its control column, one row: Save or Add, Cancel, and Remove rule.
406#{$repo} .rule-edit {
407 --label-w: 130px;
408}
409
410#{$repo} .rule-acts {
411 align-items: center;
412 margin-top: 16px;
413 margin-left: calc(var(--label-w) + 16px);
414
415 @media (max-width: 700px) {
416 margin-left: 0;
417 }
418}
419
420// The recently seen checks start on the input's edge, in one line under it.
421#{$repo} .recent-checks {
422 margin-left: 0;
423}
424
425#{$admin} .sheet:has(select[name="storage.backend"]) {
426 [id^="srv-storage.s3."],
427 [id^="srv-storage.r2."] {
428 display: none;
429 }
430}
431
432#{$admin} .sheet:has(select[name="storage.backend"] option[value="s3"]:checked) [id^="srv-storage.s3."],
433#{$admin} .sheet:has(select[name="storage.backend"] option[value="r2"]:checked) [id^="srv-storage.r2."] {
434 display: grid;
435}