scaffolding.mustache 20.4 KB
Newer Older
1
<!-- Subhead
2
3
================================================== -->
<header class="jumbotron subhead" id="overview">
4
5
6
7
  <div class="container">
    <h1>{{_i}}Scaffolding{{/i}}</h1>
    <p class="lead">{{_i}}Bootstrap is built on a responsive 12-column grid and includes fixed- and fluid-width layouts.{{/i}}</p>
  </div>
8
</header>
9
10


11
<div class="container">
12

13

14
15
16
17
18
19
20
21
22
23
24
25
26
  <!-- Docs nav
  ================================================== -->
  <div class="row">
    <div class="span3 bs-docs-sidebar">
      <ul class="nav nav-list bs-docs-sidenav">
        <li><a href="#global">{{_i}}Global styles{{/i}} <i class="icon-chevron-right"></i></a></li>
        <li><a href="#gridSystem">{{_i}}Grid system{{/i}} <i class="icon-chevron-right"></i></a></li>
        <li><a href="#fluidGridSystem">{{_i}}Fluid grid system{{/i}} <i class="icon-chevron-right"></i></a></li>
        <li><a href="#layouts">{{_i}}Layouts{{/i}} <i class="icon-chevron-right"></i></a></li>
        <li><a href="#responsive">{{_i}}Responsive design{{/i}} <i class="icon-chevron-right"></i></a></li>
      </ul>
    </div>
    <div class="span9">
27

28

29

30
31
32
33
34
35
36
37
38
      <!-- Global Bootstrap settings
      ================================================== -->
      <section id="global">
        <div class="page-header">
          <h1>{{_i}}Global styles <small>for CSS reset, typography, and links</small>{{/i}}</h1>
        </div>

        <h3>{{_i}}Requires HTML5 doctype{{/i}}</h3>
        <p>{{_i}}Bootstrap makes use of certain HTML elements and CSS properties that require the use of the HTML5 doctype. Include it at the beginning of all your projects.{{/i}}</p>
39
40
41
42
43
44
<pre class="prettyprint linenums">
&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
  ...
&lt;/html&gt;
</pre>
45

46
47
48
49
50
51
52
53
54
        <h3>{{_i}}Typography and links{{/i}}</h3>
        <p>{{_i}}Bootstrap sets basic global display, typography, and link styles. Specifically, we:{{/i}}</p>
        <ul>
          <li>{{_i}}Remove <code>margin</code> on the body{{/i}}</li>
          <li>{{_i}}Set <code>background-color: white;</code> on the <code>body</code>{{/i}}</li>
          <li>{{_i}}Use the <code>@baseFontFamily</code>, <code>@baseFontSize</code>, and <code>@baseLineHeight</code> attributes as our typographyic base{{/i}}</li>
          <li>{{_i}}Set the global link color via <code>@linkColor</code> and apply link underlines only on <code>:hover</code>{{/i}}</li>
        </ul>
        <p>{{_i}}These styles can be found within <strong>scaffolding.less</strong>.{{/i}}</p>
55

56
57
        <h3>{{_i}}Reset via Normalize{{/i}}</h3>
        <p>{{_i}}With Bootstrap 2, the old reset block has been dropped in favor of <a href="http://necolas.github.com/normalize.css/" target="_blank">Normalize.css</a>, a project by <a href="http://twitter.com/necolas" target="_blank">Nicolas Gallagher</a> that also powers the <a href="http://html5boilerplate.com" target="_blank">HTML5 Boilerplate</a>. While we use much of Normalize within our <strong>reset.less</strong>, we have removed some elements specifically for Bootstrap.{{/i}}</p>
58

59
      </section>
60
61
62



63

64
65
66
67
68
      <!-- Grid system
      ================================================== -->
      <section id="gridSystem">
        <div class="page-header">
          <h1>{{_i}}Default grid system <small>12 columns with a responsive twist</small>{{/i}}</h1>
