Audited and improved responsive breakpoints for DrawCreditPage to ensure optimal layout across all screen sizes. Fixed inconsistencies between skeleton and main page implementations, and added mobile-first optimizations for very small screens (≤ 480px).
Added responsive media queries for mobile optimization:
Page shell (.dc-page):
- Added
@media (max-width: 480px)to reduce padding fromvar(--space-4)tovar(--space-3) - Provides more usable space on very small screens
Quick-preset buttons (.dc-presets):
- Added
@media (max-width: 480px)to switch from 4 columns to 2 columns - Prevents cramped buttons on mobile devices
- Improves touch target usability
Preview stat cards (.dc-stat-grid):
- Added
@media (max-width: 480px)to switch from 2 columns to 1 column - Ensures stat cards are readable on narrow screens
- Reduces gap from
var(--space-4)tovar(--space-3)for tighter spacing
Refactored DrawCreditPageSkeleton to use consistent dc-* classes:
Before:
- Used Tailwind utilities (
min-h-screen,bg-background,px-4,max-md:pb-28, etc.) - Inconsistent with main page styling approach
- Mixed styling paradigms
After:
- Uses
dc-page,dc-page__inner,dc-page__cardclasses - Uses
dc-credit-line-listanddc-credit-line-itemfor credit line items - Consistent with main page's design token approach
- Skeleton now matches actual page structure
Added new test suite: "DrawCreditPage — responsive breakpoint audit"
Tests added:
- "skeleton uses dc-* classes instead of Tailwind utilities" - Verifies skeleton uses consistent styling
- ".dc-page has reduced padding on screens ≤ 480px" - CSS assertion for mobile padding
- ".dc-presets switches from 4 columns to 2 columns on screens ≤ 480px" - CSS assertion for preset grid
- ".dc-stat-grid switches from 2 columns to 1 column on screens ≤ 480px" - CSS assertion for stat grid
Mobile (≤ 480px):
- Page padding reduced from 16px to 12px
- Quick-preset buttons: 2 columns instead of 4
- Stat cards: stacked vertically instead of side-by-side
- Overall better use of limited screen real estate
Desktop (> 480px):
- No visual changes - maintains existing layout
- Improved touch target sizes on mobile (preset buttons larger with 2-column layout)
- Better readability on small screens (stat cards stacked)
- No changes to screen reader behavior or keyboard navigation
- Maintains WCAG 2.1 AA compliance
- All responsive changes use standard CSS media queries
- Breakpoint at 480px targets very small phones (iPhone SE, etc.)
- Design tokens (
var(--space-*)) maintain consistency - No JavaScript changes - purely CSS improvements
- Skeleton now properly reflects actual page structure
- Added 4 new CSS assertion tests for responsive behavior
- Tests verify media queries are present in stylesheet
- Test verifies skeleton uses consistent dc-* classes
- All tests follow existing pattern from RiskGauge.test.tsx
- Media queries are widely supported across all modern browsers
- Graceful degradation for older browsers (falls back to default layout)
- No JavaScript required for responsive behavior
- No API changes - purely visual/layout improvements
- The implementation follows the existing design token pattern in index.css
- Dark-mode consistency maintained (all properties use CSS variables)
- Reduced-motion users benefit from improved layout on mobile as well