pub struct LayoutStyle { /* private fields */ }Implementations§
Source§impl LayoutStyle
impl LayoutStyle
pub fn new() -> Self
Sourcepub fn flex_row(self) -> Self
pub fn flex_row(self) -> Self
A flex row along the inline axis: items run left-to-right under Direction::Ltr and right-to-left
under Direction::Rtl, the way flex-direction: row follows dir on the web. Use
flex_row_reverse for a row that is reversed in both directions.
Sourcepub fn flex_row_reverse(self) -> Self
pub fn flex_row_reverse(self) -> Self
pub fn flex_column(self) -> Self
pub fn flex_wrap(self) -> Self
Sourcepub fn absolute_fill(self) -> Self
pub fn absolute_fill(self) -> Self
Takes the node out of normal flow (position: absolute) with all four insets pinned to 0, so it
fills its containing block without affecting sibling layout — used by overlay to cover the
viewport. Combine with flex_column/alignment to position the overlay’s content within the layer.
Sourcepub fn width_px(&self) -> Option<f32>
pub fn width_px(&self) -> Option<f32>
The node’s width in pixels if it is a definite length, else None (e.g. percent or auto).
Lets widgets with an intrinsic size (e.g. <svg>/<img>) inspect a caller-supplied width before registering their layout leaf.
Sourcepub fn is_width_auto(&self) -> bool
pub fn is_width_auto(&self) -> bool
True when width was left at its default, which taffy also treats as auto.
pub fn width(self, dim: impl Into<SizeDimension>) -> Self
Sourcepub fn height_px(&self) -> Option<f32>
pub fn height_px(&self) -> Option<f32>
The node’s height in pixels if it is a definite length, else None (e.g. percent or auto).
Sourcepub fn is_height_auto(&self) -> bool
pub fn is_height_auto(&self) -> bool
True when height was left at its default, which taffy also treats as auto.
pub fn height(self, dim: impl Into<SizeDimension>) -> Self
pub fn min_width(self, dim: impl Into<SizeDimension>) -> Self
pub fn min_height(self, dim: impl Into<SizeDimension>) -> Self
Sourcepub fn max_width_px(&self) -> Option<f32>
pub fn max_width_px(&self) -> Option<f32>
The node’s max-width in pixels if it is a definite length, else None
(e.g. percent or unset). Used by the layout pass to pin a resolved width.
pub fn max_width(self, dim: impl Into<SizeDimension>) -> Self
pub fn max_height(self, dim: impl Into<SizeDimension>) -> Self
pub fn flex_grow(self, grow: f32) -> Self
pub fn flex_shrink(self, shrink: f32) -> Self
pub fn flex_basis(self, dim: impl Into<SizeDimension>) -> Self
pub fn padding_all(self, px: f32) -> Self
pub fn padding_horizontal(self, px: f32) -> Self
pub fn padding_vertical(self, px: f32) -> Self
pub fn padding_top(self, px: f32) -> Self
pub fn padding_bottom(self, px: f32) -> Self
pub fn padding_left(self, px: f32) -> Self
pub fn padding_right(self, px: f32) -> Self
Sourcepub fn padding_start(self, px: f32) -> Self
pub fn padding_start(self, px: f32) -> Self
Padding on the edge the text starts from — left under Direction::Ltr, right under
Direction::Rtl.
Sourcepub fn padding_end(self, px: f32) -> Self
pub fn padding_end(self, px: f32) -> Self
Padding on the edge the text runs towards — right under Direction::Ltr, left under
Direction::Rtl.
pub fn margin_all(self, px: f32) -> Self
pub fn margin_horizontal(self, px: f32) -> Self
pub fn margin_vertical(self, px: f32) -> Self
pub fn margin_top(self, px: f32) -> Self
pub fn margin_bottom(self, px: f32) -> Self
pub fn margin_left(self, px: f32) -> Self
pub fn margin_right(self, px: f32) -> Self
Sourcepub fn margin_start(self, px: f32) -> Self
pub fn margin_start(self, px: f32) -> Self
Margin on the edge the text starts from — left under Direction::Ltr, right under
Direction::Rtl.
Sourcepub fn margin_end(self, px: f32) -> Self
pub fn margin_end(self, px: f32) -> Self
Margin on the edge the text runs towards — right under Direction::Ltr, left under
Direction::Rtl.
Sourcepub fn inset_start(self, px: f32) -> Self
pub fn inset_start(self, px: f32) -> Self
Inset from the edge the text starts from, for a node already taken out of flow (see
absolute_fill); ignored on an in-flow node, as inset is in CSS.
Sourcepub fn inset_end(self, px: f32) -> Self
pub fn inset_end(self, px: f32) -> Self
Inset from the edge the text runs towards, for a node already taken out of flow.
pub fn gap(self, px: f32) -> Self
pub fn gap_x(self, px: f32) -> Self
pub fn gap_y(self, px: f32) -> Self
pub fn align_items(self, value: AlignItems) -> Self
pub fn align_self_stretch(self) -> Self
Sourcepub fn align_self_center(self) -> Self
pub fn align_self_center(self) -> Self
Overrides the parent’s align_items for this child, centering it on the cross axis instead of
stretching — so a fixed-size child (e.g. a square icon chip) keeps its size and stays centered.
Sourcepub fn align_self_start(self) -> Self
pub fn align_self_start(self) -> Self
Aligns this child to the start of the cross axis, overriding the parent’s align_items.
Sourcepub fn align_self_end(self) -> Self
pub fn align_self_end(self) -> Self
Aligns this child to the end of the cross axis, overriding the parent’s align_items.
pub fn justify_content(self, value: JustifyContent) -> Self
pub fn display_grid(self) -> Self
pub fn grid_template_columns(self, tracks: Vec<TemplateTrack>) -> Self
pub fn grid_template_rows(self, tracks: Vec<TemplateTrack>) -> Self
pub fn grid_auto_flow_row(self) -> Self
pub fn grid_auto_flow_column(self) -> Self
pub fn grid_column(self, start: i16, end: i16) -> Self
pub fn grid_row(self, start: i16, end: i16) -> Self
pub fn grid_column_span(self, count: u16) -> Self
pub fn grid_row_span(self, count: u16) -> Self
pub fn aspect_ratio(self, ratio: f32) -> Self
Trait Implementations§
Source§impl Clone for LayoutStyle
impl Clone for LayoutStyle
Source§fn clone(&self) -> LayoutStyle
fn clone(&self) -> LayoutStyle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more