/
Style.swift
119 lines (111 loc) · 3.38 KB
/
Style.swift
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/// CSS styles https://www.w3.org/TR/css-flexbox/
/// that interacts with https://github.com/facebook/yoga .
///
/// - Note: Some values are unimplemented / tweaked in facebook/yoga.
/// - SeeAlso: facebook/yoga/YGEnums.h
public enum Style
{
/// ## CSS spec
/// - Value: row | row-reverse | column | column-reverse
/// - Initial: row
/// - Applies to: flex containers
public enum FlexDirection: UInt32
{
case column = 0
case columnReverse = 1
case row = 2
case rowReverse = 3
}
/// ## CSS spec
/// - Value: nowrap | wrap | wrap-reverse
/// - Initial: nowrap
/// - Applies to: flex containers
public enum FlexWrap: UInt32
{
case nowrap = 0
case wrap = 1
//case wrapReverse // not in facebook/yoga
}
/// ## CSS spec
/// - Value: flex-start | flex-end | center | space-between | space-around
/// - Initial: flex-start
/// - Applies to: flex containers
public enum JustifyContent: UInt32
{
case flexStart = 0
case center = 1
case flexEnd = 2
case spaceBetween = 3
case spaceAround = 4
}
/// ## CSS spec
/// - Value: flex-start | flex-end | center | baseline | stretch
/// - Initial: stretch
/// - Applies to: flex containers
public enum AlignItems: UInt32
{
case auto = 0 // only in facebook/yoga
case flexStart = 1
case center = 2
case flexEnd = 3
case stretch = 4
// case baseline // not in facebook/yoga
}
/// ## CSS spec
/// - Value: flex-start | flex-end | center | space-between | space-around | stretch
/// - Initial: stretch
/// - Applies to: multi-line flex containers
public enum AlignContent: UInt32
{
case auto = 0 // only in facebook/yoga
case flexStart = 1
case center = 2
case flexEnd = 3
case stretch = 4 // only in facebook/yoga
}
/// ## CSS spec
/// - Value: auto | flex-start | flex-end | center | baseline | stretch
/// - Initial: auto
/// - Applies to: flex items
public enum AlignSelf: UInt32
{
case auto = 0
case flexStart = 1
case center = 2
case flexEnd = 3
case stretch = 4
// case baseline // not in facebook/yoga
}
/// ## CSS spec
/// https://www.w3.org/TR/css-position-3/
/// - Value: static | relative | absolute | sticky | fixed
/// - Initial: static
/// - Applies to: all elements except table-column-group and table-column
public enum PositionType: UInt32
{
case relative = 0
case absolute = 1
}
/// ## CSS spec
/// https://www.w3.org/TR/css-overflow-3/
/// - Value: visible | hidden | clip | scroll | auto
/// - Initial: see individual properties
/// - Applies to: block containers [CSS21], flex containers [CSS3-FLEXBOX], and grid containers [CSS3-GRID-LAYOUT]
public enum Overflow: UInt32
{
case visible = 0
case hidden = 1
case scroll = 2
}
/// ## CSS spec
/// https://www.w3.org/TR/css-writing-modes-3/
/// - Value: ltr | rtl
/// - Initial: ltr
/// - Applies to: all elements
public enum Direction: UInt32
{
case inherit = 0
case ltr = 1
case rtl = 2
}
}