Sign-in page: a non-square logo is centre-cropped into an 84×84 square — the card must size itself to the logo's real width and height #1748

Closed
opened 2026-09-22 19:37:12 +00:00 by ben · 3 comments
Owner

Ben, 2026-09-22, reading the live Whakatōhea Demo sign-in page.

Every branded sign-in surface paints the community logo into a fixed 84×84 rounded square, background-size: cover — so a logo that is not square is centre-cropped. A wide wordmark loses its ends; a tall mark loses its top and bottom. There is no width or height anywhere in the decision, and the card around it is a fixed width, so nothing can grow to fit.

The same block is copy-pasted across the surfaces:

  • internal/idp/brand.go:97 — the IDIP sign-in page;
  • internal/idp/deviceapprove.go:261 — the device-approval page;
  • internal/idp/appdoorpage.go:93 — the app door;
  • the Kanidm-path login CSS carries the same shape (clan.WriteBrandLogo's consumer).

Live on the demo right now: --oc-logo-full: url("https://whakatohea-demo.idss.nz/brand/logo") (20959 B, image/jpeg) painted cover into .logo { width:84px; height:84px }.

Wanted (Ben, 2026-09-22 — CSS only, no dynamic card width, no stored dimensions)

The crop exists only because the logo is a background-image on a fixed-size div: a background cannot size its box, so the box has to be square and something has to be cropped. Draw the logo as an <img> element instead and the browser does the aspect ratio itself, with no measurement, no JavaScript and no kit change:

.logo {                       /* now an <img>, not a div */
  display: block;
  height: 84px;               /* the band every logo shares */
  width: auto;                /* the browser derives it from the image */
  max-width: 100%;            /* a very wide wordmark scales down inside the card */
  margin: 0 auto 18px;
  object-fit: contain;        /* never cropped */
  border-radius: 18px;
  background: var(--oc-logo-bg, var(--oc-accent, #619793));
}
  • A square logo renders 84×84 in a rounded square — identical to today.
  • A wide wordmark renders 84 tall and as wide as it needs, the tinted badge hugging its real shape, shrinking (and keeping its proportions) only if it would outgrow the card.
  • A tall mark renders 84 tall and narrow.
  • The card's width does not change. Nothing widens, nothing jumps.

No layout shift: the band is a fixed 84 px tall and the image is centred in a fixed-width card, so nothing below it moves while the image loads (a min-height on the wrapper covers a slow load). The kit therefore needs no width/height fields — dropped from this ticket.

The letter-mark fallback (no logo in the kit) keeps its current square badge, unchanged.

Where

The same block is copy-pasted across the surfaces and all four move together:

  • internal/idp/brand.go:97 — the IDIP sign-in page;
  • internal/idp/deviceapprove.go:261 — the device-approval page;
  • internal/idp/appdoorpage.go:93 — the app door;
  • the Kanidm-path login CSS (clan.WriteBrandLogo's consumer).

Each currently emits .logo { width:84px; height:84px; background-image: var(--oc-logo-full) } around an empty <div class="logo" data-field="community-logo">. The data-field stays; the element becomes an <img> carrying the same alt the div's aria-label carries now.

Design

docs/ux/wireframes/dashboard-auth/da-s1-community-sign-in.html draws the 84×84 square as the contract; it gets an amendment note and a wide-logo variant beside the square one (an agent may amend under ADR 0174 — two-way, DDR 0147's full-colour-logo intent is unchanged). The device-approval and app-door frames get the same note.

Acceptance

  • A wide wordmark renders whole at sign-in, 84 px tall, with the badge hugging its shape; a square logo's rendering is unchanged from today.
  • The card's width is identical in every case.
  • No layout shift while the logo loads.
  • All four surfaces match, proven by one shared CSS source rather than four copies where practical.
  • A brand-reach drive leg eyeballs a wide-logo community on a live gateway (the class of check that caught #1716).
**Ben, 2026-09-22, reading the live Whakatōhea Demo sign-in page.** Every branded sign-in surface paints the community logo into a **fixed 84×84 rounded square, `background-size: cover`** — so a logo that is not square is centre-**cropped**. A wide wordmark loses its ends; a tall mark loses its top and bottom. There is no width or height anywhere in the decision, and the card around it is a fixed width, so nothing can grow to fit. The same block is copy-pasted across the surfaces: - `internal/idp/brand.go:97` — the IDIP sign-in page; - `internal/idp/deviceapprove.go:261` — the device-approval page; - `internal/idp/appdoorpage.go:93` — the app door; - the Kanidm-path login CSS carries the same shape (`clan.WriteBrandLogo`'s consumer). Live on the demo right now: `--oc-logo-full: url("https://whakatohea-demo.idss.nz/brand/logo")` (20959 B, `image/jpeg`) painted `cover` into `.logo { width:84px; height:84px }`. ## Wanted (Ben, 2026-09-22 — CSS only, no dynamic card width, no stored dimensions) The crop exists only because the logo is a **background-image on a fixed-size div**: a background cannot size its box, so the box has to be square and something has to be cropped. Draw the logo as an **`<img>` element** instead and the browser does the aspect ratio itself, with no measurement, no JavaScript and no kit change: ```css .logo { /* now an <img>, not a div */ display: block; height: 84px; /* the band every logo shares */ width: auto; /* the browser derives it from the image */ max-width: 100%; /* a very wide wordmark scales down inside the card */ margin: 0 auto 18px; object-fit: contain; /* never cropped */ border-radius: 18px; background: var(--oc-logo-bg, var(--oc-accent, #619793)); } ``` - A **square** logo renders 84×84 in a rounded square — identical to today. - A **wide** wordmark renders 84 tall and as wide as it needs, the tinted badge hugging its real shape, shrinking (and keeping its proportions) only if it would outgrow the card. - A **tall** mark renders 84 tall and narrow. - The card's width **does not change**. Nothing widens, nothing jumps. No layout shift: the band is a fixed 84 px tall and the image is centred in a fixed-width card, so nothing below it moves while the image loads (a `min-height` on the wrapper covers a slow load). The kit therefore needs **no** width/height fields — dropped from this ticket. The letter-mark fallback (no logo in the kit) keeps its current square badge, unchanged. ## Where The same block is copy-pasted across the surfaces and all four move together: - `internal/idp/brand.go:97` — the IDIP sign-in page; - `internal/idp/deviceapprove.go:261` — the device-approval page; - `internal/idp/appdoorpage.go:93` — the app door; - the Kanidm-path login CSS (`clan.WriteBrandLogo`'s consumer). Each currently emits `.logo { width:84px; height:84px; background-image: var(--oc-logo-full) }` around an empty `<div class="logo" data-field="community-logo">`. The `data-field` stays; the element becomes an `<img>` carrying the same `alt` the div's `aria-label` carries now. ## Design `docs/ux/wireframes/dashboard-auth/da-s1-community-sign-in.html` draws the 84×84 square as the contract; it gets an amendment note and a wide-logo variant beside the square one (an agent may amend under ADR 0174 — two-way, DDR 0147's full-colour-logo intent is unchanged). The device-approval and app-door frames get the same note. ## Acceptance - A wide wordmark renders **whole** at sign-in, 84 px tall, with the badge hugging its shape; a square logo's rendering is unchanged from today. - The card's width is identical in every case. - No layout shift while the logo loads. - All four surfaces match, proven by one shared CSS source rather than four copies where practical. - A brand-reach drive leg eyeballs a wide-logo community on a live gateway (the class of check that caught #1716).
Author
Owner

Ben, 2026-09-22: CSS only — no dynamic card width, no stored logo dimensions. The crop is an artefact of painting the logo as a background-image on a fixed square div: a background cannot size its box. As an <img> with height: 84px; width: auto; max-width: 100%; object-fit: contain, the browser derives the width from the image itself — a square logo renders exactly as today, a wordmark renders whole with the tinted badge hugging its shape, and the card never changes width. The brand-kit width/height fields and the card-widening rule are dropped from the ticket, and needs-design with them: the frame amendment is a two-way door an agent may take under ADR 0174.

**Ben, 2026-09-22: CSS only — no dynamic card width, no stored logo dimensions.** The crop is an artefact of painting the logo as a `background-image` on a fixed square div: a background cannot size its box. As an `<img>` with `height: 84px; width: auto; max-width: 100%; object-fit: contain`, the browser derives the width from the image itself — a square logo renders exactly as today, a wordmark renders whole with the tinted badge hugging its shape, and the card never changes width. The brand-kit width/height fields and the card-widening rule are dropped from the ticket, and `needs-design` with them: the frame amendment is a two-way door an agent may take under ADR 0174.

swarm-claim host=bens-mac-04 run=30373
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=bens-mac-04 run=30373 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1748 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1748,
  "status": "success",
  "commits": [
    "a93cc2637da6bd41433fea0508956bd9ddf45950"
  ],
  "changed_files": [
    "STATUS.md",
    "docs/ux/wireframes/dashboard-auth/da-s1-community-sign-in.html",
    "docs/ux/wireframes/wallet-signin/ws-s1-sign-in-app-door.html",
    "internal/idp/appdoorpage.go",
    "internal/idp/brand.go",
    "internal/idp/brand_latebind_seam_test.go",
    "internal/idp/brand_logo_img_seam_test.go",
    "internal/idp/deviceapprove.go"
  ],
  "tests": [
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/idp/",
      "exit_code": 0
    },
    {
      "command": "gofmt -l (changed idp .go files)",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/idp/ ./internal/founding/ ./internal/controlapi/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "A wide wordmark renders whole at sign-in, 84px tall, badge hugging its shape; a square logo unchanged": "internal/idp/brand.go logoCSS (img.logo: height:84px; width:auto; max-width:100%; object-fit:contain) + logoMark() draws <img>; proven by brand_logo_img_seam_test.go TestLogoImg_NeverCropped (asserts contain/auto/84px, no background-size:cover)",
    "The card's width is identical in every case": "logoCSS touches no card width (img max-width:100% scales inside the fixed card); brand_logo_img_seam_test.go TestLogoImg_CardWidthUnchanged asserts main max-width:380px preserved",
    "No layout shift while the logo loads": "logoCSS img.logo min-height:84px reserves the band; TestLogoImg_NeverCropped asserts min-height:84px present",
    "All four surfaces match, proven by one shared CSS source rather than four copies": "single logoCSS const + logoMark() in brand.go consumed by sign-in/signed-out (brand.go), device-approval (deviceapprove.go), app-door (appdoorpage.go); kanidm .kanidm_logo already contained; brand_logo_img_seam_test.go TestLogoImg_SharedAcrossSurfaces asserts identical logoCSS + <img> in all four",
    "A brand-reach drive leg eyeballs a wide-logo community on a live gateway": "OUT OF SCOPE for this code slice (a drive-time check) — recorded as owed in the commit and STATUS.md; the code slice ships the CSS/render change and wireframe amendments that make it verifiable"
  },
  "summary": "The community logo now renders whole as an <img> (object-fit:contain) from one shared CSS source across all four bridge sign-in surfaces, never centre-cropped, with the card width unchanged.",
  "reason": "",
  "blockers": []
}
**close-report** for #1748 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1748, "status": "success", "commits": [ "a93cc2637da6bd41433fea0508956bd9ddf45950" ], "changed_files": [ "STATUS.md", "docs/ux/wireframes/dashboard-auth/da-s1-community-sign-in.html", "docs/ux/wireframes/wallet-signin/ws-s1-sign-in-app-door.html", "internal/idp/appdoorpage.go", "internal/idp/brand.go", "internal/idp/brand_latebind_seam_test.go", "internal/idp/brand_logo_img_seam_test.go", "internal/idp/deviceapprove.go" ], "tests": [ { "command": "go build ./...", "exit_code": 0 }, { "command": "go vet ./internal/idp/", "exit_code": 0 }, { "command": "gofmt -l (changed idp .go files)", "exit_code": 0 }, { "command": "go test ./internal/idp/ ./internal/founding/ ./internal/controlapi/", "exit_code": 0 } ], "criteria": { "A wide wordmark renders whole at sign-in, 84px tall, badge hugging its shape; a square logo unchanged": "internal/idp/brand.go logoCSS (img.logo: height:84px; width:auto; max-width:100%; object-fit:contain) + logoMark() draws <img>; proven by brand_logo_img_seam_test.go TestLogoImg_NeverCropped (asserts contain/auto/84px, no background-size:cover)", "The card's width is identical in every case": "logoCSS touches no card width (img max-width:100% scales inside the fixed card); brand_logo_img_seam_test.go TestLogoImg_CardWidthUnchanged asserts main max-width:380px preserved", "No layout shift while the logo loads": "logoCSS img.logo min-height:84px reserves the band; TestLogoImg_NeverCropped asserts min-height:84px present", "All four surfaces match, proven by one shared CSS source rather than four copies": "single logoCSS const + logoMark() in brand.go consumed by sign-in/signed-out (brand.go), device-approval (deviceapprove.go), app-door (appdoorpage.go); kanidm .kanidm_logo already contained; brand_logo_img_seam_test.go TestLogoImg_SharedAcrossSurfaces asserts identical logoCSS + <img> in all four", "A brand-reach drive leg eyeballs a wide-logo community on a live gateway": "OUT OF SCOPE for this code slice (a drive-time check) — recorded as owed in the commit and STATUS.md; the code slice ships the CSS/render change and wireframe amendments that make it verifiable" }, "summary": "The community logo now renders whole as an <img> (object-fit:contain) from one shared CSS source across all four bridge sign-in surfaces, never centre-cropped, with the card width unchanged.", "reason": "", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#1748
No description provided.