// admin: page parts in the one page language (docs/ui-language.md). Tokens only. // Page families, found by what each page is: settings (the user's own tabs), admin (the admin tabs), // and repo settings (the repo head with its Settings tab). Each family is one selector, so a rule // here never reaches a page outside these three. $settings: 'main:has(> nav.tabs[data-section="settings"])'; $admin: 'main:has(> nav.tabs[data-section="admin"])'; $repo: 'main:has(> section.repo-head .tab.active[href$="/settings"])'; // Fit sheets take the room, like Appearance: the topics sit on one width, not a card in the corner. #{$settings} .sheet.fit { align-self: stretch; } // Beside a rail the sheet is as tall as its content, not as the rail. #{$settings} .work > .sheet.fit { align-self: start; } // Code chips take a radius the page language allows. #{$settings} code, #{$admin} code, #{$repo} code { border-radius: 6px; } // Settings forms: the topics are one column, each topic with a hairline above it. #{$settings} .sheet > form:not(.appearance) > .sec + .sec { border-top: 1px solid var(--border); } // The submit or a test link sits on the control column, under the fields. #{$settings} form > .sec > .acts { margin-left: calc(var(--label-w, 130px) + 16px); > .act:first-child { margin-left: -10px; } @media (max-width: 700px) { margin-left: 0; } } // Log rows: an event is its line, then the notes that belong to it, then a hairline before the next event. #{$settings} .sheet > .line:has(+ .hint), #{$admin} .sheet > .line:has(+ .hint) { border-bottom: 0; } #{$settings} .sheet > .hint, #{$admin} .sheet > .hint { margin: 0; padding: 0 18px; } // The last note of an event closes it with the hairline. #{$settings} .sheet > .hint:not(:has(+ .hint)), #{$admin} .sheet > .hint:not(:has(+ .hint)) { padding-bottom: 10px; border-bottom: 1px solid var(--border); } #{$settings} .sheet > .hint:last-child, #{$admin} .sheet > .hint:last-child { border-bottom: 0; } // The audit filter: the actor field, then the action select with its label beside it, on one line. #{$admin} .sheet-tools form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; } #{$admin} .sheet-tools label { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; text-align: left; font-size: 14px; color: var(--muted); } // Server settings: one setting a line. Its name, then its control on one fixed width, then its notes, // so every control and every note starts on the same edge. A page is short enough to need no scroll. #{$admin} .sheet:has(.srv-row) { --label-w: 210px; .fields { --label-w: 210px; } } #{$admin} .srv-row { display: grid; grid-template-columns: var(--label-w) 280px minmax(0, 1fr); column-gap: 16px; align-items: center; min-height: 52px; padding: 7px 18px; box-sizing: border-box; border-bottom: 1px solid var(--border); } #{$admin} .srv-name { color: var(--text); font-size: 15px; font-weight: 500; line-height: 20px; } #{$admin} .srv-value { display: flex; align-items: center; min-width: 0; overflow-wrap: anywhere; color: var(--text); font-size: 14px; > :is(input:not([type="checkbox"]), select) { width: 100%; max-width: none; } } #{$admin} .srv-hints { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 4px; min-width: 0; > .hint { margin: 0; font-size: 13px; line-height: 18px; } > .hint + .hint::before { content: "ยท "; } .act { height: auto; padding: 0; } } #{$admin} .srv-row:not(:has(+ .srv-row)):not(:has(+ .srv-save)) { border-bottom: 0; } // Save sits under the controls, on their edge. #{$admin} .srv-save { margin: 0; padding: 14px 18px 16px calc(18px + var(--label-w) + 16px); } #{$admin} .sec .srv-row { padding-inline: 0; } #{$admin} .sec .srv-save { padding-inline: calc(var(--label-w) + 16px) 0; } @media (max-width: 700px) { #{$admin} .srv-row { grid-template-columns: minmax(0, 1fr); row-gap: 6px; padding: 10px 14px; } #{$admin} .srv-save { padding-left: 14px; } #{$admin} .sec .srv-row, #{$admin} .sec .srv-save { padding-inline: 0; } } // The server form takes the sheet's width, so its rows reach the same edge as the topic rules. #{$admin} .sheet form.fields { max-width: none; } // The live wrapper around the server page is not a part of the page: its children are. #{$admin} > div[data-live]:not(.sheet) { display: contents; } // Health: a hollow status dot is drawn by its colour alone, not a box, and the words after a dot keep a gap. #{$admin} .health-dot { margin-right: 6px; } #{$admin} .health-dot.off { margin-right: 6px; border: 0; box-shadow: inset 0 0 0 1.5px var(--muted); } // Runner graphs: each panel has the sheet's padding and the small topic heading of every other topic. // The charts inside keep their own look. #{$admin} .mx-panels { gap: 0; margin-top: 0; padding-top: 0; border-top: 1px solid var(--border); } #{$admin} .mx-panel { padding: 14px 18px; } @media (min-width: 900px) { #{$admin} .mx-panel + .mx-panel { border-left: 1px solid var(--border); } } #{$admin} .mx-caption { color: var(--muted); font-size: 13px; font-weight: 600; line-height: 20px; white-space: normal; } // Repo settings: the form takes the sheet's width, and its topics keep the form's inset. #{$repo} .sheet form.fields { max-width: none; } #{$repo} .sheet form.fields > .sec { padding: 14px 0; } #{$repo} .sheet form.fields > .sec + .sec { border-top: 1px solid var(--border); } // Security shows one topic at a time, the one its rail has current. @each $topic in password, email, two-factor, passkeys, sessions, danger { .sheet[data-topic="#{$topic}"] > .sec:not(##{$topic}) { display: none; } } // Health: the verdict leads the head's line with its dot. .head-sub .health-sum::before { content: ""; display: inline-block; width: 8px; height: 8px; margin: 0 8px 1px 0; border-radius: 50%; background: var(--ok); vertical-align: middle; } .head-sub .health-sum.bad::before { background: var(--bad); } // An alert's note belongs to its line: no hairline between them, the hairline closes the pair. #{$admin} .sec[role="alert"] > .line:has(+ .hint) { border-bottom: 0; } #{$admin} .sec[role="alert"] > .line + .hint { margin-top: -8px; padding-bottom: 10px; border-bottom: 1px solid var(--border); } // A wide window holds Storage and Services side by side under the alerts, so the page needs no scroll. @media (min-width: 1000px) { .health-sheet { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } .health-sheet > .sec[role="alert"] { grid-column: 1 / -1; } .sheet.health-sheet > .sec + .sec { border-top: 0; } .sheet.health-sheet > .sec[role="alert"] ~ .sec { border-top: 1px solid var(--border); } .sheet.health-sheet > .sec:last-child { align-self: stretch; border-left: 1px solid var(--border); } } // A runner's recent jobs scroll in their own pane under the tabs, so the Jobs tab fits the window. // The pane reaches the sheet's edges, as its rows do. #{$admin} .runner-recent { max-height: calc(100dvh - 430px); min-height: 140px; margin: 0 -18px -14px; overflow-y: auto; > .line { padding: 8px 18px; } > .line:last-child { border-bottom: 0; } } // Branch rules. The form has two groups, Pushes and Pull requests, each with a heading and its // fields stacked. Its options are toggles: the checkbox itself is drawn as a switch, so it stays the // control for the keyboard and the label, and its focus ring shows. #{$repo} .rule-section, #{$repo} .rule-pr { display: flex; flex-direction: column; gap: 6px; min-width: 0; } // Each group is named in the label column beside its first toggles; a little air between groups. #{$repo} .rule-pr { margin-top: 10px; } #{$repo} .branch-rule-form label.switch { align-items: center; gap: 12px; cursor: pointer; font-weight: 400; > input[type="checkbox"] { position: relative; flex: none; appearance: none; width: 36px; height: 20px; margin: 0; border: 0; border-radius: 10px; background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--border-strong); transition: background 0.15s; &::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform 0.15s, background 0.15s; } &:checked { background: var(--accent); box-shadow: none; &::after { transform: translateX(16px); background: var(--surface); } } &:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; } } } // Pull requests show only while the rule is restricted to pull requests, live as its switch is ticked. // A rule that already keeps a pull request setting keeps the group in view, so no saved value is hidden. #{$repo} .branch-rule-form:has(input[name="restrict_push"]:not(:checked)) .rule-pr:not(.rule-pr-set) { display: none; } // The actions sit under the form on its control column, one row: Save or Add, Cancel, and Remove rule. #{$repo} .rule-edit { --label-w: 130px; } #{$repo} .rule-acts { align-items: center; margin-top: 16px; margin-left: calc(var(--label-w) + 16px); @media (max-width: 700px) { margin-left: 0; } } // The recently seen checks start on the input's edge, in one line under it. #{$repo} .recent-checks { margin-left: 0; } #{$admin} .sheet:has(select[name="storage.backend"]) { [id^="srv-storage.s3."], [id^="srv-storage.r2."] { display: none; } } #{$admin} .sheet:has(select[name="storage.backend"] option[value="s3"]:checked) [id^="srv-storage.s3."], #{$admin} .sheet:has(select[name="storage.backend"] option[value="r2"]:checked) [id^="srv-storage.r2."] { display: grid; }