pub struct AlignItems {
pub keyword: AlignItemsKeyword,
pub safety: AlignmentSafety,
}Expand description
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.
Fields§
§keyword: AlignItemsKeywordPosition keyword.
safety: AlignmentSafetyOverflow-position modifier (safe / unsafe).
Implementations§
Source§impl AlignItems
impl AlignItems
Sourcepub const FLEX_START: Self
pub const FLEX_START: Self
Items are packed towards the flex-relative start of the axis.
Sourcepub const SELF_START: Self
pub const SELF_START: Self
Items are packed toward the start of the axis as determined by the item’s own direction.
Sourcepub const SELF_END: Self
pub const SELF_END: Self
Items are packed toward the end of the axis as determined by the item’s own direction.
Sourcepub const SAFE_START: Self
pub const SAFE_START: Self
Like AlignItems::START, but falls back to AlignItems::START when the
alignment subject overflows the alignment container, to avoid data loss.
Sourcepub const SAFE_END: Self
pub const SAFE_END: Self
Like AlignItems::END, but falls back to AlignItems::START when the
alignment subject overflows the alignment container, to avoid data loss.
Sourcepub const SAFE_FLEX_START: Self
pub const SAFE_FLEX_START: Self
Like AlignItems::FLEX_START, but falls back to AlignItems::START when the
alignment subject overflows the alignment container, to avoid data loss.
Sourcepub const SAFE_FLEX_END: Self
pub const SAFE_FLEX_END: Self
Like AlignItems::FLEX_END, but falls back to AlignItems::START when the
alignment subject overflows the alignment container, to avoid data loss.
Sourcepub const SAFE_CENTER: Self
pub const SAFE_CENTER: Self
Like AlignItems::CENTER, but falls back to AlignItems::START when the
alignment subject overflows the alignment container, to avoid data loss.
Sourcepub const SAFE_SELF_START: Self
pub const SAFE_SELF_START: Self
Like AlignItems::SELF_START, but falls back to AlignItems::START when the
alignment subject overflows the alignment container, to avoid data loss.
Sourcepub const SAFE_SELF_END: Self
pub const SAFE_SELF_END: Self
Like AlignItems::SELF_END, but falls back to AlignItems::START when the
alignment subject overflows the alignment container, to avoid data loss.
Sourcepub const fn is_safe(self) -> bool
pub const fn is_safe(self) -> bool
Returns true iff this carries the safe overflow-position modifier.
Sourcepub const fn keyword(self) -> AlignItemsKeyword
pub const fn keyword(self) -> AlignItemsKeyword
Returns the underlying position keyword, discarding the safety modifier.
Sourcepub(crate) fn resolve_self_relative(
self,
item_direction: Direction,
container_direction: Direction,
axis_is_inline: bool,
) -> Self
pub(crate) fn resolve_self_relative( self, item_direction: Direction, container_direction: Direction, axis_is_inline: bool, ) -> Self
Resolve the writing-mode-relative SelfStart/SelfEnd keywords to Start/End
based on the item’s own direction per CSS Box Alignment §5.2
https://www.w3.org/TR/css-align-3/#self-alignment. All other keywords are
returned unchanged.
The Start/End keywords used by the compute paths are relative to the
container’s writing mode/direction, so in the inline axis SelfStart resolves
to Start when the item’s direction matches the container’s and to End when it
differs. Taffy only supports the horizontal-tb writing mode, so in the block
axis SelfStart/SelfEnd always resolve to Start/End respectively.
Trait Implementations§
Source§impl Clone for AlignItems
impl Clone for AlignItems
Source§fn clone(&self) -> AlignItems
fn clone(&self) -> AlignItems
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AlignItems
impl Debug for AlignItems
Source§impl PartialEq for AlignItems
impl PartialEq for AlignItems
Source§fn eq(&self, other: &AlignItems) -> bool
fn eq(&self, other: &AlignItems) -> bool
self and other values to be equal, and is used by ==.