pub struct Style {
pub layout: Style,
pub view: ViewStyle,
pub text: TextStyle,
pub paint: PaintStyle,
pub animated: Vec<(AnimationProp, NodeId)>,
pub z_index: i32,
pub vertical_align: VerticalAlign,
pub direction: Option<bool>,
pub logical: Logical,
pub perspective: Option<Points>,
/* private fields */
}Expand description
A complete node style, split by consumer.
Fields§
§layout: StyleLayout properties, consumed by taffy.
view: ViewStyleVisual properties of the native view.
text: TextStyleText properties.
paint: PaintStyleSVG’s paint properties (inherited, as text properties are).
animated: Vec<(AnimationProp, NodeId)>Visual properties driven by native animation nodes; they override the static values while bound.
z_index: i32zIndex: stacking order among siblings (higher on top).
vertical_align: VerticalAlignverticalAlign: where the element sits in its line when it is
inside a <Text>.
direction: Option<bool>direction: right to left (Some(true)), left to right, or
inherited (None).
logical: LogicalStart / end properties, placed by the resolved direction.
perspective: Option<Points>CSS’s perspective (perspective-*, Styled::perspective): the
depth the view gives its children’s 3D transforms, seen from its
center; the core composes it into their transforms.
Implementations§
Source§impl Style
impl Style
Sourcepub fn object_fit(&self) -> Option<ResizeMode>
pub fn object_fit(&self) -> Option<ResizeMode>
objectFit (the object-* classes set it too): how an image or a
video fits its box; None leaves the element’s default.
Sourcepub fn set_transform(
&mut self,
property: TransformProperty,
steps: &[(TransformKind, f32, Option<NodeId>)],
) -> Result<(), StyleError>
pub fn set_transform( &mut self, property: TransformProperty, steps: &[(TransformKind, f32, Option<NodeId>)], ) -> Result<(), StyleError>
Sets transform property property to steps in its place in the
transform list, the other properties’ steps around it; a step with
an animated value is bound to it.
Sourcepub fn edit_effects(&mut self, f: impl FnOnce(&mut Effects))
pub fn edit_effects(&mut self, f: impl FnOnce(&mut Effects))
Changes the effects lists (copying them if shared).
Sourcepub fn set_box_shadows(&mut self, shadows: Vec<BoxShadow>)
pub fn set_box_shadows(&mut self, shadows: Vec<BoxShadow>)
Sets the box shadows (top layer first).
Sourcepub fn set_background_images(&mut self, images: Vec<Gradient>)
pub fn set_background_images(&mut self, images: Vec<Gradient>)
Sets the gradient backgrounds (top layer first).
Sourcepub fn set_filters(&mut self, filters: Vec<Filter>, backdrop: bool)
pub fn set_filters(&mut self, filters: Vec<Filter>, backdrop: bool)
Sets the filters.
Sourcepub fn set(
&mut self,
key: &str,
value: StyleValue<'_>,
) -> Result<(), StyleError>
pub fn set( &mut self, key: &str, value: StyleValue<'_>, ) -> Result<(), StyleError>
Sets one property using its React Native name.
Sourcepub fn set_key(
&mut self,
key: StyleKey,
value: StyleValue<'_>,
) -> Result<(), StyleError>
pub fn set_key( &mut self, key: StyleKey, value: StyleValue<'_>, ) -> Result<(), StyleError>
Sets one property.
Sourcepub fn apply_value(
&mut self,
key: StyleKey,
value: &PropertyValue,
) -> Result<(), StyleError>
pub fn apply_value( &mut self, key: StyleKey, value: &PropertyValue, ) -> Result<(), StyleError>
Sets property key to value, parsed before (StyleKey::parse_value)
or made typed (classes, Rust’s styles). A value of another property’s
kind is rejected.