#[repr(C)]pub struct CssPropertyWithConditions {
pub property: CssProperty,
pub apply_if: DynamicSelectorVec,
}Expand description
A CSS property with optional conditions for when it should be applied.
This replaces NodeDataInlineCssProperty with a more flexible system.
If apply_if is empty, the property always applies.
If apply_if contains conditions, ALL conditions must be satisfied for the property to apply.
Fields§
§property: CssPropertyThe actual CSS property value
apply_if: DynamicSelectorVecConditions that must all be satisfied for this property to apply. Empty means unconditional (always apply).
Implementations§
Source§impl CssPropertyWithConditions
impl CssPropertyWithConditions
Sourcepub const fn simple(property: CssProperty) -> Self
pub const fn simple(property: CssProperty) -> Self
Create an unconditional property (always applies) - const version
Sourcepub const fn with_single_condition(
property: CssProperty,
conditions: &'static [DynamicSelector],
) -> Self
pub const fn with_single_condition( property: CssProperty, conditions: &'static [DynamicSelector], ) -> Self
Create a property with a single condition (const version using slice reference)
Sourcepub fn with_condition(property: CssProperty, condition: DynamicSelector) -> Self
pub fn with_condition(property: CssProperty, condition: DynamicSelector) -> Self
Create a property with a single condition (non-const, allocates)
Sourcepub const fn with_conditions(
property: CssProperty,
conditions: DynamicSelectorVec,
) -> Self
pub const fn with_conditions( property: CssProperty, conditions: DynamicSelectorVec, ) -> Self
Create a property with multiple conditions (all must match)
Sourcepub const fn on_hover(property: CssProperty) -> Self
pub const fn on_hover(property: CssProperty) -> Self
Create a property that applies only on hover (const version)
Sourcepub const fn on_active(property: CssProperty) -> Self
pub const fn on_active(property: CssProperty) -> Self
Create a property that applies only when active (const version)
Sourcepub const fn on_focus(property: CssProperty) -> Self
pub const fn on_focus(property: CssProperty) -> Self
Create a property that applies only when focused (const version)
Sourcepub const fn when_disabled(property: CssProperty) -> Self
pub const fn when_disabled(property: CssProperty) -> Self
Create a property that applies only when disabled (const version)
Sourcepub fn on_os(property: CssProperty, os: OsCondition) -> Self
pub fn on_os(property: CssProperty, os: OsCondition) -> Self
Create a property that applies only on a specific OS (non-const, needs runtime value)
Sourcepub const fn dark_theme(property: CssProperty) -> Self
pub const fn dark_theme(property: CssProperty) -> Self
Create a property that applies only in dark theme (const version)
Sourcepub const fn light_theme(property: CssProperty) -> Self
pub const fn light_theme(property: CssProperty) -> Self
Create a property that applies only in light theme (const version)
Sourcepub const fn on_windows(property: CssProperty) -> Self
pub const fn on_windows(property: CssProperty) -> Self
Create a property for Windows only (const version)
Sourcepub const fn on_macos(property: CssProperty) -> Self
pub const fn on_macos(property: CssProperty) -> Self
Create a property for macOS only (const version)
Sourcepub const fn on_linux(property: CssProperty) -> Self
pub const fn on_linux(property: CssProperty) -> Self
Create a property for Linux only (const version)
Sourcepub fn matches(&self, ctx: &DynamicSelectorContext) -> bool
pub fn matches(&self, ctx: &DynamicSelectorContext) -> bool
Check if this property matches in the given context
Sourcepub fn is_conditional(&self) -> bool
pub fn is_conditional(&self) -> bool
Check if this property has any conditions
Sourcepub fn is_pseudo_state_only(&self) -> bool
pub fn is_pseudo_state_only(&self) -> bool
Check if this property is a pseudo-state conditional only (hover, active, focus, etc.)
Sourcepub fn is_layout_affecting(&self) -> bool
pub fn is_layout_affecting(&self) -> bool
Check if this property affects layout (width, height, margin, etc.) TODO: Implement when CssProperty has this method
Trait Implementations§
Source§impl Clone for CssPropertyWithConditions
impl Clone for CssPropertyWithConditions
Source§fn clone(&self) -> CssPropertyWithConditions
fn clone(&self) -> CssPropertyWithConditions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more