pub struct ResponsiveStyle {
pub base: Style,
pub breakpoints: HashMap<String, Style>,
}Expand description
A style with optional breakpoint overrides.
Fields§
§base: StyleBase style (applied at all sizes).
breakpoints: HashMap<String, Style>Breakpoint-specific style overrides. Key is the breakpoint name, value is the style overrides.
Implementations§
Source§impl ResponsiveStyle
impl ResponsiveStyle
Sourcepub fn with_breakpoint(self, name: impl Into<String>, style: Style) -> Self
pub fn with_breakpoint(self, name: impl Into<String>, style: Style) -> Self
Add a breakpoint override.
Sourcepub fn with_mobile(self, style: Style) -> Self
pub fn with_mobile(self, style: Style) -> Self
Add a mobile-specific override.
Sourcepub fn with_tablet(self, style: Style) -> Self
pub fn with_tablet(self, style: Style) -> Self
Add a tablet-specific override.
Sourcepub fn with_desktop(self, style: Style) -> Self
pub fn with_desktop(self, style: Style) -> Self
Add a desktop-specific override.
Sourcepub fn style_for_breakpoint(&self, breakpoint: &str) -> Style
pub fn style_for_breakpoint(&self, breakpoint: &str) -> Style
Get the style for a specific breakpoint, merging with base.
Returns the base style merged with breakpoint overrides.
Trait Implementations§
Source§impl Clone for ResponsiveStyle
impl Clone for ResponsiveStyle
Source§fn clone(&self) -> ResponsiveStyle
fn clone(&self) -> ResponsiveStyle
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 ResponsiveStyle
impl Debug for ResponsiveStyle
Source§impl Default for ResponsiveStyle
impl Default for ResponsiveStyle
Source§fn default() -> ResponsiveStyle
fn default() -> ResponsiveStyle
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ResponsiveStyle
impl<'de> Deserialize<'de> for ResponsiveStyle
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 ResponsiveStyle
impl PartialEq for ResponsiveStyle
Source§impl Serialize for ResponsiveStyle
impl Serialize for ResponsiveStyle
impl StructuralPartialEq for ResponsiveStyle
Auto Trait Implementations§
impl Freeze for ResponsiveStyle
impl RefUnwindSafe for ResponsiveStyle
impl Send for ResponsiveStyle
impl Sync for ResponsiveStyle
impl Unpin for ResponsiveStyle
impl UnsafeUnpin for ResponsiveStyle
impl UnwindSafe for ResponsiveStyle
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