Skip to main content

Module responsive

Module responsive 

Source
Expand description

Responsive design system and mobile styling utilities.

Centralizes the mobile/responsive CSS shared across pages so behavior stays consistent across device sizes: the base utilities and the mobile tab bar.

§Breakpoint Strategy

Mobile-first approach with these breakpoints:

  • 768px: Tablets (primary mobile breakpoint, --breakpoint-mobile)
  • 1024px: Small laptops (--breakpoint-tablet)

§Touch Target Standards

Follows WCAG 2.5 guidelines:

  • Minimum: 44x44px
  • Comfortable: 48x48px
  • Large (primary actions): 56x56px

§Usage

Include the styles in the page component:

use logicaffeine_web::ui::responsive::{MOBILE_BASE_STYLES, MOBILE_TAB_BAR_STYLES};

rsx! {
    style { "{MOBILE_BASE_STYLES}" }
    style { "{MOBILE_TAB_BAR_STYLES}" }
}

§CSS Classes

ClassDescription
.desktop-onlyHidden on mobile (≤768px)
.mobile-onlyHidden on desktop (>768px)
.touch-targetMinimum 44x44px touch area
.safe-topRespects notch/status bar
.safe-bottomRespects home indicator
.scroll-smoothiOS momentum scrolling

Modules§

breakpoints
The widths and heights the layout changes at, in CSS pixels.
media
The media queries the Studio’s stylesheets and these shared ones use, by name. A stylesheet cannot read a custom property inside @media, so each query is written out in the CSS, and the one-Studio lock holds every @media the Studio draws from to one of media::ALL. The app’s own matchMedia checks use the same strings.
touch
Touch targets, in CSS pixels (WCAG 2.5.5).

Constants§

MOBILE_BASE_STYLES
Include this in your root component (app.rs) for global mobile utilities
MOBILE_TAB_BAR_STYLES
Reusable mobile tab bar styles - use for any tabbed interface on mobile