-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
350 lines (320 loc) · 20.4 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
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>lightbase-css - a lightweight responsive CSS grid template</title>
<meta name="description" content="lightbase-css is a lightweight percent-based responsive css template to be used as a css grid bootstrap for developers.">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="css/main.css">
<!--[if lt IE 9]>
<script src="js/vendor/html5-3.6-respond-1.1.0.min.js"></script>
<![endif]-->
</head>
<body>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=303928503059391";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<header class="site-header" role="banner">
<h1 class="ir">lightbase-css</h1>
</header>
<div class="wrapper">
<div class="row main">
<div class="col-golden-large">
<article>
<hgroup>
<h1>Lightweight %-based Responsive CSS Template</h1>
<p>This template is created to provide a CSS structure for a <strong><em>very lightweight*</em> <span class="large">%</span>-based responsive website</strong>. It was created with <strong>simplicity and minimalism</strong> in mind so that it can act as a plug-n-play template for designers and developers.</p>
<p>*Compare Bootstrap's CSS/JS size of <strong>~175KB</strong> to lightbase's <strong>~16KB</strong>.</p>
</hgroup>
<section>
<h2>Another CSS Framework? Why use it?</h2>
<p><strong>4 reasons:</strong></p>
<div class="row why">
<div class="col-1-4">
<h3>1 - Simplicity</h3>
<p>It's extremely lightweight & simple to use. Simply create a parent <code><div class="row"></code> and give the children divs a class of <code>col-x-x</code> and you're good to go.</p>
</div>
<div class="col-1-4">
<h3>2 - Size</h3>
<p>Lightbase-css is TINY - with a total size of only about <strong>16KB</strong>! There is <strong>no extra bloat</strong>, <strong>no extra styling</strong> and <em>almost</em> <strong>no JS</strong>*. This makes it a great bare-bones template for designers / developers.</p>
</div>
<div class="col-1-4">
<h3>3 - Responsiveness</h3>
<p>As viewport size adjusts and columns shrink, they hit certain thresholds and split to 2 or 3 rows so that content is never "crushed". Resize the browser and try it out.</p>
</div>
<div class="col-1-4">
<h3>4 - Browser Support</h3>
<p>It supports IE7 & IE8... something I haven't seen in any other CSS template or framework and it sucks becuase my current client requires IE7 support :/</p>
</div>
</div>
<p>There are plenty of CSS templates and frameworks out there and they all have their strong and weak points. This one is different because it's been created to be <strong>as simple and lightweight</strong> as possible.</p>
<p class="note">*I use HTML5shiv and Respond.js to make this work in IE8 and below.</p>
</section>
<section>
<h2>Structure</h2>
<p>To create four 25% columns, simply create 4 divs with <code>class="col-1-4"</code>. For 75% and 25% columns, create 2 divs with <code>class="col-3-4"</code> and <code>class="col-1-4"</code>. Make sense?</p>
<p>All grids must have a parent div with <code>class="row"</code>.</p>
<div class="code-example">
<h4>Standard example</h4>
<code>
<pre>
<div class="row">
<div class="col-1-3">col 1</div>
<div class="col-1-3">col 2</div>
<div class="col-1-3">col 3</div>
</div>
</pre>
</code>
<h4>Nesting example</h4>
<code>
<pre>
<div class="row">
<div class="col-2-3">
col 1
<div class="row">
<div class="col-1-2">col 1-1</div>
<div class="col-1-2">col 1-2</div>
</div>
</div>
<div class="col-1-3">
col 2
</div>
</div>
</pre>
</code>
</div>
</section>
<!-- THE GRID -->
<section class="grid-example">
<h2>Grid Example</h2>
<div class="row">
<div class="col-1-2">
<p>.col-1-2</p>
</div>
<div class="col-1-2">
<p>.col-1-2</p>
</div>
</div>
<div class="row">
<div class="col-1-3">
<p>.col-1-3</p>
</div>
<div class="col-1-3">
<p>.col-1-3</p>
</div>
<div class="col-1-3">
<p>.col-1-3</p>
</div>
</div>
<div class="row">
<div class="col-1-4">
<p>.col-1-4</p>
</div>
<div class="col-1-4">
<p>.col-1-4</p>
</div>
<div class="col-1-4">
<p>.col-1-4</p>
</div>
<div class="col-1-4">
<p>.col-1-4</p>
</div>
</div>
<div class="row">
<div class="col-1-5">
<p>.col-1-5</p>
</div>
<div class="col-1-5">
<p>.col-1-5</p>
</div>
<div class="col-1-5">
<p>.col-1-5</p>
</div>
<div class="col-1-5">
<p>.col-1-5</p>
</div>
<div class="col-1-5">
<p>.col-1-5</p>
</div>
</div>
<div class="row">
<div class="col-1-8">
<p>.col-1-8</p>
</div>
<div class="col-1-8">
<p>.col-1-8</p>
</div>
<div class="col-1-8">
<p>.col-1-8</p>
</div>
<div class="col-1-8">
<p>.col-1-8</p>
</div>
<div class="col-1-8">
<p>.col-1-8</p>
</div>
<div class="col-1-8">
<p>.col-1-8</p>
</div>
<div class="col-1-8">
<p>.col-1-8</p>
</div>
<div class="col-1-8">
<p>.col-1-8</p>
</div>
</div>
<div class="row">
<div class="col-3-4">
<p>.col-3-4</p>
</div>
<div class="col-1-4">
<p>.col-1-4</p>
</div>
</div>
<div class="row">
<div class="col-2-3">
<p>.col-2-3</p>
</div>
<div class="col-1-3">
<p>.col-1-3</p>
</div>
</div>
<div class="row">
<div class="col-golden-large">
.col-golden-large (golden ratio - 62%)
</div>
<div class="col-golden-small">
.col-golden-small (golden ratio - 38%)
</div>
</div>
<div class="row new-section">
<div class="col-2-3">
nesting - column 1 (66%)
<div class="row">
<div class="col-1-2">
column 1-1 (50%)
</div>
<div class="col-1-2">
column 1-2 (50%)
</div>
</div>
</div>
<div class="col-1-3">
column 2 (33%)
</div>
</div>
</section><!-- .grid-example -->
<section class="image-example">
<h2>Image Example</h2>
<div class="row">
<div class="col-1-4">
<img src="img/image.png" alt="responsive image">
</div>
<div class="col-1-4">
<img src="img/image.png" alt="responsive image">
</div>
<div class="col-1-4">
<img src="img/image.png" alt="responsive image">
</div>
<div class="col-1-4">
<img src="img/image.png" alt="responsive image">
</div>
</div>
</section><!-- .image-example -->
<section>
<h2>Recommended Use</h2>
<p>My suggestion is to first <a href="download/lightbase-css.zip">download lightbase-css</a>, then...</p>
<ol>
<li>Go to <a href="http://www.initializr.com/" target="_blank">initializr.com</a> and choose <em>'Classic H5BP'</em></li>
<li>Make sure to choose "Modernizr" or "Just HTML5shiv" <strong>AND check "Respond"</strong></li>
<li>Choose whatever options you'd like and download</li>
<li>Open up your initializr download and in <em>index.html</em>, remove <code><link rel="stylesheet" href="css/normalize.min.css"></code></li>
<li>Replace <code>/css/main.css</code> with your <em>lightbase main.css</em> </li>
<li>Now you can use the lightbase <em>index.html</em> as a guide for how the grid system works</li>
</ol>
<p>This will allow you to choose several options via initializr and it will make sure you have the latest jQuery/modernizr/html5shiv/etc.</p>
<p class="note">Note that <strong>jQuery is not required</strong> for lightbase-css to work. You can remove it from your index.html file if you don't plan on using it.</p>
</section>
<section>
<h2>Credit</h2>
<p>Most concepts applied on here are borrowed ideas from other brilliant people...</p>
<p>The <code>class="col-x-x"</code> structure is a modified idea created by Chris Coyier (<a href="http://css-tricks.com/dont-overthink-it-grids/" target="_blank">Don't Overthink It Grids</a>). Modifications to his idea include adding support for IE7 and allowing for column margins.</p>
<p>I'm using a <em>slightly</em> modified version of Nicolas Gallagher and Johnathan Neal's <a href="https://github.com/necolas/normalize.css" target="_blank">Normalize.css</a> and several concepts are borrowed from <a href="http://html5boilerplate.com/" target="_blank">HTML5 Boilerplate</a> and Jonathan Verrecchia's Responsive <a href="http://www.initializr.com/" target="_blank">Initializr</a>.</p>
<p>Please don't sue me.</p>
</section>
<section>
<h2>Browser Support</h2>
<p><img src="img/sprite-browsers.png" alt="Browser Support - Chrome, Firefox, Opera, Safari, IE7 and up"></p>
<p>The grid supports IE7 and up; and that includes all modern browsers (obviously). IE7 support is provided using <a href="https://github.com/scottjehl/Respond" target="_blank">respond.js</a>, <a href="http://code.google.com/p/html5shiv/" target="_blank">html5shiv</a> and some crazy css conditionals that I created. It's not 100% perfect in IE7, it's pretty close and getting there was a pain in the ass, so deal with it :)</p>
</section>
<section>
<h2>Notes</h2>
<p>Make sure that HTML5shiv and Respond.js are up to date! If you didn't start with initializr, visit the respond.js and html5shiv sites (links above) and update the code in <code>/js/vendor/html5-x.x-respond-x.x.x.min.js</code>.</p>
</section>
<section>
<h2>Changelog</h2>
<p><strong>01/28/2013</strong></p>
<ul class="changelog">
<li>Changed <code>div[class*="col-"] { }</code> to <code>*[class*="col-"] { }</code> allowing columns to be applied to any element</li>
<li>Added <code>clear: left;</code> to 2nd and 3rd row on smaller screens</li>
<li>Added Golden Ratio columns</li>
<li>Added image example and <code>max-width: 100%;</code> on images</li>
</ul>
</section>
<section>
<h2>Feedback</h2>
<script type="text/javascript">
<!--
var part1 = "dan";
var part2 = "danmathisen.com";
document.write('<p>Please send any feedback to <a href="mai' + 'lto:' + part1 + '@' + part2 + '">');
document.write(part1 + '@' + part2 + '</a> or find me on Twitter <a href="https://twitter.com/dmathisen36" target="_blank">@dmathisen36</a>.</p>');
// -->
</script>
<noscript>
<p><em>[please enable javascript]</em></p>
</noscript>
</section>
</article>
</div><!-- .col-golden-large -->
<div class="col-golden-small">
<aside>
<h3>Golden Ratio</h3>
<p>This is an aside with <code>class="col-golden-small"</code>. The stuff over there ← has <code>class="col-golden-large"</code>.</p>
<p>They are as close to the golden ratio (62% / 38%) as possible.</p>
<h3>Share</h3>
<div class="fb-like" data-href="http://danmathisen.com/lightbase-css/" data-send="true" data-width="450" data-show-faces="false" data-font="arial"></div>
<a href="https://twitter.com/dmathisen36" class="twitter-follow-button" data-show-count="false" data-lang="en">Follow @dmathisen36</a>
<a href="https://twitter.com/share" class="twitter-share-button" data-lang="en">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<h2 class="new-section">Download</h2>
<a href="download/lightbase-css.zip" class="button">lightbase-css.zip (~40KB)</a>
</aside>
</div><!-- .col-golden-small -->
</div><!-- .row.main -->
</div> <!-- .wrapper -->
<footer class="row site-footer new-section">
<div class="col-1-1">
<h3>lightbase-css</h3>
<p class="note">Created by <a href="http://danmathisen.com/">Dan Mathisen</a></p>
</div>
</footer>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
<script>
var _gaq=[['_setAccount','UA-28810928-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>