Expand description
Responsive design system and mobile styling utilities.
Centralizes all mobile/responsive concerns to ensure consistent behavior across device sizes. Provides breakpoints, touch target standards, and reusable CSS for mobile-first components.
§Breakpoint Strategy
Mobile-first approach with these breakpoints:
XS(480px): Small phonesSM(640px): Large phones, small tabletsMD(768px): Tablets (primary mobile breakpoint)LG(1024px): Small laptopsXL(1280px): Desktops
§Touch Target Standards
Follows WCAG 2.5 guidelines:
- Minimum: 44x44px
- Comfortable: 48x48px
- Large (primary actions): 56x56px
§Usage
Include base styles in your root component:
use logicaffeine_web::ui::responsive::{MOBILE_BASE_STYLES, all_mobile_styles};
rsx! {
// Option 1: Just the base utilities
style { "{MOBILE_BASE_STYLES}" }
// Option 2: All mobile styles including tabs, panels, buttons
style { "{all_mobile_styles()}" }
}§CSS Classes
| Class | Description |
|---|---|
.desktop-only | Hidden on mobile (≤768px) |
.mobile-only | Hidden on desktop (>768px) |
.touch-target | Minimum 44x44px touch area |
.safe-top | Respects notch/status bar |
.safe-bottom | Respects home indicator |
.scroll-smooth | iOS momentum scrolling |
Modules§
- breakpoints
- Standard breakpoint values used across the application
- media
- Media query helpers - use these in your CSS strings
- touch
- WCAG 2.5 compliant touch target sizes
Constants§
- MOBILE_
BASE_ STYLES - Include this in your root component (app.rs) for global mobile utilities
- MOBILE_
BUTTON_ STYLES - Mobile-optimized button styles with proper touch targets
- MOBILE_
INPUT_ STYLES - Mobile-optimized form input styles
- MOBILE_
PANEL_ STYLES - Styles for switchable panel content (used with mobile tabs)
- MOBILE_
RESIZER_ STYLES - On mobile, hide desktop resizers entirely
- MOBILE_
TAB_ BAR_ STYLES - Reusable mobile tab bar styles - use for any tabbed interface on mobile
Functions§
- all_
mobile_ styles - All mobile styles combined - include this for a complete mobile solution
- with_
mobile_ styles - Generate a complete mobile-ready style block for a page This combines the base mobile utilities with any page-specific styles