-
Notifications
You must be signed in to change notification settings - Fork 3
/
grid.html
executable file
·294 lines (254 loc) · 13.7 KB
/
grid.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
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Atlas — A modern front-end framework — Grid</title>
<link rel="icon" href="../images/favicon.ico">
<link href="../css/styles.css" rel="stylesheet">
<style>
.row.demo-row,
.row.demo-row-end {
font-size: 14px;
font-family: Monaco, Consolas, "Liberation Mono", Courier, monospace;
margin-bottom: 10px;
line-height: 4rem;
border: solid 1px #000;
margin-left: 0 !important;
margin-right: 0 !important;
}
.row.demo-row .column:nth-child(2),
.row.demo-row .column.small-centered,
.row.demo-row .column.large-centered,
.row.demo-row-end .column {
background-color: #f7f7f7;
}
.demo-panel {
font-size: 14px;
font-family: Monaco, Consolas, "Liberation Mono", Courier, monospace;
margin-bottom: 10px;
border: solid 1px #000;
padding: 15px;
}
</style>
<!--[if lt IE 9]>
<script src="../js/libs/respond.min.js" rel="javascript"></script>
<script src="../js/libs/rem.min.js" rel="javascript"></script>
<![endif]-->
</head>
<body>
<main>
<section>
<div class="row column">
<h2>Basic</h2>
<p>Start by adding an element with a class of <code>row</code>. This will create a horizontal block to contain vertical columns. Then add divs with a <code>column</code> class within that row. You can use <code>column</code> or <code>columns</code> - the only difference is grammar. Specify the widths of each column with the small-#, medium-#, and large-# classes.</p>
<p><strong>Grid is mobile-first</strong>. Code for small screens first, and larger devices will inherit those styles. Customize for larger screens as necessary.</p>
</div>
<div class="row column">
<div class="row demo-row">
<div class="small-2 large-4 column"><span class="hide-for-large-up">2</span><span class="show-for-large-up">4</span></div>
<div class="small-4 large-4 column">4</div>
<div class="small-6 large-4 column"><span class="hide-for-large-up">6</span><span class="show-for-large-up">4</span></div>
</div>
<div class="row demo-row">
<div class="large-3 column"><span class="hide-for-large-up">full</span><span class="show-for-large-up">3</span></div>
<div class="large-6 column"><span class="hide-for-large-up">full</span><span class="show-for-large-up">6</span></div>
<div class="large-3 column"><span class="hide-for-large-up">full</span><span class="show-for-large-up">3</span></div>
</div>
<div class="row demo-row">
<div class="small-6 large-2 column"><span class="hide-for-large-up">6</span><span class="show-for-large-up">2</span></div>
<div class="small-6 large-8 column"><span class="hide-for-large-up">6</span><span class="show-for-large-up">8</span></div>
<div class="small-12 large-2 column"><span class="hide-for-large-up">full</span><span class="show-for-large-up">2</span></div>
</div>
<div class="row demo-row">
<div class="small-3 column">3</div>
<div class="small-9 column">9</div>
</div>
<div class="row demo-row">
<div class="large-4 column"><span class="hide-for-large-up">full</span><span class="show-for-large-up">4</span></div>
<div class="large-8 column"><span class="hide-for-large-up">full</span><span class="show-for-large-up">8</span></div>
</div>
<div class="row demo-row">
<div class="small-6 large-5 column"><span class="hide-for-large-up">6</span><span class="show-for-large-up">5</span></div>
<div class="small-6 large-7 column"><span class="hide-for-large-up">6</span><span class="show-for-large-up">7</span></div>
</div>
<div class="row demo-row">
<div class="large-6 column"><span class="hide-for-large-up">full</span><span class="show-for-large-up">6</span></div>
<div class="large-6 column"><span class="hide-for-large-up">full</span><span class="show-for-large-up">6</span></div>
</div>
</div>
</section>
<section>
<div class="row column">
<h2>Small Grid</h2>
<p>Small grids expand to large screens easier than large grids cram into small screens.</p>
</div>
<div class="row column">
<div class="row demo-row">
<div class="small-2 column">2 columns</div>
<div class="small-10 column">10 columns</div>
</div>
<div class="row demo-row">
<div class="small-3 column">3 columns</div>
<div class="small-9 column">9 columns</div>
</div>
</div>
</section>
<section>
<div class="row column">
<h2>Medium Grid</h2>
<p>Medium sized screens will inherit styles from small, unless you specify a different layout, using the medium grid classes.</p>
</div>
<div class="row column">
<div class="row demo-row">
<div class="medium-2 column">2 columns</div>
<div class="medium-10 column">10 columns</div>
</div>
<div class="row demo-row">
<div class="medium-3 column">3 columns</div>
<div class="medium-9 column">9 columns</div>
</div>
</div>
</section>
<section>
<div class="row column">
<h2>Advanced</h2>
<p>You can nest the grids indefinitely, though at a certain point it will get absurd.</p>
</div>
<div class="row column">
<div class="row demo-row">
<div class="small-8 column">8
<div class="row">
<div class="small-8 column">8 Nested
<div class="row">
<div class="small-8 column">8 Nested Again</div>
<div class="small-4 column">4</div>
</div>
</div>
<div class="small-4 column">4</div>
</div>
</div>
<div class="small-4 column">4</div>
</div>
</div>
</section>
<section>
<div class="row column">
<h2>Offsets</h2>
<p>Move blocks up to 11 columns to the right by using classes like <code>.large-offset-1</code> and <code>.small-offset-3</code>.</p>
</div>
<div class="row column">
<div class="row demo-row">
<div class="large-1 column">1</div>
<div class="large-11 column">11</div>
</div>
<div class="row demo-row">
<div class="large-1 column">1</div>
<div class="large-10 large-offset-1 column">10, offset 1</div>
</div>
<div class="row demo-row">
<div class="large-1 column">1</div>
<div class="large-9 large-offset-2 column">9, offset 2</div>
</div>
<div class="row demo-row">
<div class="large-1 column">1</div>
<div class="large-8 large-offset-3 column">8, offset 3</div>
</div>
</div>
</section>
<section>
<div class="row column">
<h2>Incomplete Rows</h2>
<p>In order to work around browsers' different rounding behaviors, Grid will float the last column in a row to the right so the edge aligns. If your row doesn't have a count that adds up to 12 columns, you can tag the last column with a class of <code>end</code> in order to override that behavior.</p>
</div>
<div class="row column">
<div class="row demo-row-end">
<div class="medium-3 column">3</div>
<div class="medium-3 column">3</div>
<div class="medium-3 column">3</div>
</div>
<div class="row demo-row-end">
<div class="medium-3 column">3</div>
<div class="medium-3 column">3</div>
<div class="medium-3 column end">3 end</div>
</div>
</div>
</section>
<section>
<div class="row column">
<h2>Collapse/Uncollapse Rows</h2>
<p>The <code>collapse</code> class lets you remove column gutters (padding).</p>
<p>There are times when you won't want each media query to be collapsed or uncollapsed. In this case, use the media query size you want and collapse or uncollapse and add that to your <code>row</code> element. Example removes the gutter at the large breakpoint and then adds the gutter to columns at medium and small.</p>
</div>
<div class="row column">
<div class="row medium-uncollapse large-collapse">
<div class="small-6 column">
<div class="demo-panel">
<p class="show-for-small-only">On small, I have gutters!</p>
<p class="show-for-medium-only">On a medium screen, I have gutters!</p>
<p class="show-for-large-up">On a large screen, I have no gutters!</p>
</div>
</div>
<div class="small-6 column">
<div class="demo-panel">
<p class="show-for-small-only">On small, I have gutters!</p>
<p class="show-for-medium-only">On a medium screen, I have gutters!</p>
<p class="show-for-large-up">On a large screen, I have no gutters!</p>
</div>
</div>
</div>
</div>
</section>
<section>
<div class="row column">
<h2>Centered Columns</h2>
<p>Center your columns by adding a class of <code>small-centered</code> to your <code>column</code>. Large will inherit small centering by default, but you can also center solely on large by applying a <code>large-centered</code> class. To uncenter on large screens use <code>large-uncentered</code>.</p>
</div>
<div class="row column">
<div class="row demo-row">
<div class="small-3 small-centered column">3 centered</div>
</div>
<div class="row demo-row">
<div class="small-6 large-centered column">6 centered, large</div>
</div>
<div class="row demo-row">
<div class="small-9 small-centered large-uncentered column">9 centered small</div>
</div>
<div class="row demo-row">
<div class="small-11 small-centered column">11 centered</div>
</div>
</div>
</section>
<section>
<div class="row column">
<h2>Source Ordering</h2>
<p>Using these source ordering classes, you can shift columns around between our breakpoints. This means if you place sub-navigation below main content on small displays, you have the option to position the sub-navigation on either the left or right of the page for large displays. Prefix push/pull with the size of the device you want to apply the styles to. <code>medium-push-#</code>, <code>large-push-#</code> is the syntax you'll use. Use <code>large-reset-order</code> to reset pushed or pulled columns to their original position on large screens.</p>
</div>
<div class="row column">
<div class="row demo-row">
<div class="small-10 small-push-2 column">10</div>
<div class="small-2 small-pull-10 column">2, last</div>
</div>
<div class="row demo-row">
<div class="large-9 large-push-3 column">9</div>
<div class="large-3 large-pull-9 column">3, last</div>
</div>
<div class="row demo-row">
<div class="large-8 large-push-4 column">8</div>
<div class="large-4 large-pull-8 column">4, last</div>
</div>
<div class="row demo-row">
<div class="small-5 small-push-7 medium-7 medium-push-5 column">7</div>
<div class="small-7 small-pull-5 medium-5 medium-pull-7 column">5, last</div>
</div>
<div class="row demo-row">
<div class="medium-6 medium-push-6 column">6</div>
<div class="medium-6 medium-pull-6 column">6, last</div>
</div>
</div>
</section>
</main>
</body>
</html>