#[non_exhaustive]pub enum JustifyContent {
Show 15 variants
Normal,
Start,
End,
FlexStart,
FlexEnd,
Center,
Stretch,
SpaceBetween,
SpaceEvenly,
SpaceAround,
SafeStart,
SafeEnd,
SafeFlexStart,
SafeFlexEnd,
SafeCenter,
}Expand description
Defines how flex items are aligned along the main axis.
This enum determines how space is distributed between and around flex items along the main axis of the flex container.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Normal
The items are distributed using the normal flow of the flex container.
Start
Items are packed toward the start of the line.
End
Items are packed toward the end of the line.
FlexStart
Items are packed toward the flex container’s main-start side. For flex containers with flex_direction RowReverse or ColumnReverse, this is equivalent to End. In all other cases it is equivalent to Start.
FlexEnd
Items are packed toward the flex container’s main-end side. For flex containers with flex_direction RowReverse or ColumnReverse, this is equivalent to Start. In all other cases it is equivalent to End.
Center
Items are packed toward the center of the line.
Stretch
Items are stretched to fill the container (only applies to flex containers)
SpaceBetween
Items are evenly distributed in the line; first item is on the start line, last item on the end line.
SpaceEvenly
Items are evenly distributed in the line with equal space around them.
SpaceAround
Items are evenly distributed in the line; first item is on the start line, last item on the end line, and the space between items is twice the space between the start/end items and the container edges.
SafeStart
safe start: like Start, falling back to start-edge alignment on overflow.
SafeEnd
safe end: like End, falling back to start-edge alignment on overflow.
SafeFlexStart
safe flex-start: like FlexStart, falling back to start-edge alignment on overflow.
SafeFlexEnd
safe flex-end: like FlexEnd, falling back to start-edge alignment on overflow.
SafeCenter
safe center: like Center, falling back to start-edge alignment on overflow.
Trait Implementations§
Source§impl Clone for JustifyContent
impl Clone for JustifyContent
Source§fn clone(&self) -> JustifyContent
fn clone(&self) -> JustifyContent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for JustifyContent
Source§impl Debug for JustifyContent
impl Debug for JustifyContent
Source§impl Default for JustifyContent
impl Default for JustifyContent
Source§fn default() -> JustifyContent
fn default() -> JustifyContent
Source§impl From<JustifyContent> for Option<JustifyContent>
impl From<JustifyContent> for Option<JustifyContent>
Source§fn from(value: JustifyContent) -> Self
fn from(value: JustifyContent) -> Self
Source§impl<'i> FromCss<'i> for JustifyContent
impl<'i> FromCss<'i> for JustifyContent
Source§const VALID_TOKENS: &'static [CssToken]
const VALID_TOKENS: &'static [CssToken]
Source§fn from_css(input: &mut Parser<'i, '_>) -> ParseResult<'i, Self>
fn from_css(input: &mut Parser<'i, '_>) -> ParseResult<'i, Self>
Parser instance.Source§fn from_str(source: &'i str) -> ParseResult<'i, Self>where
Self: Sized,
fn from_str(source: &'i str) -> ParseResult<'i, Self>where
Self: Sized,
Source§const EXPECT_MESSAGE: CssExpectedMessage = CssExpectedMessage::OneValue
const EXPECT_MESSAGE: CssExpectedMessage = CssExpectedMessage::OneValue
Source§impl PartialEq for JustifyContent
impl PartialEq for JustifyContent
Source§fn eq(&self, other: &JustifyContent) -> bool
fn eq(&self, other: &JustifyContent) -> bool
self and other values to be equal, and is used by ==.