69
        </div>
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

        <h2>{{_i}}Live grid example{{/i}}</h2>
        <p>{{_i}}The default Bootstrap grid system utilizes <strong>12 columns</strong>, making for a 940px wide container without <a href="#responsive">responsive features</a> enabled. With the responsive CSS file added, the grid adapts to be 724px and 1170px wide depending on your viewport. Below 767px viewports, the columns become fluid and stack vertically.{{/i}}</p>
        <div class="bs-docs-grid">
          <div class="row show-grid">
            <div class="span1">1</div>
            <div class="span1">1</div>
            <div class="span1">1</div>
            <div class="span1">1</div>
            <div class="span1">1</div>
            <div class="span1">1</div>
            <div class="span1">1</div>
            <div class="span1">1</div>
            <div class="span1">1</div>
          </div>
          <div class="row show-grid">
            <div class="span2">2</div>
            <div class="span3">3</div>
            <div class="span4">4</div>
          </div>
          <div class="row show-grid">
            <div class="span4">4</div>
            <div class="span5">5</div>
          </div>
          <div class="row show-grid">
            <div class="span9">9</div>
          </div>
97
        </div>
98

99
100
        <h3>{{_i}}Basic grid HTML{{/i}}</h3>
        <p>{{_i}}For a simple two column layout, create a <code>.row</code> and add the appropriate number of <code>.span*</code> columns. As this is a 12-column grid, each <code>.span*</code> spans a number of those 12 columns, and should always add up to 12 for each row.{{/i}}</p>
101
102
103
104
105
106
<pre class="prettyprint linenums">
&lt;div class="row"&gt;
  &lt;div class="span4"&gt;...&lt;/div&gt;
  &lt;div class="span8"&gt;...&lt;/div&gt;
&lt;/div&gt;
</pre>
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
        <p>{{_i}}Given this example, we have <code>.span4</code> and <code>.span8</code>, making for 12 total columns and a complete row.{{/i}}</p>

        <h2>{{_i}}Offsetting columns{{/i}}</h2>
        <p>{{_i}}Move columns to the left using <code>.offset*</code> classes. Each class increases the left margin of a column by a whole column. For example, <code>.offset4</code> moves <code>.span4</code> over four columns.{{/i}}</p>
        <div class="bs-docs-grid">
          <div class="row show-grid">
            <div class="span4">4</div>
            <div class="span3 offset2">3 offset 2</div>
          </div><!-- /row -->
          <div class="row show-grid">
            <div class="span3 offset1">3 offset 1</div>
            <div class="span3 offset2">3 offset 2</div>
          </div><!-- /row -->
          <div class="row show-grid">
            <div class="span6 offset3">6 offset 3</div>
          </div><!-- /row -->
        </div>
124
125
126
<pre class="prettyprint linenums">
&lt;div class="row"&gt;
  &lt;div class="span4"&gt;...&lt;/div&gt;
Mark Otto's avatar
Mark Otto committed
127
  &lt;div class="span3 offset2"&gt;...&lt;/div&gt;
128
129
&lt;/div&gt;
</pre>
130

131
132
133
134
135
136
137
138
139
140
141
142
143
144
        <h2>{{_i}}Nesting columns{{/i}}</h2>
          <p>{{_i}}To nest your content with the default grid, add a new <code>.row</code> and set of <code>.span*</code> columns within an existing <code>.span*</code> column. Nested rows should include a set of columns that add up to the number of columns of its parent.{{/i}}</p>
          <h3>{{_i}}Example{{/i}}</h3>
          <p>{{_i}}Here two nested <code>.span4</code> columns are placed within a <code>.span8</code>.{{/i}}</p>
          <div class="row show-grid">
            <div class="span9">
              {{_i}}Level 1 of column{{/i}}
              <div class="row show-grid">
                <div class="span5">
                  {{_i}}Level 2{{/i}}
                </div>
                <div class="span4">
                  {{_i}}Level 2{{/i}}
                </div>
145
146
              </div>
            </div>
147
          </div>
