Issue 412 Sign In Card Cramped On Phones - edmozley/freeitsm GitHub Wiki
๐ฑ #412 The sign-in card was cramped on phones
GitHub #412, reported and fixed by @cloudcogsio ยท sign-in pages, analyst and portal ยท fixed in 5.8.0 (#3026)
What you saw
On a phone, the sign-in card ran edge to edge - no gap at either side - and the fields inside it were a narrow column: 240px wide on a 360px phone.
What was wrong
- The card was
width: 100%with amax-widthof 400px (420px for the forced password change), on a page with no padding of its own. Below 400px wide there was nothing between the card and the screen edge. - The card kept its 40px padding all round at every size, which took 80px of a 360px screen before the fields began.
Was it more than one place? Five pages, each with its own copy of the card rule: auth/login.php, auth/forgot-password.php, auth/reset-password.php, auth/force_password_change.php and self-service/login.php. The portal's register, forgot and reset pages already padded the page and looked right.
The fix
@cloudcogsio sent the fix on a branch; it is merged with their authorship. In each of the five rules:
.login-container {
/* Full width less a margin each side, so on a phone the card never touches the edges. */
width: calc(100% - 2 * var(--space-5, 20px));
max-width: 400px;
}
/* On a phone the 40px padding leaves the fields a narrow column. */
@media (max-width: 480px) {
.login-container { padding: var(--space-6, 24px) var(--space-5, 20px); }
}
The margin is on the card, not padding on the page, so the sign-in designer's full-width banner and footer strips, and its left / right form positions, keep working. The corner, shadow and background now name their tokens with the old values as fallbacks; these pages do not load theme.css, so the fallbacks are what draw and nothing else looks different.
๐ Files
| File | Change |
|---|---|
๐ฃ auth/login.php, auth/forgot-password.php, auth/reset-password.php, auth/force_password_change.php |
Card margin and phone padding |
๐ฃ self-service/login.php |
The same, for the portal |
How it was verified
The three busiest pages - analyst sign-in, portal sign-in and forgot password - were loaded in 360px frames on a test install: each card sits 20px in from both edges with 280px fields. (A 360px frame, not a 360px browser window: headless Chrome will not draw a window that narrow, and a screenshot of one looks cut off when it is not.) Above 480px the card is unchanged.
What this means for you
Update to 5.8.0 and signing in on a phone has room to breathe. Nothing changes on a laptop.