Responsive static site page
Static pages should still use normal Fission layout primitives.
use fission::prelude::*;
const PHONE_BREAKPOINT: f32 = 720.0;
pub struct PricingPage;
impl From<PricingPage> for Widget {
fn from(_: PricingPage) -> Widget {
Responsive::new(PricingDesktop)
.case(ResponsiveCase::max_width(PHONE_BREAKPOINT, PricingPhone))
.into()
}
}
For repeated cards, use responsive grid tracks instead of manual column counts.
const PLAN_CARD_MIN_WIDTH: f32 = 240.0;
let (_ctx, view) = fission::build::current::<PricingState>();
let spacing = &view.env().theme.tokens.spacing;
Grid {
columns: vec![GridTrack::auto_fit(GridTrack::minmax(
GridTrack::Points(PLAN_CARD_MIN_WIDTH),
GridTrack::Fr(1.0),
))],
column_gap: Some(spacing.m),
row_gap: Some(spacing.m),
children: plan_cards,
..Default::default()
}
.into()
The static-site shell lowers supported layout, paint, font, and responsive primitives to HTML and CSS.