fabrica

hanna/fabrica

fix(web): stop card-form submit margin from misaligning inline buttons

46dfc15 · hanna committed on 2026-07-25

The .card form submit margin-top (for Save buttons) out-specified the
inline-row overrides and pushed the collaborator Add and avatar Upload
buttons down out of line with their inputs. Exclude buttons tagged
.inline-btn from that rule so they align on the shared control height.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed by hannaSSH key fingerprint: SHA256:4g9cWhkAAw8gwqhJUcVbSnGEvdGwklW+1Aa/fMUu59k
3 files changed · +6 −7UnifiedSplit
assets/base.css +4 −5
@@ -306,8 +306,6 @@ body.drawer-open .drawer-backdrop {
306306 }
307307 .collab-add button {
308308 flex: none;
309- /* Override the card-form submit spacing so it aligns in the row. */
310- margin-top: 0;
311309 }
312310
313311 label {
@@ -337,8 +335,10 @@ select:focus {
337335 outline: none;
338336 }
339337
340-/* Submit buttons in a card form get breathing room from the last field. */
341-.card form button[type="submit"] {
338+/* Submit buttons in a card form get breathing room from the last field —
339+ except buttons that sit inline in a control row (they must not be nudged
340+ down out of alignment with their input). */
341+.card form button[type="submit"]:not(.inline-btn) {
342342 margin-top: 1.1rem;
343343 }
344344 .field-hint {
@@ -789,7 +789,6 @@ select:focus {
789789 color: var(--fb-fg);
790790 }
791791 .avatar-upload-row button[type="submit"] {
792- margin-top: 0;
793792 flex: none;
794793 }
795794
crates/web/src/pages.rs +1 −1
@@ -613,7 +613,7 @@ fn settings_body(user: &User, csrf: &str, notice: Option<&str>) -> Markup {
613613 p class="muted field-hint" { "PNG, JPEG, GIF, or WebP up to 1 MiB. Leave blank for a generated identicon." }
614614 div class="avatar-upload-row" {
615615 input type="file" name="avatar" accept="image/png,image/jpeg,image/gif,image/webp";
616- button class="btn" type="submit" { (icon(Icon::Upload)) span { "Upload" } }
616+ button class="btn inline-btn" type="submit" { (icon(Icon::Upload)) span { "Upload" } }
617617 }
618618 }
619619 }
crates/web/src/repo.rs +1 −1
@@ -790,7 +790,7 @@ async fn repo_settings_view(
790790 (perm_option("write", "Write"))
791791 (perm_option("admin", "Admin"))
792792 }
793- button class="btn btn-primary" type="submit" { "Add" }
793+ button class="btn btn-primary inline-btn" type="submit" { "Add" }
794794 }
795795 }
796796 }