This repository has been archived by the owner on Sep 18, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
346 lines (329 loc) · 19.9 KB
/
index.html
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>flexbox-css</title>
<meta name="description" content="Flexbox Utility CSS Stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.1.1/normalize.min.css">
<link rel="stylesheet" href="dist/flexbox-css-min.css"/>
<link rel="stylesheet" href="demo.css"/>
</head>
<body class="bg-blue-dark white overflow-x-hidden">
<!-- fork me on github banner -->
<a href="https://github.com/moodysalem/flexbox-css"><img style="position: fixed; top: 0; right: 0; border: 0;"
src="https://camo.githubusercontent.com/52760788cde945287fbb584134c4cbc2bc36f904/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f77686974655f6666666666662e706e67"
alt="Fork me on GitHub"
data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png"></a>
<!-- content -->
<div class="container">
<h1>flexbox-css</h1>
<p>
flexbox-css is a utility stylesheet with responsive CSS classes representing all the configurations
of flexbox, so you don't have to worry about vendor prefixing and you don't have to mix in flexbox with
your own styles. You just apply the utility classes you need to get the proper layout for different
screen
sizes.
</p>
<h2>Install</h2>
<code class="bg-purple-light padding-sm">npm i --save-dev flexbox-css</code>
<h2>Development</h2>
<p>
The build process for this project is
<code class="bg-purple-light">sass</code>
to
<code class="bg-purple-light">autoprefixer</code>
to
<code class="bg-purple-light">cleancss</code>.
Run <code class="bg-purple-light">npm run build</code> to make your own build.
When doing development, use <code class="bg-purple-light">npm run dev</code> to watch the source files
for
changes and
automatically rebuild.
</p>
<h2>Usage</h2>
<p>If you are using webpack to include CSS with a style loader, then it's as simple as</p>
<code class="bg-purple-light padding-sm">import 'flexbox-css';</code>
<p>Otherwise, you can download flexbox-css.css and use it like any other stylesheet</p>
<h2>Documentation & Examples</h2>
<h3>Interactive Demo</h3>
<p>Go <a class="green-light" href="interactive.html">here</a> for a React demo</p>
<h3>Parent Classes</h3>
<h4>Direction</h4>
<p>Row and Column directions are supported in parallel. The parent must explicitly describe its
orientation</p>
<div class="bg-blue-light">
<div class="display-flex flex-direction-row">
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row > </div>
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row > </div>
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row > </div>
</div>
<hr/>
<div class="display-flex flex-direction-column">
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-column > </div>
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-column > </div>
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-column > </div>
</div>
</div>
<h4>Direction</h4>
<p>The supported flex directions are flex-direction-(row/row-reverse/column/column-reverse)</p>
<div class="bg-blue-light">
<div class="display-flex flex-direction-row-reverse">
<div class="center bg-green-light margin-sm">.flex-direction-row-reverse > 1</div>
<div class="center bg-green-light margin-sm">.flex-direction-row-reverse > 2</div>
<div class="center bg-green-light margin-sm">.flex-direction-row-reverse > 3</div>
</div>
<hr/>
<div class="display-flex flex-direction-column-reverse">
<div class="center bg-green-light margin-sm">.flex-direction-column-reverse > 1</div>
<div class="center bg-green-light margin-sm">.flex-direction-column-reverse > 2</div>
<div class="center bg-green-light margin-sm">.flex-direction-column-reverse > 3</div>
</div>
</div>
<h4>Wrapping</h4>
<p>The classes flex-wrap-(nowrap/wrap/wrap-reverse) control wrapping</p>
<div class="bg-blue-light">
<div class="display-flex flex-direction-row flex-wrap-wrap">
<div class="center bg-green-light margin-sm">
display-flex.flex-direction-column.flex-wrap-wrap-reverse > 1
</div>
<div class="center bg-green-light margin-sm">
display-flex.flex-direction-column.flex-wrap-wrap-reverse > 2
</div>
<div class="center bg-green-light margin-sm">
display-flex.flex-direction-column.flex-wrap-wrap-reverse > 3
</div>
<div class="center bg-green-light margin-sm">
display-flex.flex-direction-column.flex-wrap-wrap-reverse > 4
</div>
<div class="center bg-green-light margin-sm">
display-flex.flex-direction-column.flex-wrap-wrap-reverse > 5
</div>
<div class="center bg-green-light margin-sm">
display-flex.flex-direction-column.flex-wrap-wrap-reverse > 6
</div>
</div>
<hr/>
<div class="display-flex flex-direction-column flex-wrap-wrap-reverse" style="height: 140px">
<div class="center bg-green-light margin-sm">
display-flex.flex-direction-column.flex-wrap-wrap-reverse > 1
</div>
<div class="center bg-green-light margin-sm">
display-flex.flex-direction-column.flex-wrap-wrap-reverse > 2
</div>
<div class="center bg-green-light margin-sm">
display-flex.flex-direction-column.flex-wrap-wrap-reverse > 3
</div>
<div class="center bg-green-light margin-sm">
display-flex.flex-direction-column.flex-wrap-wrap-reverse > 4
</div>
<div class="center bg-green-light margin-sm">
display-flex.flex-direction-column.flex-wrap-wrap-reverse > 5
</div>
<div class="center bg-green-light margin-sm">
display-flex.flex-direction-column.flex-wrap-wrap-reverse > 6
</div>
</div>
</div>
<h4>Justification</h4>
<p>Add .justify-content-(start/end/center/space-between/space-around) to your .display-flex to modify
justification behavior.</p>
<div class="bg-blue-light">
<div class="display-flex flex-direction-row justify-content-start">
<div class="none center bg-green-light margin-sm">.display-flex.flex-direction-row.justify-content-start > 1
</div>
<div class="none center bg-green-light margin-sm">.display-flex.flex-direction-row.justify-content-start > 2
</div>
<div class="none center bg-green-light margin-sm">.display-flex.flex-direction-row.justify-content-start > 3
</div>
</div>
<hr/>
<div class="display-flex flex-direction-row justify-content-center">
<div class="none center bg-green-light margin-sm">.display-flex.flex-direction-row.justify-content-center > 1
</div>
<div class="none center bg-green-light margin-sm">.display-flex.flex-direction-row.justify-content-center > 2
</div>
<div class="none center bg-green-light margin-sm">.display-flex.flex-direction-row.justify-content-center > 3
</div>
</div>
<hr/>
<div class="display-flex flex-direction-row justify-content-end">
<div class="none center bg-green-light margin-sm">.display-flex.flex-direction-row.justify-content-end > 1</div>
<div class="none center bg-green-light margin-sm">.display-flex.flex-direction-row.justify-content-end > 2</div>
<div class="none center bg-green-light margin-sm">.display-flex.flex-direction-row.justify-content-end > 3</div>
</div>
<hr/>
<div class="display-flex flex-direction-row justify-content-space-between">
<div class="none center bg-green-light margin-sm">.display-flex.flex-direction-row.justify-content-space-between >
1
</div>
<div class="none center bg-green-light margin-sm">.display-flex.flex-direction-row.justify-content-space-between >
2
</div>
<div class="none center bg-green-light margin-sm">.display-flex.flex-direction-row.justify-content-space-between >
3
</div>
</div>
<hr/>
<div class="display-flex flex-direction-row justify-content-space-around">
<div class="none center bg-green-light margin-sm">.display-flex.flex-direction-row.justify-content-space-around >
1
</div>
<div class="none center bg-green-light margin-sm">.display-flex.flex-direction-row.justify-content-space-around >
2
</div>
<div class="none center bg-green-light margin-sm">.display-flex.flex-direction-row.justify-content-space-around >
3
</div>
</div>
</div>
<h4>Alignment</h4>
<p>Add .align-items-(flex-start/flex-end/baseline/center/stretch) to your .display-flex to modify
alignment.</p>
<div class="bg-blue-light">
<div class="display-flex flex-direction-row align-items-flex-start height-100">
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-items-start > 1</div>
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-items-start > 2</div>
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-items-start > 3</div>
</div>
<hr/>
<div class="display-flex flex-direction-row align-items-flex-end height-100">
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-items-end > 1</div>
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-items-end > 2</div>
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-items-end > 3</div>
</div>
<hr/>
<div class="display-flex flex-direction-row align-items-baseline height-100">
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-items-baseline > 1</div>
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-items-baseline > 2</div>
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-items-baseline > 3</div>
</div>
<hr/>
<div class="display-flex flex-direction-row align-items-center height-100">
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-items-center > 1</div>
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-items-center > 2</div>
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-items-center > 3</div>
</div>
<hr/>
<div class="display-flex flex-direction-row align-items-stretch height-100">
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-items-stretch > 1</div>
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-items-stretch > 2</div>
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-items-stretch > 3</div>
</div>
</div>
<h4>Content Alignment</h4>
<p>Add .align-content-(flex-start/flex-end/baseline/center/stretch) to your .display-flex to modify content
alignment.</p>
<div class="bg-blue-light">
<div class="display-flex flex-direction-row align-content-flex-start height-100">
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-content-start > 1</div>
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-content-start > 2</div>
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-content-start > 3</div>
</div>
<hr/>
<div class="display-flex flex-direction-row align-content-flex-end height-100">
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-content-end > 1</div>
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-content-end > 2</div>
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-content-end > 3</div>
</div>
<hr/>
<div class="display-flex flex-direction-row align-content-baseline height-100">
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-content-baseline > 1</div>
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-content-baseline > 2</div>
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-content-baseline > 3</div>
</div>
<hr/>
<div class="display-flex flex-direction-row align-content-center height-100">
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-content-center > 1</div>
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-content-center > 2</div>
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-content-center > 3</div>
</div>
<hr/>
<div class="display-flex flex-direction-row align-content-stretch height-100">
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-content-stretch > 1</div>
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-content-stretch > 2</div>
<div class="center bg-green-light margin-sm">.display-flex.flex-direction-row.align-content-stretch > 3</div>
</div>
</div>
<h3>Child Classes</h3>
<h4>Customized Grow/Shrink</h4>
<p>0 through 12 are supported for .flex-grow and .flex-shrink classes</p>
<div class="bg-blue-light">
<div class="display-flex flex-direction-row">
<div class="flex-grow-5 center bg-green-light margin-sm">.flex-grow-5</div>
<div class="flex-grow-2 center bg-green-light margin-sm">.flex-grow-2</div>
<div class="flex-shrink-2 center bg-green-light margin-sm">.flex-shrink-2</div>
</div>
</div>
<h4>Ordering</h4>
<p>0 through 12 are supported for the order classes and can be used to reorder the children</p>
<div class="bg-blue-light">
<div class="display-flex flex-direction-row">
<div class="center bg-green-light margin-sm order-3">.order-3 1</div>
<div class="center bg-green-light margin-sm order-1">.order-1 2</div>
<div class="center bg-green-light margin-sm order-2">.order-2 3</div>
</div>
</div>
<h3>Responsive Classes</h3>
<p>
All the classes mentioned above also have responsive variants of xs, sm, md, lg and xl. The default
behavior is to apply to screens of all sizes. Applying a prefix to the class name will limit the class
to only
apply to that screen size range
</p>
<h5>Prefix Screen Sizes</h5>
<table>
<thead>
<tr>
<th></th>
<th>No Prefix</th>
<th>xs-</th>
<th>sm-</th>
<th>sm-up-</th>
<th>sm-down-</th>
<th>md-</th>
<th>md-up-</th>
<th>md-down-</th>
<th>lg-</th>
<th>lg-up-</th>
<th>lg-down-</th>
<th>xl-</th>
</tr>
</thead>
<tbody>
<tr>
<td>Min</td>
<td>All</td>
<td>0</td>
<td>480px</td>
<td>480px</td>
<td>0</td>
<td>768px</td>
<td>768px</td>
<td>0</td>
<td>992px</td>
<td>992px</td>
<td>0</td>
<td>1200px</td>
</tr>
<tr>
<td>Max</td>
<td>All</td>
<td>480px</td>
<td>768px</td>
<td>up</td>
<td>768px</td>
<td>992px</td>
<td>up</td>
<td>992px</td>
<td>1200px</td>
<td>up</td>
<td>1200px</td>
<td>up</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>