148
149
<pre class="prettyprint linenums">
&lt;div class="row"&gt;
Mark Otto's avatar
Mark Otto committed
150
  &lt;div class="span10"&gt;
151
    {{_i}}Level 1 column{{/i}}
152
    &lt;div class="row"&gt;
Mark Otto's avatar
Mark Otto committed
153
154
      &lt;div class="span5"&gt;{{_i}}Level 2{{/i}}&lt;/div&gt;
      &lt;div class="span5"&gt;{{_i}}Level 2{{/i}}&lt;/div&gt;
155
156
157
158
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</pre>
159
      </section>
160
161
162



163
164
165
166
167
      <!-- Fluid grid system
      ================================================== -->
      <section id="fluidGridSystem">
        <div class="page-header">
          <h1>{{_i}}Fluid grid system <small>12 responsive, percent-based columns</small>{{/i}}</h1>
168
        </div>
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

        <h2>{{_i}}Live fluid grid example{{/i}}</h2>
        <p>{{_i}}The fluid grid system uses percents instead of pixels for column widths. It has the same responsive capabilities as our fixed grid system, ensuring proper proportions for key screen resolutions and devices.{{/i}}</p>
        <div class="bs-docs-grid">
          <div class="row-fluid show-grid">
            <div class="span1">1</div>
            <div class="span1">1</div>
            <div class="span1">1</div>
            <div class="span1">1</div>
            <div class="span1">1</div>
            <div class="span1">1</div>
            <div class="span1">1</div>
            <div class="span1">1</div>
            <div class="span1">1</div>
            <div class="span1">1</div>
            <div class="span1">1</div>
            <div class="span1">1</div>
          </div>
          <div class="row-fluid show-grid">
            <div class="span4">4</div>
            <div class="span4">4</div>
            <div class="span4">4</div>
          </div>
          <div class="row-fluid show-grid">
            <div class="span4">4</div>
            <div class="span8">8</div>
          </div>
          <div class="row-fluid show-grid">
            <div class="span6">6</div>
            <div class="span6">6</div>
          </div>
          <div class="row-fluid show-grid">
            <div class="span12">12</div>
          </div>
203
        </div>
204

205
206
        <h3>{{_i}}Basic fluid grid HTML{{/i}}</h3>
        <p>{{_i}}Make any row "fluid" by changing <code>.row</code> to <code>.row-fluid</code>. The column classes stay the exact same, making it easy to flip between fixed and fluid grids.{{/i}}</p>
207
208
209
210
211
<pre class="prettyprint linenums">
&lt;div class="row-fluid"&gt;
  &lt;div class="span4"&gt;...&lt;/div&gt;
  &lt;div class="span8"&gt;...&lt;/div&gt;
&lt;/div&gt;
Mark Otto's avatar
Mark Otto committed
212
213
</pre>

214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
        <h2>{{_i}}Fluid offsetting{{/i}}</h2>
        <p>{{_i}}Operates the same way as the fixed grid system offsetting: add <code>.offset*</code> to any column to offset by that many columns.{{/i}}</p>
        <div class="bs-docs-grid">
          <div class="row-fluid show-grid">
            <div class="span4">4</div>
            <div class="span4 offset4">4 offset 4</div>
          </div><!-- /row -->
          <div class="row-fluid show-grid">
            <div class="span3 offset3">3 offset 3</div>
            <div class="span3 offset3">3 offset 3</div>
          </div><!-- /row -->
          <div class="row-fluid show-grid">
            <div class="span6 offset6">6 offset 6</div>
          </div><!-- /row -->
        </div>
Mark Otto's avatar
Mark Otto committed
229
230
231
232
233
<pre class="prettyprint linenums">
&lt;div class="row-fluid"&gt;
  &lt;div class="span4"&gt;...&lt;/div&gt;
  &lt;div class="span4 offset2"&gt;...&lt;/div&gt;
&lt;/div&gt;
234
235
</pre>

