-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
504 lines (462 loc) · 19.7 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
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/stretch.css">
<link rel="stylesheet" href="css/demo.css">
<title>Stretch CSS – A super simple responsive CSS grid system – David Ingledow</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="//use.typekit.net/swa0hpc.js"></script>
<script>try{Typekit.load();}catch(e){}</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-37251060-3', 'auto');
ga('send', 'pageview');
</script>
</head>
<body>
<div class="wrap">
<div class="row">
<div class="col__lg-8-12 offset__lg-2-12 col__12-12">
<div class="title">
<h1 class="title__heading1">Stretch CSS</h1>
<p>
A super simple responsive CSS grid framework.
</p>
<div class="btn-share-wrapper">
<div class="btn-share twitter">
<a
href="https://twitter.com/share"
class="twitter-share-button"
data-via="dingledow">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
</div>
<div class="btn-share github__star">
<a
class="github-button"
href="https://github.com/dingledow/Stretch"
data-icon="octicon-star"
data-count-href="/dingledow/Stretch/stargazers"
data-count-api="/repos/dingledo/Stretch#stargazers_count">Star</a>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col__lg-6-12__center col__12-12">
<h2>About</h2>
<p>
Stretch is a 12 column grid that can have any gutter size you want.
Columns can be offset and centred to make manoeuvring content really
easy. Columns can be specified differently for three devices sizes.
</p>
<p>
1 Sass file. 5 variables. Lots of win.
</p>
</div>
</div>
<div class="row">
<div class="col__6-12__center download__about">
<a class="btn btn-lg btn-primary" href="https://github.com/dingledow/Stretch">View on GitHub</a>
<a class="btn btn-lg btn-secondary" href="https://raw.githubusercontent.com/dingledow/Stretch/master/css/stretch.css" download="Download Quickstart CSS">Download Quickstart CSS</a>
<p class="version">v1.0.3</p>
</div>
</div>
<div class="row">
<div class="col__lg-6-12__center col__12-12">
<h2>Installation</h2>
<p>
The easiest way to install Stretch CSS is using bower:<br /><code>bower install stretch-css</code>
</p>
<p>
Compile the Sass file with Grunt or Gulp.
</p>
<p>
If you're not using Bower, just download the <code>.scss</code> from
GitHub or download the plain vanilla <code>.css</code> above.
</div>
</div>
<div class="row">
<div class="col__lg-6-12__center col__12-12">
<h2>Getting Started</h2>
<h3>Sass Variables</h3>
<p>
The best way to use stretch is to include the <code>stretch.scss</code>
file in your Sass build. You can set the following variables to
whatever you want. These are the default values:
<ul class="getting_started__variable_list">
<li><code>$wrap: 960px;</code></li>
<li><code>$gutter: 30px;</code></li>
<li><code>$vertical-spacing: 20px;</code></li>
<li><code>$md-breakpoint: 768px;</code></li>
<li><code>$sm-breakpoint: 480px;</code></li>
</ul>
</p>
<h3>Prepare Your Grid</h3>
<h4>Create a Wrapper</h4>
<p>
Start by setting a <code>wrap</code> class on the element that will
contain all the rows of content. The width for this is set in the
<code>$wrap</code> Sass variable.
</p>
<p>
If you want a full-width grid, then just set <code>$wrap</code> to
<code>100%</code>.
</p>
<h4>Add Rows</h4>
<p>
Add a row within the wrap element by setting a <code>row</code> class
to the element that will contain the columns for that row.
</p>
<p>
You can specify the vertical spacing between columns by setting the
<code>$vertical-spacing</code> variable to what you prefer.
</p>
<h4>Define the Gutter</h4>
<p>
The default gutter width is <code>30px</code>, but this can be
changed to whatever you would like in the <code>$gutter</code>
variable.
</p>
<h3>Create Your Columns</h3>
<p>
So far, your grid structure will look something like this:
</p>
<pre>
<<span class="div-highlight">div</span> <span class="class-highlight">class</span>="wrap">
<<span class="div-highlight">div</span> <span class="class-highlight">class</span>="row">
<span class="comment-highlight"><!-- Add columns here --></span>
</<span class="div-highlight">div</span>>
</<span class="div-highlight">div</span>></pre>
<h4>Simple Columns</h4>
<p>
The quickest way to setup columns is to create ones that don't respond
to specific breakpoints (see <a href="#responsive_columns">Responsive Columns</a> for columns that do).
</p>
<p>
Stretch CSS is based on a 12 column grid. To define a column, create a
class on the element like this:
</p>
<pre>
<<span class="div-highlight">div</span> <span class="class-highlight">class</span>="wrap">
<<span class="div-highlight">div</span> <span class="class-highlight">class</span>="row">
<<span class="div-highlight">div</span> <span class="class-highlight">class</span>="col__x-12">
<span class="comment-highlight"><!-- Content goes here --></span>
</<span class="div-highlight">div</span>>
</<span class="div-highlight">div</span>>
</<span class="div-highlight">div</span>></pre>
<p>
Change the value of <code>x</code> to be the number of columns wide
the element should be.
</p>
<h4>Simple Columns – Demo</h4>
<p>
The demo below shows how different combinations of column widths
can be used to create a grid system with Stretch CSS.
</p>
<p>
Hover over each block to see the class name used.
</p>
</div>
</div>
</div>
<div class="wrap demo">
<div class="row demo">
<div class="col__12-12">
<div class="block"><div class="col_class">.col__12-12</div></div>
</div>
</div>
<div class="row demo">
<div class="col__6-12">
<div class="block"><div class="col_class">.col__6-12</div></div>
</div>
<div class="col__6-12">
<div class="block"><div class="col_class">.col__6-12</div></div>
</div>
</div>
<div class="row demo">
<div class="col__3-12">
<div class="block"><div class="col_class">.col__3-12</div></div>
</div>
<div class="col__3-12">
<div class="block"><div class="col_class">.col__3-12</div></div>
</div>
<div class="col__3-12">
<div class="block"><div class="col_class">.col__3-12</div></div>
</div>
<div class="col__3-12">
<div class="block"><div class="col_class">.col__3-12</div></div>
</div>
</div>
<div class="row demo">
<div class="col__4-12">
<div class="block"><div class="col_class">.col__4-12</div></div>
</div>
<div class="col__8-12">
<div class="block"><div class="col_class">.col__8-12</div></div>
</div>
</div>
<div class="row demo">
<div class="col__2-12">
<div class="block"><div class="col_class">.col__2-12</div></div>
</div>
<div class="col__2-12">
<div class="block"><div class="col_class">.col__2-12</div></div>
</div>
<div class="col__2-12">
<div class="block"><div class="col_class">.col__2-12</div></div>
</div>
<div class="col__2-12">
<div class="block"><div class="col_class">.col__2-12</div></div>
</div>
<div class="col__2-12">
<div class="block"><div class="col_class">.col__2-12</div></div>
</div>
<div class="col__2-12">
<div class="block"><div class="col_class">.col__2-12</div></div>
</div>
</div>
<div class="row demo">
<div class="col__5-12">
<div class="block"><div class="col_class">.col__5-12</div></div>
</div>
<div class="col__5-12">
<div class="block"><div class="col_class">.col__5-12</div></div>
</div>
<div class="col__2-12">
<div class="block"><div class="col_class">.col__2-12</div></div>
</div>
</div>
</div>
<div class="wrap">
<div class="row">
<div class="col__lg-6-12__center col__12-12">
<h4>Centering Columns</h4>
<p>
Centering a single column in the grid is really simple. Create a new row
and add <code>__center</code> on to the end of the class that defines
the column's width.
</p>
<pre>
<<span class="div-highlight">div</span> <span class="class-highlight">class</span>="wrap">
<<span class="div-highlight">div</span> <span class="class-highlight">class</span>="row">
<<span class="div-highlight">div</span> <span class="class-highlight">class</span>="col__6-12__center">
<span class="comment-highlight"><!-- This column will be 6 out of 12 columns wide and positioned centrally. --></span>
</<span class="div-highlight">div</span>>
</<span class="div-highlight">div</span>>
</<span class="div-highlight">div</span>></pre>
<h4>Centering Columns Demo</h4>
<p>
Below is a demo of an element 6 columns wide that has been cetrally
positioned.
</p>
</div>
</div>
</div>
<div class="wrap demo">
<div class="row demo">
<div class="col__3-12">
<div class="block"><div class="col_class">.col__3-12</div></div>
</div>
<div class="col__3-12">
<div class="block"><div class="col_class">.col__3-12</div></div>
</div>
<div class="col__3-12">
<div class="block"><div class="col_class">.col__3-12</div></div>
</div>
<div class="col__3-12">
<div class="block"><div class="col_class">.col__3-12</div></div>
</div>
</div>
<div class="row demo">
<div class="col__6-12__center">
<div class="block"><div class="col_class">.col__3-12__center</div></div>
</div>
</div>
<div class="row demo">
<div class="col__3-12">
<div class="block"><div class="col_class">.col__3-12</div></div>
</div>
<div class="col__3-12">
<div class="block"><div class="col_class">.col__3-12</div></div>
</div>
<div class="col__3-12">
<div class="block"><div class="col_class">.col__3-12</div></div>
</div>
<div class="col__3-12">
<div class="block"><div class="col_class">.col__3-12</div></div>
</div>
</div>
</div><!-- End Wrap -->
<div class="wrap">
<div class="row">
<div id="responsive_columns" class="col__lg-6-12__center col__12-12">
<h4>Responsive Columns</h4>
<p>
To create responsive columns, first, ensure that the breakpoint variables
in the Sass file are set to your preferred sizes.
</p>
<p>
First, add the simple column class <code>col__x-12</code> to your columns. This needs to be set and
will apply as a default for all screen sizes.
</p>
<p>
Making columns respond is as easy as adding the following classes where necessary:<br />
</p>
<p>
<code>col__md-x-12</code> for medium sized screens and tablets<br />
<code>col__sm-x-12</code> for mobile devices.
</p>
<p>
The respsonsive <code>sm</code> and <code>md</code> classes can be applied as and
when they are required — the simple column class <code>col__x-12</code> will
always work when respsonsive classes aren't specified. This reduces
the amount of text in your HTML structure, but gives you the flexibility
to be as verbose as you wish.
</p>
<h4>Responsive Columns Demo</h4>
<p>
This demo shows how different responsive classes work for different screen sizes.
The HTML structure to create this is shown below. You'll notice that the
last two columns don't have an <code>sm</code> class specified. This shows
how the simple column class works when a responsive class isn't specified.
</p>
<pre>
<<span class="div-highlight">div</span> <span class="class-highlight">class</span>="wrap">
<<span class="div-highlight">div</span> <span class="class-highlight">class</span>="row">
<<span class="div-highlight">div</span> <span class="class-highlight">class</span>="col__4-12 col__md-6-12 col__sm-12-12"></<span class="div-highlight">div</span>>
<<span class="div-highlight">div</span> <span class="class-highlight">class</span>="col__4-12 col__md-6-12 col__sm-12-12"></<span class="div-highlight">div</span>>
<<span class="div-highlight">div</span> <span class="class-highlight">class</span>="col__4-12 col__md-12-12 col__sm-12-12"></<span class="div-highlight">div</span>>
<<span class="div-highlight">div</span> <span class="class-highlight">class</span>="col__6-12 col__md-12-12"></<span class="div-highlight">div</span>>
<<span class="div-highlight">div</span> <span class="class-highlight">class</span>="col__6-12 col__md-12-12"></<span class="div-highlight">div</span>>
</<span class="div-highlight">div</span>>
</<span class="div-highlight">div</span>></pre>
</div>
</div>
</div>
<div class="wrap demo">
<div class="row demo">
<div class="col__4-12 col__md-6-12 col__sm-12-12">
<div class="block">
<div class="col_class lg">.col__4-12</div>
<div class="col_class md">.col__md-6-12</div>
<div class="col_class sm">.col__sm-12-12</div>
</div>
</div>
<div class="col__4-12 col__md-6-12 col__sm-12-12">
<div class="block">
<div class="col_class lg">.col__4-12</div>
<div class="col_class md">.col__md-6-12</div>
<div class="col_class sm">.col__sm-12-12</div>
</div>
</div>
<div class="col__4-12 col__md-12-12 col__sm-12-12">
<div class="block">
<div class="col_class lg">.col__4-12</div>
<div class="col_class md">.col__md-12-12</div>
<div class="col_class sm">.col__sm-12-12</div>
</div>
</div>
<div class="col__6-12 col__md-12-12">
<div class="block">
<div class="col_class lg">.col__6-12</div>
<div class="col_class md">.col__md-12-12</div>
<div class="col_class sm">.col__6-12</div>
</div>
</div>
<div class="col__6-12 col__md-12-12">
<div class="block">
<div class="col_class lg">.col__6-12</div>
<div class="col_class md">.col__md-12-12</div>
<div class="col_class sm">.col__6-12</div>
</div>
</div>
</div>
</div>
<div class="wrap">
<div class="row">
<div id="offsetting_columns" class="col__lg-6-12__center col__12-12">
<h4>Offsetting Columns</h4>
<p>
Columns can be offset to create the blank areas of space in your layout.
</p>
<p>
To offset a column, just add the class <code>offset__x-12</code> to your column, where <code>x</code> is the number of columns you want to offset.
</p>
<p>
Responsive columns can be offset:<br />
</p>
<p>
<code>offset__lg-x-12</code> for large screens and desktops<br />
<code>offset__md-x-12</code> for medium sized screens and tablets<br />
<code>offset__sm-x-12</code> for mobile devices.
</p>
<h4>Offsetting Columns Demo</h4>
<pre>
<<span class="div-highlight">div</span> <span class="class-highlight">class</span>="wrap">
<<span class="div-highlight">div</span> <span class="class-highlight">class</span>="row">
<<span class="div-highlight">div</span> <span class="class-highlight">class</span>="col__4-12"></<span class="div-highlight">div</span>>
<<span class="div-highlight">div</span> <span class="class-highlight">class</span>="col__4-12 offset__4-12"></<span class="div-highlight">div</span>>
<<span class="div-highlight">div</span> <span class="class-highlight">class</span>="col__6-12"></<span class="div-highlight">div</span>>
<<span class="div-highlight">div</span> <span class="class-highlight">class</span>="col__3-12 offset__3-12"></<span class="div-highlight">div</span>>
<<span class="div-highlight">div</span> <span class="class-highlight">class</span>="col__3-12"></<span class="div-highlight">div</span>>
<<span class="div-highlight">div</span> <span class="class-highlight">class</span>="col__7-12 offset__2-12"></<span class="div-highlight">div</span>>
</<span class="div-highlight">div</span>>
</<span class="div-highlight">div</span>></pre>
</div>
</div>
</div>
<div class="wrap demo">
<div class="row demo">
<div class="col__4-12">
<div class="block"><div class="col_class">.col__4-12</div></div>
</div>
<div class="col__4-12 offset__4-12">
<div class="block"><div class="col_class">.col__4-12.offset__4-12</div></div>
</div>
</div>
<div class="row demo">
<div class="col__6-12">
<div class="block"><div class="col_class">.col__6-12</div></div>
</div>
<div class="col__3-12 offset__3-12">
<div class="block"><div class="col_class">.col__3-12.offset__3-12</div></div>
</div>
</div>
<div class="row demo">
<div class="col__3-12">
<div class="block"><div class="col_class">.col__3-12</div></div>
</div>
<div class="col__7-12 offset__2-12">
<div class="block"><div class="col_class">.col__7-12.offset__2-12</div></div>
</div>
</div>
</div>
<div class="wrap">
<div class="row">
<div class="col__6-12__center download__about__footer">
<a class="btn btn-lg btn-primary" href="https://github.com/dingledow/Stretch">View on GitHub</a>
<a class="btn btn-lg btn-secondary" href="https://raw.githubusercontent.com/dingledow/Stretch/master/css/stretch.css" download="Download Quickstart CSS">Download Quickstart CSS</a>
<div class="btn-share--twitter__footer">
<a
href="https://twitter.com/share"
class="twitter-share-button"
data-via="dingledow">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
</div>
<div class="footer">
<div class="footer--cp">A super simple responsive CSS grid framework by</div>
<div class="author"><a href="http://david.ingledow.co.uk/" target="_blank">David Ingledow</a></div>
<div class="footer--cp--oliver">Thanks to <a href="http://oliver-perry.com/" target="_blank">Oliver Perry</a> for helping me pick the name 'Stretch CSS'!</div>
</div>
</div>
</div>
</div>
<!-- Place this tag right after the last button or just before your close body tag. -->
<script async defer id="github-bjs" src="https://buttons.github.io/buttons.js"></script>
</body>
</html>