taffy::style

Trait 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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: GridContainerStyle> GridContainerStyle for &T

Implementors§