1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
use strum_macros::EnumString;

/// Controls the direction in which items are layed out.
#[derive(Copy, Clone, Debug, Eq, PartialEq, EnumString)]
pub enum FlexDirection {
    /// Items are layed out vertically from top to bottom.
    #[strum(serialize = "column")]
    Column,

    /// Items are layed out vertically from bottom to top.
    #[strum(serialize = "column-reverse")]
    ColumnReverse,

    /// Items are layed out horizontally in the layout direction (either left to
    /// right or right to left).
    #[strum(serialize = "row")]
    Row,

    /// Items are layed out horizontally in the reverse layout direction (either
    /// right to left or left to right).
    #[strum(serialize = "row-reverse")]
    RowReverse,
}

/// Controls how items are aligned along the main axis of a flexbox.
#[derive(Copy, Clone, Debug, Eq, PartialEq, EnumString)]
pub enum Align {
    /// Items are aligned at the start of the cross axis.
    #[strum(serialize = "flex-start")]
    FlexStart,

    /// Items are aligned at the center along the main axis.
    #[strum(serialize = "center")]
    Center,

    /// Items are aligned at the end of the cross axis.
    #[strum(serialize = "flex-end")]
    FlexEnd,

    /// Items are stretched between the start and end of the cross axis.
    #[strum(serialize = "stretch")]
    Stretch,

    /// Items are spaced evenly between, the first item starts at the start of
    /// the cross axis and the last item ends at the end of the cross axis.
    #[strum(serialize = "space-between")]
    SpaceBetween,

    /// Items are spaced evenly around, the first item starts after the start of
    /// the cross axis and the last item ends before the end of the cross axis.
    #[strum(serialize = "space-around")]
    SpaceAround,
}

/// Controls how content is justified along the cross axis of a flexbox.
#[derive(Copy, Clone, Debug, Eq, PartialEq, EnumString)]
pub enum Justify {
    /// Content is justified at the start of the main axis.
    #[strum(serialize = "flex-start")]
    FlexStart,

    /// Content is justified at the center along the cross axis.
    #[strum(serialize = "center")]
    Center,

    /// Content is justified at the end of the main axis.
    #[strum(serialize = "flex-end")]
    FlexEnd,

    /// Content is spaced evenly between, the first content starts at the start
    /// of the main axis and the last content ends at the end of the main axis.
    #[strum(serialize = "space-between")]
    SpaceBetween,

    /// Items are spaced evenly around, the first content starts after the start
    /// of the main axis and the last content ends before the end of the main
    /// axis.
    #[strum(serialize = "space-around")]
    SpaceAround,

    /// Items are evenly spaced: the space between items is equal to the space
    /// between the first and last item and both ends of the main axis
    /// respectively.
    #[strum(serialize = "space-evenly")]
    SpaceEvenly,
}