Trait taffy::style::GridContainerStyle

source ·
pub trait GridContainerStyle: CoreStyle {
    type TemplateTrackList<'a>: Borrow<[TrackSizingFunction]>
       where Self: 'a;
    type AutoTrackList<'a>: Borrow<[NonRepeatedTrackSizingFunction]>
       where Self: 'a;

    // Required methods
    fn grid_template_rows(&self) -> Self::TemplateTrackList<'_>;
    fn grid_template_columns(&self) -> Self::TemplateTrackList<'_>;
    fn grid_auto_rows(&self) -> Self::AutoTrackList<'_>;
    fn grid_auto_columns(&self) -> Self::AutoTrackList<'_>;

    // Provided methods
    fn grid_auto_flow(&self) -> GridAutoFlow { ... }
    fn gap(&self) -> Size<LengthPercentage> { ... }
    fn align_content(&self) -> Option<AlignContent> { ... }
    fn justify_content(&self) -> Option<JustifyContent> { ... }
    fn align_items(&self) -> Option<AlignItems> { ... }
    fn justify_items(&self) -> Option<AlignItems> { ... }
    fn grid_template_tracks(
        &self,
        axis: AbsoluteAxis,
    ) -> Self::TemplateTrackList<'_> { ... }
    fn grid_align_content(&self, axis: AbstractAxis) -> AlignContent { ... }
}
Expand description

The set of styles required for a CSS Grid container

Required Associated Types§

source

type TemplateTrackList<'a>: Borrow<[TrackSizingFunction]> where Self: 'a

The type returned by grid_template_rows and grid_template_columns

source

type AutoTrackList<'a>: Borrow<[NonRepeatedTrackSizingFunction]> where Self: 'a

The type returned by grid_auto_rows and grid_auto_columns

Required Methods§

source

fn grid_template_rows(&self) -> Self::TemplateTrackList<'_>

Defines the track sizing functions (heights) of the grid rows

source

fn grid_template_columns(&self) -> Self::TemplateTrackList<'_>

Defines the track sizing functions (widths) of the grid columns

source

fn grid_auto_rows(&self) -> Self::AutoTrackList<'_>

Defines the size of implicitly created rows

source

fn grid_auto_columns(&self) -> Self::AutoTrackList<'_>

Defined the size of implicitly created columns

Provided Methods§

source

fn grid_auto_flow(&self) -> GridAutoFlow

Controls how items get placed into the grid for auto-placed items

source

fn gap(&self) -> Size<LengthPercentage>

How large should the gaps between items in a grid or flex container be?

source

fn align_content(&self) -> Option<AlignContent>

How should content contained within this item be aligned in the cross/block axis

source

fn justify_content(&self) -> Option<JustifyContent>

How should contained within this item be aligned in the main/inline axis

source

fn align_items(&self) -> Option<AlignItems>

How this node’s children aligned in the cross/block axis?

source

fn justify_items(&self) -> Option<AlignItems>

How this node’s children should be aligned in the inline axis

source

fn grid_template_tracks( &self, axis: AbsoluteAxis, ) -> Self::TemplateTrackList<'_>

Get a grid item’s row or column placement depending on the axis passed

source

fn grid_align_content(&self, axis: AbstractAxis) -> AlignContent

Get a grid container’s align-content or justify-content alignment depending on the axis passed

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T: GridContainerStyle> GridContainerStyle for &T

Implementors§