#[repr(C)]pub struct DynamicSelectorContext {Show 15 fields
pub os: OsCondition,
pub os_version: AzString,
pub desktop_env: OptionLinuxDesktopEnv,
pub theme: ThemeCondition,
pub media_type: MediaType,
pub viewport_width: f32,
pub viewport_height: f32,
pub container_width: f32,
pub container_height: f32,
pub container_name: OptionString,
pub prefers_reduced_motion: BoolCondition,
pub prefers_high_contrast: BoolCondition,
pub orientation: OrientationType,
pub pseudo_state: PseudoStateFlags,
pub language: AzString,
}Expand description
Context for evaluating dynamic selectors
Fields§
§os: OsConditionOperating system info
os_version: AzString§desktop_env: OptionLinuxDesktopEnv§theme: ThemeConditionTheme info
media_type: MediaTypeMedia info (from WindowState)
viewport_width: f32§viewport_height: f32§container_width: f32Container info (from parent node) NaN = no container
container_height: f32§container_name: OptionString§prefers_reduced_motion: BoolConditionAccessibility preferences
prefers_high_contrast: BoolCondition§orientation: OrientationTypeOrientation
pseudo_state: PseudoStateFlagsNode state (hover, active, focus, disabled, checked, focus_within, visited)
language: AzStringLanguage/Locale (BCP 47 tag, e.g., “en-US”, “de-DE”)
Implementations§
Source§impl DynamicSelectorContext
impl DynamicSelectorContext
Sourcepub fn from_system_style(system_style: &SystemStyle) -> Self
pub fn from_system_style(system_style: &SystemStyle) -> Self
Create a context from SystemStyle
Sourcepub fn with_viewport(&self, width: f32, height: f32) -> Self
pub fn with_viewport(&self, width: f32, height: f32) -> Self
Update viewport dimensions (e.g., on window resize)
Sourcepub fn with_container(
&self,
width: f32,
height: f32,
name: Option<AzString>,
) -> Self
pub fn with_container( &self, width: f32, height: f32, name: Option<AzString>, ) -> Self
Update container dimensions (for @container queries)
Sourcepub fn with_pseudo_state(&self, state: PseudoStateFlags) -> Self
pub fn with_pseudo_state(&self, state: PseudoStateFlags) -> Self
Update pseudo-state (hover, active, focus, etc.)
Sourcepub fn viewport_breakpoint_changed(
&self,
other: &Self,
breakpoints: &[f32],
) -> bool
pub fn viewport_breakpoint_changed( &self, other: &Self, breakpoints: &[f32], ) -> bool
Check if viewport changed significantly (for breakpoint detection)
Trait Implementations§
Source§impl Clone for DynamicSelectorContext
impl Clone for DynamicSelectorContext
Source§fn clone(&self) -> DynamicSelectorContext
fn clone(&self) -> DynamicSelectorContext
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 DynamicSelectorContext
impl Debug for DynamicSelectorContext
Auto Trait Implementations§
impl Freeze for DynamicSelectorContext
impl RefUnwindSafe for DynamicSelectorContext
impl Send for DynamicSelectorContext
impl Sync for DynamicSelectorContext
impl Unpin for DynamicSelectorContext
impl UnwindSafe for DynamicSelectorContext
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