236
237
238
239
240
241
242
243
244
245
246
247
        <h2>{{_i}}Fluid nesting{{/i}}</h2>
        <p>{{_i}}Nesting with fluid grids is a bit different: the number of nested columns should not match the parent's number of columns. Instead, each level of nested columns are reset because each row takes up 100% of the parent column.{{/i}}</p>
        <div class="row-fluid show-grid">
          <div class="span12">
            {{_i}}Fluid 12{{/i}}
            <div class="row-fluid show-grid">
              <div class="span6">
                {{_i}}Fluid 6{{/i}}
              </div>
              <div class="span6">
                {{_i}}Fluid 6{{/i}}
              </div>
248
249
            </div>
          </div>
250
        </div>
251
<pre class="prettyprint linenums">
252
&lt;div class="row-fluid"&gt;
253
  &lt;div class="span12"&gt;
Jacob Thornton's avatar
Jacob Thornton committed
254
    {{_i}}Level 1 of column{{/i}}
255
    &lt;div class="row-fluid"&gt;
Jacob Thornton's avatar
Jacob Thornton committed
256
257
      &lt;div class="span6"&gt;{{_i}}Level 2{{/i}}&lt;/div&gt;
      &lt;div class="span6"&gt;{{_i}}Level 2{{/i}}&lt;/div&gt;
258
259
260
261
262
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</pre>

263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
      </section>




      <!-- Layouts (Default and fluid)
      ================================================== -->
      <section id="layouts">
        <div class="page-header">
          <h1>{{_i}}Layouts <small>Basic templates to create webpages</small>{{/i}}</h1>
        </div>

        <h2>{{_i}}Fixed layout{{/i}}</h2>
        <p>{{_i}}Provides a common fixed-width (and optionally responsive) layout with only <code>&lt;div class="container"&gt;</code> required.{{/i}}</p>
        <div class="mini-layout">
          <div class="mini-layout-body"></div>
        </div>
280
281
282
283
284
285
286
<pre class="prettyprint linenums">
&lt;body&gt;
  &lt;div class="container"&gt;
    ...
  &lt;/div&gt;
&lt;/body&gt;
</pre>
287

288
289
290
291
292
293
        <h2>{{_i}}Fluid layout{{/i}}</h2>
        <p>{{_i}}Create a fluid, two-column page with <code>&lt;div class="container-fluid"&gt;</code>&mdash;great for applications and docs.{{/i}}</p>
        <div class="mini-layout fluid">
          <div class="mini-layout-sidebar"></div>
          <div class="mini-layout-body"></div>
        </div>
294
<pre class="prettyprint linenums">
Mark Otto's avatar
Mark Otto committed
295
296
297
298
&lt;div class="container-fluid"&gt;
  &lt;div class="row-fluid"&gt;
    &lt;div class="span2"&gt;
      &lt;!--{{_i}}Sidebar content{{/i}}--&gt;
299
    &lt;/div&gt;
Mark Otto's avatar
Mark Otto committed
300
301
    &lt;div class="span10"&gt;
      &lt;!--{{_i}}Body content{{/i}}--&gt;
302
303
    &lt;/div&gt;
  &lt;/div&gt;
Mark Otto's avatar
Mark Otto committed
304
&lt;/div&gt;
305
</pre>
306
      </section>
307
308
309
310




311
312
313
314
315
316
      <!-- Responsive design
      ================================================== -->
      <section id="responsive">
        <div class="page-header">
          <h1>{{_i}}Responsive design <small>Media queries for various devices and resolutions</small>{{/i}}</h1>
        </div>
317

318
319
320
        {{! Enabling }}
        <h2>{{_i}}Enabling responsive features{{/i}}</h2>
        <p>{{_i}}Turn on responsive CSS in your project by including the proper meta tag and additional stylesheet within the <code>&lt;head&gt;</code> of your document. If you've compiled Bootstrap from the Customize page, you need only include the meta tag.{{/i}}</p>
