##// END OF EJS Templates
Corrected a lot of small misuses of the new flex model.
Jonathan Frederic -
Show More
@@ -2,7 +2,24 b''
2 /* Flexible box model classes */
2 /* Flexible box model classes */
3 /* Taken from Alex Russell http://infrequently.org/2009/08/css-3-progress/ */
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 .hbox {
21 .hbox {
22 /* Old browsers */
6 display: -webkit-box;
23 display: -webkit-box;
7 -webkit-box-orient: horizontal;
24 -webkit-box-orient: horizontal;
8 -webkit-box-align: stretch;
25 -webkit-box-align: stretch;
@@ -15,19 +32,24 b''
15 box-orient: horizontal;
32 box-orient: horizontal;
16 box-align: stretch;
33 box-align: stretch;
17
34
35 /* Modern browsers */
18 display: flex;
36 display: flex;
19 flex-direction: row;
37 flex-direction: row;
20 align-items: stretch;
38 align-items: stretch;
21 }
39 }
22
40
23 .hbox > * {
41 .hbox > * {
42 /* Old browsers */
24 -webkit-box-flex: 0;
43 -webkit-box-flex: 0;
25 -moz-box-flex: 0;
44 -moz-box-flex: 0;
26 box-flex: 0;
45 box-flex: 0;
27 flex: auto;
46
47 /* Modern browsers */
48 flex: none;
28 }
49 }
29
50
30 .vbox {
51 .vbox {
52 /* Old browsers */
31 display: -webkit-box;
53 display: -webkit-box;
32 -webkit-box-orient: vertical;
54 -webkit-box-orient: vertical;
33 -webkit-box-align: stretch;
55 -webkit-box-align: stretch;
@@ -42,108 +64,137 b''
42 /* width must be 100% to force FF to behave like webkit */
64 /* width must be 100% to force FF to behave like webkit */
43 width: 100%;
65 width: 100%;
44
66
67 /* Modern browsers */
45 display: flex;
68 display: flex;
46 flex-direction: column;
69 flex-direction: column;
47 align-items: stretch;
70 align-items: stretch;
48 }
71 }
49
72
50 .vbox > * {
73 .vbox > * {
74 /* Old browsers */
51 -webkit-box-flex: 0;
75 -webkit-box-flex: 0;
52 -moz-box-flex: 0;
76 -moz-box-flex: 0;
53 box-flex: 0;
77 box-flex: 0;
54 flex: auto;
78
79 /* Modern browsers */
80 flex: none;
55 }
81 }
56
82
57 .reverse {
83 .reverse {
84 /* Old browsers */
58 -webkit-box-direction: reverse;
85 -webkit-box-direction: reverse;
59 -moz-box-direction: reverse;
86 -moz-box-direction: reverse;
60 box-direction: reverse;
87 box-direction: reverse;
61 flex-direction: column-reverse;
88
89 /* Modern browsers */
90 flex-direction: row-reverse;
62 }
91 }
63
92
64 .box-flex0 {
93 .box-flex0 {
94 /* Old browsers */
65 -webkit-box-flex: 0;
95 -webkit-box-flex: 0;
66 -moz-box-flex: 0;
96 -moz-box-flex: 0;
67 box-flex: 0;
97 box-flex: 0;
68 flex: auto;
98
99 /* Modern browsers */
100 flex: none;
69 }
101 }
70
102
71 .box-flex1 {
103 .box-flex1 {
104 /* Old browsers */
72 -webkit-box-flex: 1;
105 -webkit-box-flex: 1;
73 -moz-box-flex: 1;
106 -moz-box-flex: 1;
74 box-flex: 1;
107 box-flex: 1;
108
109 /* Modern browsers */
75 flex: 1;
110 flex: 1;
76 }
111 }
77
112
78 .box-flex {
113 .box-flex {
114 /* Old browsers */
79 .box-flex1();
115 .box-flex1();
80 }
116 }
81
117
82 .box-flex2 {
118 .box-flex2 {
119 /* Old browsers */
83 -webkit-box-flex: 2;
120 -webkit-box-flex: 2;
84 -moz-box-flex: 2;
121 -moz-box-flex: 2;
85 box-flex: 2;
122 box-flex: 2;
123
124 /* Modern browsers */
86 flex: 2;
125 flex: 2;
87 }
126 }
88
127
89 .box-group1 {
128 .box-group1 {
90 /*
129 /* Deprecated */
91 Deprecated
92 Grouping isn't supported in http://dev.w3.org/csswg/css-flexbox/
93 */
94 -webkit-box-flex-group: 1;
130 -webkit-box-flex-group: 1;
95 -moz-box-flex-group: 1;
131 -moz-box-flex-group: 1;
96 box-flex-group: 1;
132 box-flex-group: 1;
97 }
133 }
98
134
99 .box-group2 {
135 .box-group2 {
100 /*
136 /* Deprecated */
101 Deprecated
102 Grouping isn't supported in http://dev.w3.org/csswg/css-flexbox/
103 */
104 -webkit-box-flex-group: 2;
137 -webkit-box-flex-group: 2;
105 -moz-box-flex-group: 2;
138 -moz-box-flex-group: 2;
106 box-flex-group: 2;
139 box-flex-group: 2;
107 }
140 }
108
141
109 .start {
142 .start {
143 /* Old browsers */
110 -webkit-box-pack: start;
144 -webkit-box-pack: start;
111 -moz-box-pack: start;
145 -moz-box-pack: start;
112 box-pack: start;
146 box-pack: start;
147
148 /* Modern browsers */
113 justify-content: flex-start;
149 justify-content: flex-start;
114 }
150 }
115
151
116 .end {
152 .end {
153 /* Old browsers */
117 -webkit-box-pack: end;
154 -webkit-box-pack: end;
118 -moz-box-pack: end;
155 -moz-box-pack: end;
119 box-pack: end;
156 box-pack: end;
157
158 /* Modern browsers */
120 justify-content: flex-end;
159 justify-content: flex-end;
121 }
160 }
122
161
123 .center {
162 .center {
163 /* Old browsers */
124 -webkit-box-pack: center;
164 -webkit-box-pack: center;
125 -moz-box-pack: center;
165 -moz-box-pack: center;
126 box-pack: center;
166 box-pack: center;
167
168 /* Modern browsers */
127 justify-content: center;
169 justify-content: center;
128 }
170 }
129
171
130 .align-start {
172 .align-start {
173 /* Old browsers */
131 -webkit-box-align: start;
174 -webkit-box-align: start;
132 -moz-box-align: start;
175 -moz-box-align: start;
133 box-align: start;
176 box-align: start;
134 align-content: flex-start;
177
178 /* Modern browsers */
179 align-items: flex-start;
135 }
180 }
136
181
137 .align-end {
182 .align-end {
183 /* Old browsers */
138 -webkit-box-align: end;
184 -webkit-box-align: end;
139 -moz-box-align: end;
185 -moz-box-align: end;
140 box-align: end;
186 box-align: end;
141 align-content: flex-end;
187
188 /* Modern browsers */
189 align-items: flex-end;
142 }
190 }
143
191
144 .align-center {
192 .align-center {
193 /* Old browsers */
145 -webkit-box-align: center;
194 -webkit-box-align: center;
146 -moz-box-align: center;
195 -moz-box-align: center;
147 box-align: center;
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