Show More
@@ -1,149 +1,200 b'' | |||
|
1 | 1 | |
|
2 | 2 | /* Flexible box model classes */ |
|
3 | 3 | /* Taken from Alex Russell http://infrequently.org/2009/08/css-3-progress/ */ |
|
4 | 4 | |
|
5 | /* This file is a compatability layer. It allows the usage of flexible box | |
|
6 | model layouts accross multiple browsers, including older browsers. The newest, | |
|
7 | universal implementation of the flexible box model is used when available (see | |
|
8 | `Modern browsers` comments below). Browsers that are known to implement this | |
|
9 | new spec completely include: | |
|
10 | ||
|
11 | Firefox 28.0+ | |
|
12 | Chrome 29.0+ | |
|
13 | Internet Explorer 11+ | |
|
14 | Opera 17.0+ | |
|
15 | ||
|
16 | Browsers not listed, including Safari, are supported via the styling under the | |
|
17 | `Old browsers` comments below. | |
|
18 | */ | |
|
19 | ||
|
20 | ||
|
5 | 21 | .hbox { |
|
22 | /* Old browsers */ | |
|
6 | 23 | display: -webkit-box; |
|
7 | 24 | -webkit-box-orient: horizontal; |
|
8 | 25 | -webkit-box-align: stretch; |
|
9 | 26 | |
|
10 | 27 | display: -moz-box; |
|
11 | 28 | -moz-box-orient: horizontal; |
|
12 | 29 | -moz-box-align: stretch; |
|
13 | 30 | |
|
14 | 31 | display: box; |
|
15 | 32 | box-orient: horizontal; |
|
16 | 33 | box-align: stretch; |
|
17 | 34 | |
|
35 | /* Modern browsers */ | |
|
18 | 36 | display: flex; |
|
19 | 37 | flex-direction: row; |
|
20 | 38 | align-items: stretch; |
|
21 | 39 | } |
|
22 | 40 | |
|
23 | 41 | .hbox > * { |
|
42 | /* Old browsers */ | |
|
24 | 43 | -webkit-box-flex: 0; |
|
25 | 44 | -moz-box-flex: 0; |
|
26 | 45 | box-flex: 0; |
|
27 | flex: auto; | |
|
46 | ||
|
47 | /* Modern browsers */ | |
|
48 | flex: none; | |
|
28 | 49 | } |
|
29 | 50 | |
|
30 | 51 | .vbox { |
|
52 | /* Old browsers */ | |
|
31 | 53 | display: -webkit-box; |
|
32 | 54 | -webkit-box-orient: vertical; |
|
33 | 55 | -webkit-box-align: stretch; |
|
34 | 56 | |
|
35 | 57 | display: -moz-box; |
|
36 | 58 | -moz-box-orient: vertical; |
|
37 | 59 | -moz-box-align: stretch; |
|
38 | 60 | |
|
39 | 61 | display: box; |
|
40 | 62 | box-orient: vertical; |
|
41 | 63 | box-align: stretch; |
|
42 | 64 | /* width must be 100% to force FF to behave like webkit */ |
|
43 | 65 | width: 100%; |
|
44 | 66 | |
|
67 | /* Modern browsers */ | |
|
45 | 68 | display: flex; |
|
46 | 69 | flex-direction: column; |
|
47 | 70 | align-items: stretch; |
|
48 | 71 | } |
|
49 | 72 | |
|
50 | 73 | .vbox > * { |
|
74 | /* Old browsers */ | |
|
51 | 75 | -webkit-box-flex: 0; |
|
52 | 76 | -moz-box-flex: 0; |
|
53 | 77 | box-flex: 0; |
|
54 | flex: auto; | |
|
78 | ||
|
79 | /* Modern browsers */ | |
|
80 | flex: none; | |
|
55 | 81 | } |
|
56 | 82 | |
|
57 | 83 | .reverse { |
|
84 | /* Old browsers */ | |
|
58 | 85 | -webkit-box-direction: reverse; |
|
59 | 86 | -moz-box-direction: reverse; |
|
60 | 87 | box-direction: reverse; |
|
61 | flex-direction: column-reverse; | |
|
88 | ||
|
89 | /* Modern browsers */ | |
|
90 | flex-direction: row-reverse; | |
|
62 | 91 | } |
|
63 | 92 | |
|
64 | 93 | .box-flex0 { |
|
94 | /* Old browsers */ | |
|
65 | 95 | -webkit-box-flex: 0; |
|
66 | 96 | -moz-box-flex: 0; |
|
67 | 97 | box-flex: 0; |
|
68 | flex: auto; | |
|
98 | ||
|
99 | /* Modern browsers */ | |
|
100 | flex: none; | |
|
69 | 101 | } |
|
70 | 102 | |
|
71 | 103 | .box-flex1 { |
|
104 | /* Old browsers */ | |
|
72 | 105 | -webkit-box-flex: 1; |
|
73 | 106 | -moz-box-flex: 1; |
|
74 | 107 | box-flex: 1; |
|
108 | ||
|
109 | /* Modern browsers */ | |
|
75 | 110 | flex: 1; |
|
76 | 111 | } |
|
77 | 112 | |
|
78 | 113 | .box-flex { |
|
114 | /* Old browsers */ | |
|
79 | 115 | .box-flex1(); |
|
80 | 116 | } |
|
81 | 117 | |
|
82 | 118 | .box-flex2 { |
|
119 | /* Old browsers */ | |
|
83 | 120 | -webkit-box-flex: 2; |
|
84 | 121 | -moz-box-flex: 2; |
|
85 | 122 | box-flex: 2; |
|
123 | ||
|
124 | /* Modern browsers */ | |
|
86 | 125 | flex: 2; |
|
87 | 126 | } |
|
88 | 127 | |
|
89 | 128 | .box-group1 { |
|
90 | /* | |
|
91 | Deprecated | |
|
92 | Grouping isn't supported in http://dev.w3.org/csswg/css-flexbox/ | |
|
93 | */ | |
|
129 | /* Deprecated */ | |
|
94 | 130 | -webkit-box-flex-group: 1; |
|
95 | 131 | -moz-box-flex-group: 1; |
|
96 | 132 | box-flex-group: 1; |
|
97 | 133 | } |
|
98 | 134 | |
|
99 | 135 | .box-group2 { |
|
100 | /* | |
|
101 | Deprecated | |
|
102 | Grouping isn't supported in http://dev.w3.org/csswg/css-flexbox/ | |
|
103 | */ | |
|
136 | /* Deprecated */ | |
|
104 | 137 | -webkit-box-flex-group: 2; |
|
105 | 138 | -moz-box-flex-group: 2; |
|
106 | 139 | box-flex-group: 2; |
|
107 | 140 | } |
|
108 | 141 | |
|
109 | 142 | .start { |
|
143 | /* Old browsers */ | |
|
110 | 144 | -webkit-box-pack: start; |
|
111 | 145 | -moz-box-pack: start; |
|
112 | 146 | box-pack: start; |
|
147 | ||
|
148 | /* Modern browsers */ | |
|
113 | 149 | justify-content: flex-start; |
|
114 | 150 | } |
|
115 | 151 | |
|
116 | 152 | .end { |
|
153 | /* Old browsers */ | |
|
117 | 154 | -webkit-box-pack: end; |
|
118 | 155 | -moz-box-pack: end; |
|
119 | 156 | box-pack: end; |
|
157 | ||
|
158 | /* Modern browsers */ | |
|
120 | 159 | justify-content: flex-end; |
|
121 | 160 | } |
|
122 | 161 | |
|
123 | 162 | .center { |
|
163 | /* Old browsers */ | |
|
124 | 164 | -webkit-box-pack: center; |
|
125 | 165 | -moz-box-pack: center; |
|
126 | 166 | box-pack: center; |
|
167 | ||
|
168 | /* Modern browsers */ | |
|
127 | 169 | justify-content: center; |
|
128 | 170 | } |
|
129 | 171 | |
|
130 | 172 | .align-start { |
|
173 | /* Old browsers */ | |
|
131 | 174 | -webkit-box-align: start; |
|
132 | 175 | -moz-box-align: start; |
|
133 | 176 | box-align: start; |
|
134 | align-content: flex-start; | |
|
177 | ||
|
178 | /* Modern browsers */ | |
|
179 | align-items: flex-start; | |
|
135 | 180 | } |
|
136 | 181 | |
|
137 | 182 | .align-end { |
|
183 | /* Old browsers */ | |
|
138 | 184 | -webkit-box-align: end; |
|
139 | 185 | -moz-box-align: end; |
|
140 | 186 | box-align: end; |
|
141 | align-content: flex-end; | |
|
187 | ||
|
188 | /* Modern browsers */ | |
|
189 | align-items: flex-end; | |
|
142 | 190 | } |
|
143 | 191 | |
|
144 | 192 | .align-center { |
|
193 | /* Old browsers */ | |
|
145 | 194 | -webkit-box-align: center; |
|
146 | 195 | -moz-box-align: center; |
|
147 | 196 | box-align: center; |
|
148 | align-content: center; | |
|
197 | ||
|
198 | /* Modern browsers */ | |
|
199 | align-items: center; | |
|
149 | 200 | } |
General Comments 0
You need to be logged in to leave comments.
Login now