This document outlines the responsive design improvements made to authentication pages (Login, Signup, ForgotPassword) and the AuthLayout component to ensure excellent user experience from 320px to 1920px+ screen widths.
-
Outer Container: Changed from
p-6topx-4 py-6 sm:p-6- Mobile (320px-639px): 16px horizontal padding, 24px vertical padding
- Small screens (640px+): 24px all-around padding
-
Card Padding: Changed from
p-8 md:p-10topx-5 py-8 sm:p-8 md:p-10- Mobile (320px-639px): 20px horizontal, 32px vertical padding
- Small screens (640px+): 32px all-around padding
- Medium screens (768px+): 40px all-around padding
-
Title Responsiveness: Changed from
text-3xltotext-2xl sm:text-3xl- Mobile: 24px font size
- Small screens+: 30px font size
-
Text Line Height: Added
leading-relaxedto subtitle and helperText for better readability
- Maintained proper heading hierarchy
- Text remains readable at all breakpoints
- Sufficient contrast ratio (WCAG 2.1 AA)
Changed the password label + "Forgot password?" link layout:
Before:
<div className="flex flex-wrap gap-y-2 justify-between items-baseline mb-2">After:
<div className="flex flex-col sm:flex-row sm:items-baseline sm:justify-between gap-2 mb-2">Benefits:
- Mobile (320px-639px): Items stack vertically
- Small screens (640px+): Items display horizontally
- Consistent 8px gap between items
- No overlapping text
- Better alignment control
.btn-primary: Addedmin-height: 44px, flex layout,font-size: 1rem.btn-secondary: Addedmin-height: 44px, flex layout,font-size: 1rem
Benefits:
- Meets 44x44px minimum tap target size (WCAG AAA on touch devices)
- Improves accessibility for motor impairments
- Better visual feedback
.link-styled(new class):- Added
min-height: 44px,min-width: 44px - Flex layout with center alignment
- Hover state with primary-hover color
- Added
Applied to "Forgot password?" link in Login page.
| Breakpoint | Device Example | Card Width | Padding | Notes |
|---|---|---|---|---|
| 320px | iPhone SE | Full (20px margin) | px-5 py-8 | Minimum tested |
| 375px | iPhone 12/13 | Full (20px margin) | px-5 py-8 | Common small phone |
| 480px | Small Android | Full (20px margin) | px-5 py-8 | Max mobile width |
| 640px+ | Tablet portrait | 480px max-w | sm:p-8 | Breakpoint transition |
| 768px+ | Tablet landscape | 480px max-w | md:p-10 | Full padding |
| 1024px+ | Desktop | 480px max-w | md:p-10 | Normal desktop |
- 320px-639px: Label on first line, "Forgot password?" on second line
- 640px+: Label and link on same line with space-between
- Gap: Consistent 8px spacing
- Touch targets: Both elements 44px+ in height
- Maintains center alignment at all breakpoints
- Consistent max-width of 480px
- Proper horizontal centering with padding
- Titles wrap appropriately on small screens
- Subtitles use relaxed line-height for readability
- No text overflow at any breakpoint
- ✅ Touch target sizes: 44x44px minimum (WCAG AAA equivalent)
- ✅ Focus indicators: 2px outlines with 2px offset
- ✅ Color contrast: All text meets AA standards on dark background
- ✅ Text spacing: Proper line-height and margins
- ✅ Responsive text: Scales appropriately at all breakpoints
- All interactive elements are keyboard accessible
- Focus visible on all buttons and links
- Tab order flows logically
- All form inputs have proper labels
- Error messages use
role="alert" - Buttons have descriptive aria-labels
- Link purposes are clear
- Test at 320px, 375px, 480px, 640px, 768px, 1024px
- Verify card remains centered
- Verify password row doesn't overlap
- Check icon positioning in inputs
- Verify button sizes and spacing
- Check text wrapping and line breaks
- Run axe DevTools accessibility audit
- Test keyboard navigation (Tab, Enter, Shift+Tab)
- Verify focus indicators are visible
- Test screen reader with NVDA/JAWS
- Verify color contrast ratios (4.5:1 minimum for AA)
- Test on actual mobile devices
- Verify touch target sizes (44px+)
- Test form input interactions
- Check password visibility toggle
- Verify link tap targets
- Chrome/Edge (latest)
- Firefox (latest)
- Safari (latest)
- Safari iOS (latest)
- Chrome Mobile
- Minimal: Added breakpoints use existing Tailwind classes
- No new CSS file needed
- Leverages Tailwind's responsive utilities
- No CLS (Cumulative Layout Shift) issues
- Padding and sizing defined upfront
- Smooth transitions between breakpoints
| Browser | Desktop | Mobile |
|---|---|---|
| Chrome | ✅ Latest | ✅ Latest |
| Firefox | ✅ Latest | ✅ Latest |
| Safari | ✅ 15+ | ✅ 15+ |
| Edge | ✅ Latest | - |
| IE | ❌ Not supported | - |
- No breaking changes to component APIs
- Backward compatible with existing layouts
- No new dependencies required
- CSS changes are purely additive
- Add dark mode color tokens if not already present
- Consider sticky header for long forms
- Add loading states with proper feedback
- Add password strength indicator
- Implement remember-me functionality