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