[−][src]Struct azul_css::DynamicCssProperty
A DynamicCssProperty
is a type of css property that can be changed on possibly
every frame by the Rust code - for example to implement an On::Hover
behaviour.
The syntax for such a property looks like this:
#my_div { padding: var(--my_dynamic_property_id, 400px); }
Azul will register a dynamic property with the key "my_dynamic_property_id" and the default value of 400px. If the property gets overridden during one frame, the overridden property takes precedence.
At runtime the style is immutable (which is a performance optimization - if we
can assume that the property never changes at runtime), we can do some optimizations on it.
Dynamic style properties can also be used for animations and conditional styles
(i.e. hover
, focus
, etc.), thereby leading to cleaner code, since all of these
special cases now use one single API.
Fields
dynamic_id: String
The stringified ID of this property, i.e. the "my_id"
in width: var(--my_id, 500px)
.
default_value: CssProperty
Default values for this properties - one single value can control multiple properties!
Implementations
impl DynamicCssProperty
[src]
pub fn is_inheritable(&self) -> bool
[src]
pub fn can_trigger_relayout(&self) -> bool
[src]
Trait Implementations
impl Clone for DynamicCssProperty
[src]
fn clone(&self) -> DynamicCssProperty
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for DynamicCssProperty
[src]
impl Eq for DynamicCssProperty
[src]
impl Hash for DynamicCssProperty
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for DynamicCssProperty
[src]
fn cmp(&self, other: &DynamicCssProperty) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<DynamicCssProperty> for DynamicCssProperty
[src]
fn eq(&self, other: &DynamicCssProperty) -> bool
[src]
fn ne(&self, other: &DynamicCssProperty) -> bool
[src]
impl PartialOrd<DynamicCssProperty> for DynamicCssProperty
[src]
fn partial_cmp(&self, other: &DynamicCssProperty) -> Option<Ordering>
[src]
fn lt(&self, other: &DynamicCssProperty) -> bool
[src]
fn le(&self, other: &DynamicCssProperty) -> bool
[src]
fn gt(&self, other: &DynamicCssProperty) -> bool
[src]
fn ge(&self, other: &DynamicCssProperty) -> bool
[src]
impl StructuralEq for DynamicCssProperty
[src]
impl StructuralPartialEq for DynamicCssProperty
[src]
Auto Trait Implementations
impl RefUnwindSafe for DynamicCssProperty
impl Send for DynamicCssProperty
impl Sync for DynamicCssProperty
impl Unpin for DynamicCssProperty
impl UnwindSafe for DynamicCssProperty
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,