pub struct ResponsiveGrid {
pub columns: HashMap<Breakpoint, u32>,
pub gap: HashMap<Breakpoint, u32>,
pub row_gap: HashMap<Breakpoint, u32>,
pub column_gap: HashMap<Breakpoint, u32>,
}
Expand description
Responsive grid container
Fields§
§columns: HashMap<Breakpoint, u32>
Number of columns for each breakpoint
gap: HashMap<Breakpoint, u32>
Gap between grid items for each breakpoint
row_gap: HashMap<Breakpoint, u32>
Row gap for each breakpoint
column_gap: HashMap<Breakpoint, u32>
Column gap for each breakpoint
Implementations§
Source§impl ResponsiveGrid
impl ResponsiveGrid
Sourcepub fn with_base(columns: u32, gap: u32) -> Self
pub fn with_base(columns: u32, gap: u32) -> Self
Create a responsive grid container with base values
Sourcepub fn set_columns(&mut self, breakpoint: Breakpoint, columns: u32)
pub fn set_columns(&mut self, breakpoint: Breakpoint, columns: u32)
Set number of columns for a specific breakpoint
Sourcepub fn set_gap(&mut self, breakpoint: Breakpoint, gap: u32)
pub fn set_gap(&mut self, breakpoint: Breakpoint, gap: u32)
Set gap for a specific breakpoint
Sourcepub fn set_row_gap(&mut self, breakpoint: Breakpoint, gap: u32)
pub fn set_row_gap(&mut self, breakpoint: Breakpoint, gap: u32)
Set row gap for a specific breakpoint
Sourcepub fn set_column_gap(&mut self, breakpoint: Breakpoint, gap: u32)
pub fn set_column_gap(&mut self, breakpoint: Breakpoint, gap: u32)
Set column gap for a specific breakpoint
Sourcepub fn get_columns(&self, breakpoint: Breakpoint) -> Option<u32>
pub fn get_columns(&self, breakpoint: Breakpoint) -> Option<u32>
Get number of columns for a specific breakpoint
Sourcepub fn get_gap(&self, breakpoint: Breakpoint) -> Option<u32>
pub fn get_gap(&self, breakpoint: Breakpoint) -> Option<u32>
Get gap for a specific breakpoint
Sourcepub fn get_row_gap(&self, breakpoint: Breakpoint) -> Option<u32>
pub fn get_row_gap(&self, breakpoint: Breakpoint) -> Option<u32>
Get row gap for a specific breakpoint
Sourcepub fn get_column_gap(&self, breakpoint: Breakpoint) -> Option<u32>
pub fn get_column_gap(&self, breakpoint: Breakpoint) -> Option<u32>
Get column gap for a specific breakpoint
Sourcepub fn get_columns_or_base(&self, breakpoint: Breakpoint) -> Option<u32>
pub fn get_columns_or_base(&self, breakpoint: Breakpoint) -> Option<u32>
Get number of columns for a specific breakpoint, falling back to base
Sourcepub fn get_gap_or_base(&self, breakpoint: Breakpoint) -> Option<u32>
pub fn get_gap_or_base(&self, breakpoint: Breakpoint) -> Option<u32>
Get gap for a specific breakpoint, falling back to base
Sourcepub fn to_css_classes(&self) -> String
pub fn to_css_classes(&self) -> String
Generate CSS classes for all breakpoints
Sourcepub fn to_css_classes_for_width(&self, screen_width: u32) -> String
pub fn to_css_classes_for_width(&self, screen_width: u32) -> String
Generate CSS classes for a specific screen width
Trait Implementations§
Source§impl Clone for ResponsiveGrid
impl Clone for ResponsiveGrid
Source§fn clone(&self) -> ResponsiveGrid
fn clone(&self) -> ResponsiveGrid
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ResponsiveGrid
impl Debug for ResponsiveGrid
Source§impl Default for ResponsiveGrid
impl Default for ResponsiveGrid
Source§impl<'de> Deserialize<'de> for ResponsiveGrid
impl<'de> Deserialize<'de> for ResponsiveGrid
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ResponsiveGrid
impl PartialEq for ResponsiveGrid
Source§impl Serialize for ResponsiveGrid
impl Serialize for ResponsiveGrid
impl StructuralPartialEq for ResponsiveGrid
Auto Trait Implementations§
impl Freeze for ResponsiveGrid
impl RefUnwindSafe for ResponsiveGrid
impl Send for ResponsiveGrid
impl Sync for ResponsiveGrid
impl Unpin for ResponsiveGrid
impl UnwindSafe for ResponsiveGrid
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more