This repository has been archived by the owner on Jul 21, 2023. It is now read-only.
forked from rlamana/prefix.less
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflex.prefix.less
149 lines (120 loc) · 2.92 KB
/
flex.prefix.less
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
// Flex.prefix.less (part of Prefix.less)
// Copyright (c) 2012 Ramón Lamana
//
// MIT Licensed:
// http://www.opensource.org/licenses/mit-license.php
// Support for the new 2012 CSS Flexible Box Layout Module in all
// browsers supporting at least the 2009 specs draft too.
// W3C Candidate Recommendation, 18 September 2012
// http://www.w3.org/TR/css3-flexbox/#flex-wrap
// 'display' property new values
.display(@value) {
display: @value;
}
.display(@value) when (@value = flex) {
// Old 2009 specs
display: -webkit-box;
display: -moz-box;
display: -ms-box;
display: -o-box;
// New specs
display: -webkit-flex;
display: -moz-flex;
display: -ms-flex;
display: -o-flex;
display: flex;
}
// 'flex-flow' property
.flex-flow(@value) {
-webkit-flex-flow: @value;
-moz-flex-flow: @value;
-ms-flex-flow: @value;
-o-flex-flow: @value;
flex-flow: @value;
}
.flex-flow(@value) when (@value = column) {
// Old 2009 specs
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
-ms-box-orient: vertical;
-o-box-orient: vertical;
}
.flex-flow(@value) when (@value = row) {
// Old 2009 specs
-webkit-box-orient: horizontal;
-moz-box-orient: horizontal;
-ms-box-orient: horizontal;
-o-box-orient: horizontal;
}
// 'flex-direction' property
.flex-direction(@value) {
-webkit-flex-direction: @value;
-moz-flex-direction: @value;
-ms-flex-direction: @value;
-o-flex-direction: @value;
flex-direction: @value;
}
.flex-direction(@value) when (@value = column) {
// Old 2009 specs
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
-ms-box-orient: vertical;
-o-box-orient: vertical;
}
.flex-direction(@value) when (@value = row) {
// Old 2009 specs
-webkit-box-orient: horizontal;
-moz-box-orient: horizontal;
-ms-box-orient: horizontal;
-o-box-orient: horizontal;
}
// 'flex-wrap' property
.flex-wrap(@value) {
-webkit-flex-wrap: @value;
-moz-flex-wrap: @value;
-ms-flex-wrap: @value;
-o-flex-wrap: @value;
flex-wrap: @value;
}
// 'flex' property
.flex(@values) {
-webkit-flex: @values;
-moz-flex: @values;
-ms-flex: @values;
-o-flex: @values;
flex: @values;
}
.flex(@value) when (@value = 1) {
-webkit-box-flex: @value;
-moz-box-flex: @value;
-ms-box-flex: @value;
-o-box-flex: @value;
}
.flex(@value) when (@value = 0) {
-webkit-box-flex: @value;
-moz-box-flex: @value;
-ms-box-flex: @value;
-o-box-flex: @value;
}
// 'align-items' property
.align-items(@values) {
// Old 2009 specs
-webkit-box-align: @values;
-moz-box-align: @values;
-ms-box-align: @values;
-o-box-align: @values;
// New 2012 specs
-webkit-align-items: @values;
-moz-align-items: @values;
-ms-align-items: @values;
-o-align-items: @values;
align-items: @values;
}
// 'align-self' property
.align-self(@values) {
-webkit-align-self: @values;
-moz-align-self: @values;
-ms-align-self: @values;
-o-align-self: @values;
align-self: @values;
}