Skip to main content

Module alignment

Module alignment 

Source
Expand description

Style types for controlling alignment.

The public alignment types (AlignItems, AlignContent, and their aliases) are structs with two orthogonal fields: a position keyword (AlignItemsKeyword / AlignContentKeyword) and an overflow-position modifier (AlignmentSafety). The pre-existing CSS spellings — Start, End, FlexStart, FlexEnd, Center, Stretch, SpaceBetween, …, SafeStart, SafeEnd, SafeFlexStart, SafeFlexEnd, SafeCenter — are exposed as associated constants on the structs, so call sites read identically to the previous enum form.

Structs§

AlignContent
Sets the distribution of space between and around content items. For Flexbox it controls alignment in the cross axis. For Grid it controls alignment in the block axis.
AlignItems
Used to control how child nodes are aligned. For Flexbox it controls alignment in the cross axis. For Grid it controls alignment in the block axis.

Enums§

AlignContentKeyword
The position-keyword half of AlignContent (and its alias JustifyContent).
AlignItemsKeyword
The position-keyword half of AlignItems (and its aliases AlignSelf, JustifyItems, JustifySelf).
AlignmentSafety
The overflow-position modifier per CSS Box Alignment §4.3.

Type Aliases§

AlignSelf
Controls alignment of an individual node.
JustifyContent
Sets the distribution of space between and around content items. For Flexbox it controls alignment in the main axis. For Grid it controls alignment in the inline axis.
JustifyItems
Used to control how child nodes are aligned. Does not apply to Flexbox, and will be ignored if specified on a flex container. For Grid it controls alignment in the inline axis.
JustifySelf
Controls alignment of an individual node.