StyleBuilder
struct · ferroui-view · v0.5.0
struct StyleBuilder
A style being built: a selector, setters and nested styles. Turns into a
Style of the styles API of the port (build), or is
given to an element (styles: [..] in rsx!, .styles([..])).
style("Button.accent")
.set(Button::background_property(), "#0063B1")
.set(Button::foreground_property(), "White")
.nested(style("^:pointerover").set(Button::opacity_property(), 0.9))
Members
set
fn set<P: TypedProperty + ?Sized>(self: Self, property: &'static P, value: impl IntoValue<<P as >::Value>) -> Self
Sets property to value (what converts to its value: "Red" for a
brush, 8.0 for a thickness).
nested
fn nested(self: Self, style: StyleBuilder) -> Self
Adds a nested style, whose selector starts with ^ (the selector of
this one): style("^:pointerover").
build
fn build(self: Self) -> Ref<Style>
The style.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeIntoValue<T>IntoProp<T, Value>Borrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyClassDefaultsErasedDestructorIntoEither
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.