pub struct ResponsiveBuilder { /* private fields */ }
Expand description
Builder for creating responsive classes
Implementations§
Source§impl ResponsiveBuilder
impl ResponsiveBuilder
Sourcepub fn with_config(config: ResponsiveConfig) -> Self
pub fn with_config(config: ResponsiveConfig) -> Self
Create a responsive builder with custom configuration
Sourcepub fn add_class(
&mut self,
breakpoint: Breakpoint,
class: impl Into<String>,
) -> &mut Self
pub fn add_class( &mut self, breakpoint: Breakpoint, class: impl Into<String>, ) -> &mut Self
Add a class for a specific breakpoint
Sourcepub fn add_classes(
&mut self,
breakpoint: Breakpoint,
classes: Vec<String>,
) -> &mut Self
pub fn add_classes( &mut self, breakpoint: Breakpoint, classes: Vec<String>, ) -> &mut Self
Add classes for a specific breakpoint
Sourcepub fn base(&mut self, class: impl Into<String>) -> &mut Self
pub fn base(&mut self, class: impl Into<String>) -> &mut Self
Add a class for the base breakpoint
Sourcepub fn sm(&mut self, class: impl Into<String>) -> &mut Self
pub fn sm(&mut self, class: impl Into<String>) -> &mut Self
Add a class for the small breakpoint
Sourcepub fn md(&mut self, class: impl Into<String>) -> &mut Self
pub fn md(&mut self, class: impl Into<String>) -> &mut Self
Add a class for the medium breakpoint
Sourcepub fn lg(&mut self, class: impl Into<String>) -> &mut Self
pub fn lg(&mut self, class: impl Into<String>) -> &mut Self
Add a class for the large breakpoint
Sourcepub fn xl(&mut self, class: impl Into<String>) -> &mut Self
pub fn xl(&mut self, class: impl Into<String>) -> &mut Self
Add a class for the extra large breakpoint
Sourcepub fn xl2(&mut self, class: impl Into<String>) -> &mut Self
pub fn xl2(&mut self, class: impl Into<String>) -> &mut Self
Add a class for the 2X large breakpoint
Sourcepub fn responsive(
&mut self,
base: impl Into<String>,
sm: Option<String>,
md: Option<String>,
lg: Option<String>,
xl: Option<String>,
xl2: Option<String>,
) -> &mut Self
pub fn responsive( &mut self, base: impl Into<String>, sm: Option<String>, md: Option<String>, lg: Option<String>, xl: Option<String>, xl2: Option<String>, ) -> &mut Self
Add responsive classes for all breakpoints
Sourcepub fn get_classes(&self, breakpoint: Breakpoint) -> Vec<String>
pub fn get_classes(&self, breakpoint: Breakpoint) -> Vec<String>
Get classes for a specific breakpoint
Sourcepub fn get_all_classes(&self) -> HashMap<Breakpoint, Vec<String>>
pub fn get_all_classes(&self) -> HashMap<Breakpoint, Vec<String>>
Get all classes for all breakpoints
Sourcepub fn remove_breakpoint(&mut self, breakpoint: Breakpoint) -> Vec<String>
pub fn remove_breakpoint(&mut self, breakpoint: Breakpoint) -> Vec<String>
Remove classes for a specific breakpoint
Sourcepub fn build_for_width(&self, screen_width: u32) -> String
pub fn build_for_width(&self, screen_width: u32) -> String
Build classes for a specific screen width
Sourcepub fn get_config(&self) -> &ResponsiveConfig
pub fn get_config(&self) -> &ResponsiveConfig
Get the configuration
Sourcepub fn update_config(&mut self, config: ResponsiveConfig)
pub fn update_config(&mut self, config: ResponsiveConfig)
Update the configuration
Trait Implementations§
Source§impl Clone for ResponsiveBuilder
impl Clone for ResponsiveBuilder
Source§fn clone(&self) -> ResponsiveBuilder
fn clone(&self) -> ResponsiveBuilder
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 ResponsiveBuilder
impl Debug for ResponsiveBuilder
Source§impl Default for ResponsiveBuilder
impl Default for ResponsiveBuilder
Source§impl<'de> Deserialize<'de> for ResponsiveBuilder
impl<'de> Deserialize<'de> for ResponsiveBuilder
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 Display for ResponsiveBuilder
impl Display for ResponsiveBuilder
Source§impl PartialEq for ResponsiveBuilder
impl PartialEq for ResponsiveBuilder
Source§impl Serialize for ResponsiveBuilder
impl Serialize for ResponsiveBuilder
impl StructuralPartialEq for ResponsiveBuilder
Auto Trait Implementations§
impl Freeze for ResponsiveBuilder
impl RefUnwindSafe for ResponsiveBuilder
impl Send for ResponsiveBuilder
impl Sync for ResponsiveBuilder
impl Unpin for ResponsiveBuilder
impl UnwindSafe for ResponsiveBuilder
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