Mark Otto's avatar
Mark Otto committed
321
322
323
324
<pre class="prettyprint linenums">
&lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
&lt;link href="assets/css/bootstrap-responsive.css" rel="stylesheet"&gt;
</pre>
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
        <p><span class="label label-info">{{_i}}Heads up!{{/i}}</span> {{_i}} Bootstrap doesn't include responsive features by default at this time as not everything needs to be responsive. Instead of encouraging developers to remove this feature, we figure it best to enable it as needed.{{/i}}</p>

        {{! About }}
        <h2>{{_i}}About responsive Bootstrap{{/i}}</h2>
        <img src="assets/img/responsive-illustrations.png" alt="Responsive devices" style="float: right; margin: 0 0 20px 20px;">
        <p>{{_i}}Media queries allow for custom CSS based on a number of conditions&mdash;ratios, widths, display type, etc&mdash;but usually focuses around <code>min-width</code> and <code>max-width</code>.{{/i}}</p>
        <ul>
          <li>{{_i}}Modify the width of column in our grid{{/i}}</li>
          <li>{{_i}}Stack elements instead of float wherever necessary{{/i}}</li>
          <li>{{_i}}Resize headings and text to be more appropriate for devices{{/i}}</li>
        </ul>
        <p>{{_i}}Use media queries responsibly and only as a start to your mobile audiences. For larger projects, do consider dedicated code bases and not layers of media queries.{{/i}}</p>

        {{! Supported }}
        <h2>{{_i}}Supported devices{{/i}}</h2>
        <p>{{_i}}Bootstrap supports a handful of media queries in a single file to help make your projects more appropriate on different devices and screen resolutions. Here's what's included:{{/i}}</p>
        <table class="table table-bordered table-striped">
          <thead>
            <tr>
              <th>{{_i}}Label{{/i}}</th>
              <th>{{_i}}Layout width{{/i}}</th>
              <th>{{_i}}Column width{{/i}}</th>
              <th>{{_i}}Gutter width{{/i}}</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td>{{_i}}Phones{{/i}}</td>
              <td>480px and below</td>
              <td class="muted" colspan="2">{{_i}}Fluid columns, no fixed widths{{/i}}</td>
            </tr>
            <tr>
              <td>{{_i}}Phones to tablets{{/i}}</td>
              <td>767px and below</td>
              <td class="muted" colspan="2">{{_i}}Fluid columns, no fixed widths{{/i}}</td>
            </tr>
            <tr>
              <td>{{_i}}Portrait tablets{{/i}}</td>
              <td>768px and above</td>
              <td>42px</td>
              <td>20px</td>
            </tr>
            <tr>
              <td>{{_i}}Default{{/i}}</td>
              <td>980px and up</td>
              <td>60px</td>
              <td>20px</td>
            </tr>
            <tr>
              <td>{{_i}}Large display{{/i}}</td>
              <td>1200px and up</td>
              <td>70px</td>
              <td>30px</td>
            </tr>
          </tbody>
        </table>
381
<pre class="prettyprint linenums">
Mark Otto's avatar
Mark Otto committed
382
383
/* {{_i}}Landscape phones and down{{/i}} */
@media (max-width: 480px) { ... }
384

Mark Otto's avatar
Mark Otto committed
385
386
/* {{_i}}Landscape phone to portrait tablet{{/i}} */
@media (max-width: 767px) { ... }
387

Mark Otto's avatar
Mark Otto committed
388
389
/* {{_i}}Portrait tablet to landscape and desktop{{/i}} */
@media (min-width: 768px) and (max-width: 979px) { ... }
390

