scaffolding.mustache 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. <!-- Masthead
  2. ================================================== -->
  3. <header class="jumbotron subhead" id="overview">
  4. <h1>{{_i}}Scaffolding{{/i}}</h1>
  5. <p class="lead">{{_i}}Bootstrap is built on a responsive 12-column grid. We've also included fixed- and fluid-width layouts based on that system.{{/i}}</p>
  6. <div class="subnav">
  7. <ul class="nav nav-pills">
  8. <li><a href="#grid-system">{{_i}}Grid system{{/i}}</a></li>
  9. <li><a href="#layouts">{{_i}}Layouts{{/i}}</a></li>
  10. <li><a href="#responsive">{{_i}}Responsive design{{/i}}</a></li>
  11. </ul>
  12. </div>
  13. </header>
  14. <!-- Grid system
  15. ================================================== -->
  16. <section id="grid-system">
  17. <div class="page-header">
  18. <h1>{{_i}}Grid system <small>12 columns with a responsive twist</small>{{/i}}</h1>
  19. </div>
  20. <h2>{{_i}}Default grid{{/i}}</h2>
  21. <div class="row show-grid">
  22. <div class="span1">1</div>
  23. <div class="span1">1</div>
  24. <div class="span1">1</div>
  25. <div class="span1">1</div>
  26. <div class="span1">1</div>
  27. <div class="span1">1</div>
  28. <div class="span1">1</div>
  29. <div class="span1">1</div>
  30. <div class="span1">1</div>
  31. <div class="span1">1</div>
  32. <div class="span1">1</div>
  33. <div class="span1">1</div>
  34. </div>
  35. <div class="row show-grid">
  36. <div class="span4">4</div>
  37. <div class="span4">4</div>
  38. <div class="span4">4</div>
  39. </div>
  40. <div class="row show-grid">
  41. <div class="span4">4</div>
  42. <div class="span8">8</div>
  43. </div>
  44. <div class="row show-grid">
  45. <div class="span6">6</div>
  46. <div class="span6">6</div>
  47. </div>
  48. <div class="row show-grid">
  49. <div class="span12">12</div>
  50. </div>
  51. <div class="row">
  52. <div class="span4">
  53. <p>{{_i}}The default grid system provided as part of Bootstrap is a <strong>940px-wide, 12-column grid</strong>.{{/i}}</p>
  54. <p>{{_i}}It also has four responsive variations for various devices and resolutions: phone, tablet portrait, table landscape and small desktops, and large widescreen desktops.{{/i}}</p>
  55. </div>
  56. <div class="span4">
  57. <pre class="prettyprint linenums">
  58. &lt;div class="row"&gt;
  59. &lt;div class="span4"&gt;...&lt;/div&gt;
  60. &lt;div class="span8"&gt;...&lt;/div&gt;
  61. &lt;/div&gt;
  62. </pre>
  63. </div>
  64. <div class="span4">
  65. <p>{{_i}}As shown here, a basic layout can be created with two "columns," each spanning a number of the 12 foundational columns we defined as part of our grid system.{{/i}}</p>
  66. </div>
  67. </div><!-- /row -->
  68. <br>
  69. <h2>{{_i}}Offsetting columns{{/i}}</h2>
  70. <div class="row show-grid">
  71. <div class="span4">4</div>
  72. <div class="span4 offset4">4 offset 4</div>
  73. </div><!-- /row -->
  74. <div class="row show-grid">
  75. <div class="span3 offset3">3 offset 3</div>
  76. <div class="span3 offset3">3 offset 3</div>
  77. </div><!-- /row -->
  78. <div class="row show-grid">
  79. <div class="span8 offset4">8 offset 4</div>
  80. </div><!-- /row -->
  81. <pre class="prettyprint linenums">
  82. &lt;div class="row"&gt;
  83. &lt;div class="span4"&gt;...&lt;/div&gt;
  84. &lt;div class="span4 offset4"&gt;...&lt;/div&gt;
  85. &lt;/div&gt;
  86. </pre>
  87. <br>
  88. <h2>{{_i}}Nesting columns{{/i}}</h2>
  89. <div class="row">
  90. <div class="span6">
  91. <p>{{_i}}With the static (non-fluid) grid system in Bootstrap, nesting is easy. To nest your content, just add a new <code>.row</code> and set of <code>.span*</code> columns within an existing <code>.span*</code> column.{{/i}}</p>
  92. <h4>{{_i}}Example{{/i}}</h4>
  93. <div class="row show-grid">
  94. <div class="span6">
  95. {{_i}}Level 1 of column{{/i}}
  96. <div class="row show-grid">
  97. <div class="span3">
  98. {{_i}}Level 2{{/i}}
  99. </div>
  100. <div class="span3">
  101. {{_i}}Level 2{{/i}}
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. <div class="span6">
  108. <pre class="prettyprint linenums">
  109. &lt;div class="row"&gt;
  110. &lt;div class="span12"&gt;
  111. {{_i}}Level 1 of column{{/i}}
  112. &lt;div class="row"&gt;
  113. &lt;div class="span6"&gt;{{_i}}Level 2{{/i}}&lt;/div&gt;
  114. &lt;div class="span6"&gt;{{_i}}Level 2{{/i}}&lt;/div&gt;
  115. &lt;/div&gt;
  116. &lt;/div&gt;
  117. &lt;/div&gt;
  118. </pre>
  119. </div>
  120. </div>
  121. <h2>{{_i}}Grid customization{{/i}}</h2>
  122. <table class="table table-bordered table-striped">
  123. <thead>
  124. <tr>
  125. <th>{{_i}}Variable{{/i}}</th>
  126. <th>{{_i}}Default value{{/i}}</th>
  127. <th>{{_i}}Description{{/i}}</th>
  128. </tr>
  129. </thead>
  130. <tbody>
  131. <tr>
  132. <td><code>@gridColumns</code></td>
  133. <td>12</td>
  134. <td>{{_i}}Number of columns{{/i}}</td>
  135. </tr>
  136. <tr>
  137. <td><code>@gridColumnWidth</code></td>
  138. <td>60px</td>
  139. <td>{{_i}}Width of each column{{/i}}</td>
  140. </tr>
  141. <tr>
  142. <td><code>@gridGutterWidth</code></td>
  143. <td>20px</td>
  144. <td>{{_i}}Negative space between columns{{/i}}</td>
  145. </tr>
  146. <tr>
  147. <td><code>@siteWidth</code></td>
  148. <td><em>{{_i}}Computed sum of all columns and gutters{{/i}}</em></td>
  149. <td>{{_i}}Counts number of columns and gutters to set width of the <code>.container-fixed()</code> mixin{{/i}}</td>
  150. </tr>
  151. </tbody>
  152. </table>
  153. <div class="row">
  154. <div class="span4">
  155. <h3>{{_i}}Variables in LESS{{/i}}</h3>
  156. <p>{{_i}}Built into Bootstrap are a handful of variables for customizing the default 940px grid system, documented above. All variables for the grid are stored in variables.less.{{/i}}</p>
  157. </div>
  158. <div class="span4">
  159. <h3>{{_i}}How to customize{{/i}}</h3>
  160. <p>{{_i}}Modifying the grid means changing the three <code>@grid*</code> variables and recompiling Bootstrap. Change the grid variables in variables.less and use one of the <a href="less.html#compiling">four ways documented to recompile</a>. If you're adding more columns, be sure to add the CSS for those in grid.less.{{/i}}</p>
  161. </div>
  162. <div class="span4">
  163. <h3>{{_i}}Staying responsive{{/i}}</h3>
  164. <p>{{_i}}Customization of the grid only works at the default level, the 940px grid. To maintain the responsive aspects of Bootstrap, you'll also have to customize the grids in responsive.less.{{/i}}</p>
  165. </div>
  166. </div><!-- /row -->
  167. </section>
  168. <!-- Layouts (Default and fluid)
  169. ================================================== -->
  170. <section id="layouts">
  171. <div class="page-header">
  172. <h1>{{_i}}Layouts <small>Basic templates to create webpages</small>{{/i}}</h1>
  173. </div>
  174. <div class="row">
  175. <div class="span6">
  176. <h2>{{_i}}Fixed layout{{/i}}</h2>
  177. <p>{{_i}}The default and simple 940px-wide, centered layout for just about any website or page provided by a single <code>&lt;div class="container"&gt;</code>.{{/i}}</p>
  178. <div class="minicon-layout">
  179. <div class="minicon-layout-body"></div>
  180. </div>
  181. <pre class="prettyprint linenums">
  182. &lt;body&gt;
  183. &lt;div class="container"&gt;
  184. ...
  185. &lt;/div&gt;
  186. &lt;/body&gt;
  187. </pre>
  188. </div><!-- /col -->
  189. <div class="span6">
  190. <h2>{{_i}}Fluid layout{{/i}}</h2>
  191. <p>{{_i}}<code>&lt;div class="container-fluid"&gt;</code> gives flexible page structure, min- and max-widths, and a left-hand sidebar. It's great for apps and docs.{{/i}}</p>
  192. <div class="minicon-layout fluid">
  193. <div class="minicon-layout-sidebar"></div>
  194. <div class="minicon-layout-body"></div>
  195. </div>
  196. <pre class="prettyprint linenums">
  197. &lt;div class="container-fluid"&gt;
  198. &lt;div class="row-fluid"&gt;
  199. &lt;div class="span2"&gt;
  200. &lt;!--{{_i}}Sidebar content{{/i}}--&gt;
  201. &lt;/div&gt;
  202. &lt;div class="span10"&gt;
  203. &lt;!--{{_i}}Body content{{/i}}--&gt;
  204. &lt;/div&gt;
  205. &lt;/div&gt;
  206. &lt;/div&gt;
  207. </pre>
  208. </div><!-- /col -->
  209. </div><!-- /row -->
  210. </section>
  211. <!-- Responsive design
  212. ================================================== -->
  213. <section id="responsive">
  214. <div class="page-header">
  215. <h1>{{_i}}Responsive design <small>Media queries for various devices and resolutions</small>{{/i}}</h1>
  216. </div>
  217. <!-- Supported devices -->
  218. <div class="row">
  219. <div class="span4">
  220. <img src="assets/img/responsive-illustrations.png" alt="Responsive devices">
  221. </div>
  222. <div class="span8">
  223. <h2>{{_i}}Supported devices{{/i}}</h2>
  224. <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>
  225. <table class="table table-bordered table-striped">
  226. <thead>
  227. <tr>
  228. <th>{{_i}}Label{{/i}}</th>
  229. <th>{{_i}}Layout width{{/i}}</th>
  230. <th>{{_i}}Column width{{/i}}</th>
  231. <th>{{_i}}Gutter width{{/i}}</th>
  232. </tr>
  233. </thead>
  234. <tbody>
  235. <tr>
  236. <td>{{_i}}Smartphones{{/i}}</td>
  237. <td>480px and below</td>
  238. <td class="muted" colspan="2">{{_i}}Fluid columns, no fixed widths{{/i}}</td>
  239. </tr>
  240. <tr>
  241. <td>{{_i}}Portrait tablets{{/i}}</td>
  242. <td>480px to 768px</td>
  243. <td class="muted" colspan="2">{{_i}}Fluid columns, no fixed widths{{/i}}</td>
  244. </tr>
  245. <tr>
  246. <td>{{_i}}Landscape tablets{{/i}}</td>
  247. <td>768px to 980px</td>
  248. <td>42px</td>
  249. <td>20px</td>
  250. </tr>
  251. <tr>
  252. <td>{{_i}}Default{{/i}}</td>
  253. <td>980px and up</td>
  254. <td>60px</td>
  255. <td>20px</td>
  256. </tr>
  257. <tr>
  258. <td>{{_i}}Large display{{/i}}</td>
  259. <td>1210px and up</td>
  260. <td>70px</td>
  261. <td>30px</td>
  262. </tr>
  263. </tbody>
  264. </table>
  265. <h3>{{_i}}Requires meta tag{{/i}}</h3>
  266. <p>{{_i}}To ensure devices display responsive pages properly, include the viewport meta tag.{{/i}}</p>
  267. <pre class="prettyprint linenums">&lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;</pre>
  268. <h3>{{_i}}What they do{{/i}}</h3>
  269. <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>
  270. <ul>
  271. <li>{{_i}}Modify the width of column in our grid{{/i}}</li>
  272. <li>{{_i}}Stack elements instead of float wherever necessary{{/i}}</li>
  273. <li>{{_i}}Resize headings and text to be more appropriate for devices{{/i}}</li>
  274. </ul>
  275. </div>
  276. </div>
  277. <br>
  278. <!-- Media query code -->
  279. <h2>{{_i}}Using the media queries{{/i}}</h2>
  280. <div class="row">
  281. <div class="span5">
  282. <p>{{_i}}Bootstrap doesn't automatically include these media queries, but understanding and adding them is very easy and requires minimal setup. You have a few options for including the responsive features of Bootstrap:{{/i}}</p>
  283. <ol>
  284. <li>{{_i}}Use the compiled responsive version, bootstrap-responsive.css{{/i}}</li>
  285. <li>{{_i}}Add @import "responsive.less" and recompile Bootstrap{{/i}}</li>
  286. <li>{{_i}}Modify and recompile responsive.less as a separate file{{/i}}</li>
  287. </ol>
  288. <p>{{_i}}<strong>Why not just include it?</strong> Truth be told, not everything needs to be responsive. Instead of encouraging developers to remove this feature, we figure it best to enable it.{{/i}}</p>
  289. </div>
  290. <div class="span7">
  291. <pre class="prettyprint linenums">
  292. // {{_i}}Landscape phones and down{{/i}}
  293. @media (max-width: 480px) { ... }
  294. // {{_i}}Landscape phone to portrait tablet{{/i}}
  295. @media (max-width: 768px) { ... }
  296. // {{_i}}Portrait tablet to landscape and desktop{{/i}}
  297. @media (min-width: 768px) and (max-width: 980px) { ... }
  298. // {{_i}}Large desktop{{/i}}
  299. @media (min-width: 1200px) { .. }
  300. </pre>
  301. </div>
  302. </div>
  303. </section>