Mark Otto's avatar
Mark Otto committed
391
392
/* {{_i}}Large desktop{{/i}} */
@media (min-width: 1200px) { ... }
393
</pre>
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
        {{! Responsive utility classes }}
        <h2>{{_i}}Responsive utility classes{{/i}}</h2>
        <p>{{_i}}For faster mobile-friendly development, use these utility classes for showing and hiding content by device. Below is a table of the available classes and their effect on a given media query layout (labeled by device). They can be found in <code>responsive.less</code>.{{/i}}</p>
        <table class="table table-bordered table-striped responsive-utilities">
          <thead>
            <tr>
              <th>{{_i}}Class{{/i}}</th>
              <th>{{_i}}Phones <small>767px and below</small>{{/i}}</th>
              <th>{{_i}}Tablets <small>979px to 768px</small>{{/i}}</th>
              <th>{{_i}}Desktops <small>Default</small>{{/i}}</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <th><code>.visible-phone</code></th>
              <td class="is-visible">{{_i}}Visible{{/i}}</td>
              <td class="is-hidden">{{_i}}Hidden{{/i}}</td>
              <td class="is-hidden">{{_i}}Hidden{{/i}}</td>
            </tr>
            <tr>
              <th><code>.visible-tablet</code></th>
              <td class="is-hidden">{{_i}}Hidden{{/i}}</td>
              <td class="is-visible">{{_i}}Visible{{/i}}</td>
              <td class="is-hidden">{{_i}}Hidden{{/i}}</td>
            </tr>
            <tr>
              <th><code>.visible-desktop</code></th>
              <td class="is-hidden">{{_i}}Hidden{{/i}}</td>
              <td class="is-hidden">{{_i}}Hidden{{/i}}</td>
              <td class="is-visible">{{_i}}Visible{{/i}}</td>
            </tr>
            <tr>
              <th><code>.hidden-phone</code></th>
              <td class="is-hidden">{{_i}}Hidden{{/i}}</td>
              <td class="is-visible">{{_i}}Visible{{/i}}</td>
              <td class="is-visible">{{_i}}Visible{{/i}}</td>
            </tr>
            <tr>
              <th><code>.hidden-tablet</code></th>
              <td class="is-visible">{{_i}}Visible{{/i}}</td>
              <td class="is-hidden">{{_i}}Hidden{{/i}}</td>
              <td class="is-visible">{{_i}}Visible{{/i}}</td>
            </tr>
            <tr>
              <th><code>.hidden-desktop</code></th>
              <td class="is-visible">{{_i}}Visible{{/i}}</td>
              <td class="is-visible">{{_i}}Visible{{/i}}</td>
              <td class="is-hidden">{{_i}}Hidden{{/i}}</td>
            </tr>
          </tbody>
        </table>

        <h3>{{_i}}When to use{{/i}}</h3>
        <p>{{_i}}Use on a limited basis and avoid creating entirely different versions of the same site. Instead, use them to complement each device's presentation.{{/i}}</p>

        <h3>{{_i}}Responsive utilities test case{{/i}}</h3>
        <p>{{_i}}Resize your browser or load on different devices to test the above classes.{{/i}}</p>
        <h4>{{_i}}Visible on...{{/i}}</h4>
        <p>{{_i}}Green checkmarks indicate that class is visible in your current viewport.{{/i}}</p>
        <ul class="responsive-utilities-test">
          <li>{{_i}}Phone{{/i}}<span class="visible-phone">&#10004; {{_i}}Phone{{/i}}</span></li>
          <li>{{_i}}Tablet{{/i}}<span class="visible-tablet">&#10004; {{_i}}Tablet{{/i}}</span></li>
          <li>{{_i}}Desktop{{/i}}<span class="visible-desktop">&#10004; {{_i}}Desktop{{/i}}</span></li>
        </ul>
        <h4>{{_i}}Hidden on...{{/i}}</h4>
        <p>{{_i}}Here, green checkmarks indicate that class is hidden in your current viewport.{{/i}}</p>
        <ul class="responsive-utilities-test hidden-on">
          <li>{{_i}}Phone{{/i}}<span class="hidden-phone">&#10004; {{_i}}Phone{{/i}}</span></li>
          <li>{{_i}}Tablet{{/i}}<span class="hidden-tablet">&#10004; {{_i}}Tablet{{/i}}</span></li>
          <li>{{_i}}Desktop{{/i}}<span class="hidden-desktop">&#10004; {{_i}}Desktop{{/i}}</span></li>
        </ul>

      </section>



    </div>{{! /span9 }}
  </div>{{! row}}

</div>{{! /container }}