less.mustache 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  1. <!-- Masthead
  2. ================================================== -->
  3. <header class="jumbotron subhead" id="overview">
  4. <h1>{{_i}}Using LESS with Bootstrap{{/i}}</h1>
  5. <p class="lead">{{_i}}Customize and extend Bootstrap with <a href="http://lesscss.org" target="_blank">LESS</a>, a CSS preprocessor, to take advantage of the variables, mixins, and more used to build Bootstrap's CSS.{{/i}}</p>
  6. <div class="subnav">
  7. <ul class="nav nav-pills">
  8. <li><a href="#builtWith">{{_i}}Built with Less{{/i}}</a></li>
  9. <li><a href="#variables">{{_i}}Variables{{/i}}</a></li>
  10. <li><a href="#mixins">{{_i}}Mixins{{/i}}</a></li>
  11. <li><a href="#compiling">{{_i}}Compiling Bootstrap{{/i}}</a></li>
  12. </ul>
  13. </div>
  14. </header>
  15. <!-- BUILT WITH LESS
  16. ================================================== -->
  17. <section id="builtWith">
  18. <div class="page-header">
  19. <h1>{{_i}}Built with LESS{{/i}}</h1>
  20. </div>
  21. <div class="row">
  22. <div class="span4">
  23. <h3>{{_i}}Why LESS?{{/i}}</h3>
  24. <p>{{_i}}Bootstrap is made with LESS at its core, a dynamic stylesheet language created by our good friend, <a href="http://cloudhead.io">Alexis Sellier</a>. It makes developing systems-based CSS faster, easier, and more fun.{{/i}}</p>
  25. </div>
  26. <div class="span4">
  27. <h3>{{_i}}What's included?{{/i}}</h3>
  28. <p>{{_i}}As an extension of CSS, LESS includes variables, mixins for reusable snippets of code, operations for simple math, nesting, and even color functions.{{/i}}</p>
  29. </div>
  30. <div class="span4">
  31. <h3>{{_i}}Learn more{{/i}}</h3>
  32. <img style="float: right; height: 36px;" src="assets/img/less-logo-large.png" alt="LESS CSS">
  33. <p>{{_i}}Visit the official website at <a href="http://lesscss.org">http://lesscss.org</a> to learn more.{{/i}}</p>
  34. </div>
  35. </div>
  36. <div class="row">
  37. <div class="span4">
  38. <h3><a href="#variables">{{_i}}Variables{{/i}}</a></h3>
  39. <p>{{_i}}Managing colors and pixel values in CSS can be a bit of a pain, usually full of copy and paste. Not with LESS though&mdash;assign colors or pixel values as variables and change them once.{{/i}}</p>
  40. </div>
  41. <div class="span4">
  42. <h3><a href="#mixins">{{_i}}Mixins{{/i}}</a></h3>
  43. <p>{{_i}}Those three border-radius declarations you need to make in regular ol' CSS? Now they're down to one line with the help of mixins, snippets of code you can reuse anywhere.{{/i}}</p>
  44. </div>
  45. <div class="span4">
  46. <h3>{{_i}}Operations{{/i}}</h3>
  47. <p>{{_i}}Make your grid, leading, and more super flexible by doing the math on the fly with operations. Multiply, divide, add, and subtract your way to CSS sanity.{{/i}}</p>
  48. </div>
  49. </div>
  50. </section>
  51. <!-- VARIABLES
  52. ================================================== -->
  53. <section id="variables">
  54. <div class="page-header">
  55. <h1>{{_i}}Bootstrap variables <small>LESS variables, their values, and usage guidelines</small>{{/i}}</h1>
  56. </div>
  57. <div class="row">
  58. <div class="span6">
  59. <h3>{{_i}}Hyperlinks{{/i}}</h3>
  60. <table class="table table-bordered table-striped">
  61. <tbody>
  62. <tr>
  63. <td class="span2"><code>@linkColor</code></td>
  64. <td>#08c</td>
  65. <td>{{_i}}Default link text color{{/i}}</td>
  66. <td class="swatch-col"><span class="swatch" style="background-color: #08c;"></span></td>
  67. </tr>
  68. <tr>
  69. <td><code>@linkColorHover</code></td>
  70. <td><code>darken(@linkColor, 15%)</code></td>
  71. <td>{{_i}}Default link text hover color{{/i}}</td>
  72. <td><span class="swatch" style="background-color: #005580;"></span></td>
  73. </tr>
  74. </tbody>
  75. </table>
  76. <h3>{{_i}}Grid system{{/i}}</h3>
  77. <table class="table table-bordered table-striped">
  78. <tbody>
  79. <tr>
  80. <td class="span2"><code>@gridColumns</code></td>
  81. <td>12</td>
  82. </tr>
  83. <tr>
  84. <td><code>@gridColumnWidth</code></td>
  85. <td>60px</td>
  86. </tr>
  87. <tr>
  88. <td><code>@gridGutterWidth</code></td>
  89. <td>20px</td>
  90. </tr>
  91. <tr>
  92. <td><code>@fluidGridColumnWidth</code></td>
  93. <td>6.382978723%</td>
  94. </tr>
  95. <tr>
  96. <td><code>@fluidGridGutterWidth</code></td>
  97. <td>2.127659574%</td>
  98. </tr>
  99. </tbody>
  100. </table>
  101. <h3>{{_i}}Typography{{/i}}</h3>
  102. <table class="table table-bordered table-striped">
  103. <tbody>
  104. <tr>
  105. <td class="span2"><code>@baseFontSize</code></td>
  106. <td>13px</td>
  107. </tr>
  108. <tr>
  109. <td><code>@baseFontFamily</code></td>
  110. <td><code>"Helvetica Neue", Helvetica, Arial, sans-serif</code></td>
  111. </tr>
  112. <tr>
  113. <td><code>@baseLineHeight</code></td>
  114. <td>18px</td>
  115. </tr>
  116. </tbody>
  117. </table>
  118. </div>
  119. <div class="span6">
  120. <h3>{{_i}}Grayscale colors{{/i}}</h3>
  121. <table class="table table-bordered table-striped">
  122. <tbody>
  123. <tr>
  124. <td class="span2"><code>@black</code></td>
  125. <td>#000</td>
  126. <td class="swatch-col"><span class="swatch" style="background-color: #000;"></span></td>
  127. </tr>
  128. <tr>
  129. <td><code>@grayDarker</code></td>
  130. <td>#222</td>
  131. <td><span class="swatch" style="background-color: #222;"></span></td>
  132. </tr>
  133. <tr>
  134. <td><code>@grayDark</code></td>
  135. <td>#333</td>
  136. <td><span class="swatch" style="background-color: #333;"></span></td>
  137. </tr>
  138. <tr>
  139. <td><code>@gray</code></td>
  140. <td>#555</td>
  141. <td><span class="swatch" style="background-color: #555;"></span></td>
  142. </tr>
  143. <tr>
  144. <td><code>@grayLight</code></td>
  145. <td>#999</td>
  146. <td><span class="swatch" style="background-color: #999;"></span></td>
  147. </tr>
  148. <tr>
  149. <td><code>@grayLighter</code></td>
  150. <td>#eee</td>
  151. <td><span class="swatch" style="background-color: #eee;"></span></td>
  152. </tr>
  153. <tr>
  154. <td><code>@white</code></td>
  155. <td>#fff</td>
  156. <td><span class="swatch swatch-bordered" style="background-color: #fff;"></span></td>
  157. </tr>
  158. </tbody>
  159. </table>
  160. <h3>{{_i}}Accent colors{{/i}}</h3>
  161. <table class="table table-bordered table-striped">
  162. <tbody>
  163. <tr>
  164. <td class="span2"><code>@blue</code></td>
  165. <td>#049cdb</td>
  166. <td class="swatch-col"><span class="swatch" style="background-color: #049cdb;"></span></td>
  167. </tr>
  168. <tr>
  169. <td><code>@green</code></td>
  170. <td>#46a546</td>
  171. <td><span class="swatch" style="background-color: #46a546;"></span></td>
  172. </tr>
  173. <tr>
  174. <td><code>@red</code></td>
  175. <td>#9d261d</td>
  176. <td><span class="swatch" style="background-color: #9d261d;"></span></td>
  177. </tr>
  178. <tr>
  179. <td><code>@yellow</code></td>
  180. <td>#ffc40d</td>
  181. <td><span class="swatch" style="background-color: #ffc40d;"></span></td>
  182. </tr>
  183. <tr>
  184. <td><code>@orange</code></td>
  185. <td>#f89406</td>
  186. <td><span class="swatch" style="background-color: #f89406;"></span></td>
  187. </tr>
  188. <tr>
  189. <td><code>@pink</code></td>
  190. <td>#c3325f</td>
  191. <td><span class="swatch" style="background-color: #c3325f;"></span></td>
  192. </tr>
  193. <tr>
  194. <td><code>@purple</code></td>
  195. <td>#7a43b6</td>
  196. <td><span class="swatch" style="background-color: #7a43b6;"></span></td>
  197. </tr>
  198. </tbody>
  199. </table>
  200. </div>
  201. </div> <!-- /row -->
  202. <h3>{{_i}}Components{{/i}}</h3>
  203. <div class="row">
  204. <div class="span6">
  205. <h4>{{_i}}Buttons{{/i}}</h4>
  206. <table class="table table-bordered table-striped">
  207. <tbody>
  208. <tr>
  209. <td class="span3"><code>@primaryButtonBackground</code></td>
  210. <td><code>@linkColor</code></td>
  211. <td class="swatch-col"><span class="swatch" style="background-color: #08c;"></span></td>
  212. </tr>
  213. </tbody>
  214. </table>
  215. <h4>{{_i}}Forms{{/i}}</h4>
  216. <table class="table table-bordered table-striped">
  217. <tbody>
  218. <tr>
  219. <td class="span3"><code>@placeholderText</code></td>
  220. <td><code>@grayLight</code></td>
  221. <td class="swatch-col"><span class="swatch" style="background-color: #999;"></span></td>
  222. </tr>
  223. </tbody>
  224. </table>
  225. <h4>{{_i}}Navbar{{/i}}</h4>
  226. <table class="table table-bordered table-striped">
  227. <tbody>
  228. <tr>
  229. <td class="span3"><code>@navbarHeight</code></td>
  230. <td>40px</td>
  231. <td class="swatch-col"></td>
  232. </tr>
  233. <tr>
  234. <td><code>@navbarBackground</code></td>
  235. <td><code>@grayDarker</code></td>
  236. <td><span class="swatch" style="background-color: #222;"></span></td>
  237. </tr>
  238. <tr>
  239. <td><code>@navbarBackgroundHighlight</code></td>
  240. <td><code>@grayDark</code></td>
  241. <td><span class="swatch" style="background-color: #333;"></span></td>
  242. </tr>
  243. <tr>
  244. <td><code>@navbarText</code></td>
  245. <td><code>@grayLight</code></td>
  246. <td><span class="swatch" style="background-color: #999;"></span></td>
  247. </tr>
  248. <tr>
  249. <td><code>@navbarLinkColor</code></td>
  250. <td><code>@grayLight</code></td>
  251. <td><span class="swatch" style="background-color: #999;"></span></td>
  252. </tr>
  253. <tr>
  254. <td><code>@navbarLinkColorHover</code></td>
  255. <td><code>@white</code></td>
  256. <td><span class="swatch swatch-bordered" style="background-color: #fff;"></span></td>
  257. </tr>
  258. </tbody>
  259. </table>
  260. </div>
  261. <div class="span6">
  262. <h4>{{_i}}Form states and alerts{{/i}}</h4>
  263. <table class="table table-bordered table-striped">
  264. <tbody>
  265. <tr>
  266. <td class="span3"><code>@warningText</code></td>
  267. <td>#c09853</td>
  268. <td><span class="swatch" style="background-color: #c09853;"></span></td>
  269. </tr>
  270. <tr>
  271. <td><code>@warningBackground</code></td>
  272. <td>#f3edd2</td>
  273. <td class="swatch-col"><span class="swatch" style="background-color: #f3edd2;"></span></td>
  274. </tr>
  275. <tr>
  276. <td><code>@errorText</code></td>
  277. <td>#b94a48</td>
  278. <td><span class="swatch" style="background-color: #b94a48;"></span></td>
  279. </tr>
  280. <tr>
  281. <td><code>@errorBackground</code></td>
  282. <td>#f2dede</td>
  283. <td><span class="swatch" style="background-color: #f2dede;"></span></td>
  284. </tr>
  285. <tr>
  286. <td><code>@successText</code></td>
  287. <td>#468847</td>
  288. <td><span class="swatch" style="background-color: #468847;"></span></td>
  289. </tr>
  290. <tr>
  291. <td><code>@successBackground</code></td>
  292. <td>#dff0d8</td>
  293. <td><span class="swatch" style="background-color: #dff0d8;"></span></td>
  294. </tr>
  295. <tr>
  296. <td><code>@infoText</code></td>
  297. <td>#3a87ad</td>
  298. <td><span class="swatch" style="background-color: #3a87ad;"></span></td>
  299. </tr>
  300. <tr>
  301. <td><code>@infoBackground</code></td>
  302. <td>#d9edf7</td>
  303. <td><span class="swatch" style="background-color: #d9edf7;"></span></td>
  304. </tr>
  305. </tbody>
  306. </table>
  307. </div>
  308. </div><!-- /row -->
  309. </section>
  310. <!-- MIXINS
  311. ================================================== -->
  312. <section id="mixins">
  313. <div class="page-header">
  314. <h1>{{_i}}Bootstrap mixins <small></small>{{/i}}</h1>
  315. </div>
  316. <h2>{{_i}}About mixins{{/i}}</h2>
  317. <div class="row">
  318. <div class="span4">
  319. <h3>{{_i}}Basic mixins{{/i}}</h3>
  320. <p>{{_i}}A basic mixin is essentially an include or a partial for a snippet of CSS. They're written just like a CSS class and can be called anywhere.{{/i}}</p>
  321. <pre class="prettyprint linenums">
  322. .element {
  323. .clearfix();
  324. }
  325. </pre>
  326. </div><!-- /span4 -->
  327. <div class="span4">
  328. <h3>{{_i}}Parametric mixins{{/i}}</h3>
  329. <p>{{_i}}A parametric mixin is just like a basic mixin, but it also accepts parameters (hence the name) with optional default values.{{/i}}</p>
  330. <pre class="prettyprint linenums">
  331. .element {
  332. .border-radius(4px);
  333. }
  334. </pre>
  335. </div><!-- /span4 -->
  336. <div class="span4">
  337. <h3>{{_i}}Easily add your own{{/i}}</h3>
  338. <p>{{_i}}Nearly all of Bootstrap's mixins are stored in mixins.less, a wonderful utility .less file that enables you to use a mixin in any of the .less files in the toolkit.{{/i}}</p>
  339. <p>{{_i}}So, go ahead and use the existing ones or feel free to add your own as you need.{{/i}}</p>
  340. </div><!-- /span4 -->
  341. </div><!-- /row -->
  342. <h2>{{_i}}Included mixins{{/i}}</h2>
  343. <h3>{{_i}}Utilities{{/i}}</h3>
  344. <table class="table table-bordered table-striped">
  345. <thead>
  346. <tr>
  347. <th class="span4">{{_i}}Mixin{{/i}}</th>
  348. <th>{{_i}}Parameters{{/i}}</th>
  349. <th>{{_i}}Usage{{/i}}</th>
  350. </tr>
  351. </thead>
  352. <tbody>
  353. <tr>
  354. <td><code>.clearfix()</code></td>
  355. <td><em class="muted">none</em></td>
  356. <td>{{_i}}Add to any parent to clear floats within{{/i}}</td>
  357. </tr>
  358. <tr>
  359. <td><code>.tab-focus()</code></td>
  360. <td><em class="muted">none</em></td>
  361. <td>{{_i}}Apply the Webkit focus style and round Firefox outline{{/i}}</td>
  362. </tr>
  363. <tr>
  364. <td><code>.center-block()</code></td>
  365. <td><em class="muted">none</em></td>
  366. <td>{{_i}}Auto center a block-level element using <code>margin: auto</code>{{/i}}</td>
  367. </tr>
  368. <tr>
  369. <td><code>.ie7-inline-block()</code></td>
  370. <td><em class="muted">none</em></td>
  371. <td>{{_i}}Use in addition to regular <code>display: inline-block</code> to get IE7 support{{/i}}</td>
  372. </tr>
  373. <tr>
  374. <td><code>.size()</code></td>
  375. <td><code>@height: 5px, @width: 5px</code></td>
  376. <td>{{_i}}Quickly set the height and width on one line{{/i}}</td>
  377. </tr>
  378. <tr>
  379. <td><code>.square()</code></td>
  380. <td><code>@size: 5px</code></td>
  381. <td>{{_i}}Builds on <code>.size()</code> to set the width and height as same value{{/i}}</td>
  382. </tr>
  383. <tr>
  384. <td><code>.opacity()</code></td>
  385. <td><code>@opacity: 100</code></td>
  386. <td>{{_i}}Set, in whole numbers, the opacity percentage (e.g., "50" or "75"){{/i}}</td>
  387. </tr>
  388. </tbody>
  389. </table>
  390. <h3>Forms</h3>
  391. <table class="table table-bordered table-striped">
  392. <thead>
  393. <tr>
  394. <th class="span4">{{_i}}Mixin{{/i}}</th>
  395. <th>{{_i}}Parameters{{/i}}</th>
  396. <th>{{_i}}Usage{{/i}}</th>
  397. </tr>
  398. </thead>
  399. <tbody>
  400. <tr>
  401. <td><code>.placeholder()</code></td>
  402. <td><code>@color: @placeholderText</code></td>
  403. <td>{{_i}}Set the <code>placeholder</code> text color for inputs{{/i}}</td>
  404. </tr>
  405. </tbody>
  406. </table>
  407. <h3>Typography</h3>
  408. <table class="table table-bordered table-striped">
  409. <thead>
  410. <tr>
  411. <th class="span4">{{_i}}Mixin{{/i}}</th>
  412. <th>{{_i}}Parameters{{/i}}</th>
  413. <th>{{_i}}Usage{{/i}}</th>
  414. </tr>
  415. </thead>
  416. <tbody>
  417. <tr>
  418. <td><code>#font > #family > .serif()</code></td>
  419. <td><em class="muted">none</em></td>
  420. <td>{{_i}}Make an element use a serif font stack{{/i}}</td>
  421. </tr>
  422. <tr>
  423. <td><code>#font > #family > .sans-serif()</code></td>
  424. <td><em class="muted">none</em></td>
  425. <td>{{_i}}Make an element use a sans-serif font stack{{/i}}</td>
  426. </tr>
  427. <tr>
  428. <td><code>#font > #family > .monospace()</code></td>
  429. <td><em class="muted">none</em></td>
  430. <td>{{_i}}Make an element use a monospace font stack{{/i}}</td>
  431. </tr>
  432. <tr>
  433. <td><code>#font > .shorthand()</code></td>
  434. <td><code>@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight</code></td>
  435. <td>{{_i}}Easily set font size, weight, and leading{{/i}}</td>
  436. </tr>
  437. <tr>
  438. <td><code>#font > .serif()</code></td>
  439. <td><code>@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight</code></td>
  440. <td>{{_i}}Set font family to serif, and control size, weight, and leading{{/i}}</td>
  441. </tr>
  442. <tr>
  443. <td><code>#font > .sans-serif()</code></td>
  444. <td><code>@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight</code></td>
  445. <td>{{_i}}Set font family to sans-serif, and control size, weight, and leading{{/i}}</td>
  446. </tr>
  447. <tr>
  448. <td><code>#font > .monospace()</code></td>
  449. <td><code>@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight</code></td>
  450. <td>{{_i}}Set font family to monospace, and control size, weight, and leading{{/i}}</td>
  451. </tr>
  452. </tbody>
  453. </table>
  454. <h3>Grid system</h3>
  455. <table class="table table-bordered table-striped">
  456. <thead>
  457. <tr>
  458. <th class="span4">{{_i}}Mixin{{/i}}</th>
  459. <th>{{_i}}Parameters{{/i}}</th>
  460. <th>{{_i}}Usage{{/i}}</th>
  461. </tr>
  462. </thead>
  463. <tbody>
  464. <tr>
  465. <td><code>.container-fixed()</code></td>
  466. <td><em class="muted">none</em></td>
  467. <td>{{_i}}Provide a fixed-width (set with <code>@siteWidth</code>) container for holding your content{{/i}}</td>
  468. </tr>
  469. <tr>
  470. <td><code>.columns()</code></td>
  471. <td><code>@columns: 1</code></td>
  472. <td>{{_i}}Build a grid column that spans any number of columns (defaults to 1 column){{/i}}</td>
  473. </tr>
  474. <tr>
  475. <td><code>.offset()</code></td>
  476. <td><code>@columns: 1</code></td>
  477. <td>{{_i}}Offset a grid column with left margin that spans any number of columns{{/i}}</td>
  478. </tr>
  479. <tr>
  480. <td><code>.gridColumn()</code></td>
  481. <td><em class="muted">none</em></td>
  482. <td>{{_i}}Make an element float like a grid column{{/i}}</td>
  483. </tr>
  484. </tbody>
  485. </table>
  486. <h3>{{_i}}CSS3 properties{{/i}}</h3>
  487. <table class="table table-bordered table-striped">
  488. <thead>
  489. <tr>
  490. <th class="span3">{{_i}}Mixin{{/i}}</th>
  491. <th>{{_i}}Parameters{{/i}}</th>
  492. <th>{{_i}}Usage{{/i}}</th>
  493. </tr>
  494. </thead>
  495. <tbody>
  496. <tr>
  497. <td><code>.border-radius()</code></td>
  498. <td><code>@radius: 5px</code></td>
  499. <td>{{_i}}Round the corners of an element. Can be a single value or four space-separated values{{/i}}</td>
  500. </tr>
  501. <tr>
  502. <td><code>.box-shadow()</code></td>
  503. <td><code>@shadow: 0 1px 3px rgba(0,0,0,.25)</code></td>
  504. <td>{{_i}}Add a drop shadow to an element{{/i}}</td>
  505. </tr>
  506. <tr>
  507. <td><code>.transition()</code></td>
  508. <td><code>@transition</code></td>
  509. <td>{{_i}}Add CSS3 transition effect (e.g., <code>all .2s linear</code>){{/i}}</td>
  510. </tr>
  511. <tr>
  512. <td><code>.rotate()</code></td>
  513. <td><code>@degrees</code></td>
  514. <td>{{_i}}Rotate an element <em>n</em> degrees{{/i}}</td>
  515. </tr>
  516. <tr>
  517. <td><code>.scale()</code></td>
  518. <td><code>@ratio</code></td>
  519. <td>{{_i}}Scale an element to <em>n</em> times its original size{{/i}}</td>
  520. </tr>
  521. <tr>
  522. <td><code>.translate()</code></td>
  523. <td><code>@x: 0, @y: 0</code></td>
  524. <td>{{_i}}Move an element on the x and y planes{{/i}}</td>
  525. </tr>
  526. <tr>
  527. <td><code>.background-clip()</code></td>
  528. <td><code>@clip</code></td>
  529. <td>{{_i}}Crop the background of an element (useful for <code>border-radius</code>){{/i}}</td>
  530. </tr>
  531. <tr>
  532. <td><code>.background-size()</code></td>
  533. <td><code>@size</code></td>
  534. <td>{{_i}}Control the size of background images via CSS3{{/i}}</td>
  535. </tr>
  536. <tr>
  537. <td><code>.box-sizing()</code></td>
  538. <td><code>@boxmodel</code></td>
  539. <td>{{_i}}Change the box model for an element (e.g., <code>border-box</code> for a full-width <code>input</code>){{/i}}</td>
  540. </tr>
  541. <tr>
  542. <td><code>.user-select()</code></td>
  543. <td><code>@select</code></td>
  544. <td>{{_i}}Control cursor selection of text on a page{{/i}}</td>
  545. </tr>
  546. <tr>
  547. <td><code>.resizable()</code></td>
  548. <td><code>@direction: both</code></td>
  549. <td>{{_i}}Make any element resizable on the right and bottom{{/i}}</td>
  550. </tr>
  551. <tr>
  552. <td><code>.content-columns()</code></td>
  553. <td><code>@columnCount, @columnGap: @gridColumnGutter</code></td>
  554. <td>{{_i}}Make the content of any element use CSS3 columns{{/i}}</td>
  555. </tr>
  556. </tbody>
  557. </table>
  558. <h3>{{_i}}Backgrounds and gradients{{/i}}</h3>
  559. <table class="table table-bordered table-striped">
  560. <thead>
  561. <tr>
  562. <th class="span4">{{_i}}Mixin{{/i}}</th>
  563. <th>{{_i}}Parameters{{/i}}</th>
  564. <th>{{_i}}Usage{{/i}}</th>
  565. </tr>
  566. </thead>
  567. <tbody>
  568. <tr>
  569. <td><code>.#translucent > .background()</code></td>
  570. <td><code>@color: @white, @alpha: 1</code></td>
  571. <td>{{_i}}Give an element a translucent background color{{/i}}</td>
  572. </tr>
  573. <tr>
  574. <td><code>.#translucent > .border()</code></td>
  575. <td><code>@color: @white, @alpha: 1</code></td>
  576. <td>{{_i}}Give an element a translucent border color{{/i}}</td>
  577. </tr>
  578. <tr>
  579. <td><code>.#gradient > .vertical()</code></td>
  580. <td><code>@startColor, @endColor</code></td>
  581. <td>{{_i}}Create a cross-browser vertical background gradient{{/i}}</td>
  582. </tr>
  583. <tr>
  584. <td><code>.#gradient > .horizontal()</code></td>
  585. <td><code>@startColor, @endColor</code></td>
  586. <td>{{_i}}Create a cross-browser horizontal background gradient{{/i}}</td>
  587. </tr>
  588. <tr>
  589. <td><code>.#gradient > .directional()</code></td>
  590. <td><code>@startColor, @endColor, @deg</code></td>
  591. <td>{{_i}}Create a cross-browser directional background gradient{{/i}}</td>
  592. </tr>
  593. <tr>
  594. <td><code>.#gradient > .vertical-three-colors()</code></td>
  595. <td><code>@startColor, @midColor, @colorStop, @endColor</code></td>
  596. <td>{{_i}}Create a cross-browser three-color background gradient{{/i}}</td>
  597. </tr>
  598. <tr>
  599. <td><code>.#gradient > .radial()</code></td>
  600. <td><code>@innerColor, @outerColor</code></td>
  601. <td>{{_i}}Create a cross-browser radial background gradient{{/i}}</td>
  602. </tr>
  603. <tr>
  604. <td><code>.#gradient > .striped()</code></td>
  605. <td><code>@color, @angle</code></td>
  606. <td>{{_i}}Create a cross-browser striped background gradient{{/i}}</td>
  607. </tr>
  608. <tr>
  609. <td><code>.#gradientBar()</code></td>
  610. <td><code>@primaryColor, @secondaryColor</code></td>
  611. <td>{{_i}}Used for buttons to assign a gradient and slightly darker border{{/i}}</td>
  612. </tr>
  613. </tbody>
  614. </table>
  615. </section>
  616. <!-- COMPILING LESS AND BOOTSTRAP
  617. ================================================== -->
  618. <section id="compiling">
  619. <div class="page-header">
  620. <h1>{{_i}}Compiling Bootstrap with LESS{{/i}}</h1>
  621. </div>
  622. <div class="alert alert-info">
  623. {{_i}}<strong>Note:</strong> If you're submitting a pull request to GitHub with modified CSS, you <strong>must</strong> recompile the CSS via any of these methods.{{/i}}
  624. </div>
  625. <h2>{{_i}}Tools for compiling{{/i}}</h2>
  626. <div class="row">
  627. <div class="span4">
  628. <h3>{{_i}}Node with makefile{{/i}}</h3>
  629. <p>{{_i}}Install the LESS command line compiler globally with npm by running the following command:{{/i}}</p>
  630. <pre>$ npm install -g less</pre>
  631. <p>{{_i}}Once installed just run <code>make</code> from the root of your bootstrap directory and you're all set.{{/i}}</p>
  632. <p>{{_i}}Additionally, if you have <a href="https://github.com/mynyml/watchr">watchr</a> installed, you may run <code>make watch</code> to have bootstrap automatically rebuilt every time you edit a file in the bootstrap lib (this isn't required, just a convenience method).{{/i}}</p>
  633. </div><!-- /span4 -->
  634. <div class="span4">
  635. <h3>{{_i}}Command line{{/i}}</h3>
  636. <p>{{_i}}Install the LESS command line tool via Node and run the following command:{{/i}}</p>
  637. <pre>$ lessc ./lib/bootstrap.less > bootstrap.css</pre>
  638. <p>{{_i}}Be sure to include <code>--compress</code> in that command if you're trying to save some bytes!{{/i}}</p>
  639. </div><!-- /span4 -->
  640. <div class="span4">
  641. <h3>{{_i}}Javascript{{/i}}</h3>
  642. <p>{{_i}}<a href="http://lesscss.org/">Download the latest Less.js</a> and include the path to it (and Bootstrap) in the <code>&lt;head&gt;</code>.{{/i}}</p>
  643. <pre class="prettyprint">
  644. &lt;link rel="stylesheet/less" href="/path/to/bootstrap.less"&gt;
  645. &lt;script src="/path/to/less.js"&gt;&lt;/script&gt;
  646. </pre>
  647. <p>{{_i}}To recompile the .less files, just save them and reload your page. Less.js compiles them and stores them in local storage.{{/i}}</p>
  648. </div><!-- /span4 -->
  649. </div><!-- /row -->
  650. <div class="row">
  651. <div class="span4">
  652. <h3>{{_i}}Unofficial Mac app{{/i}}</h3>
  653. <p>{{_i}}<a href="http://incident57.com/less/">The unofficial Mac app</a> watches directories of .less files and compiles the code to local files after every save of a watched .less file.{{/i}}</p>
  654. <p>{{_i}}If you like, you can toggle preferences in the app for automatic minifying and which directory the compiled files end up in.{{/i}}</p>
  655. </div><!-- /span4 -->
  656. <div class="span4">
  657. <h3>{{_i}}More Mac apps{{/i}}</h3>
  658. <h4><a href="http://crunchapp.net/" target="_blank">Crunch</a></h4>
  659. <p>{{_i}}Crunch is a great looking LESS editor and compiler built on Adobe Air.{{/i}}</p>
  660. <h4><a href="http://incident57.com/codekit/" target="_blank">CodeKit</a></h4>
  661. <p>{{_i}}Created by the same guy as the unofficial Mac app, CodeKit is a Mac app that compiles LESS, SASS, Stylus, and CoffeeScript.{{/i}}</p>
  662. <h4><a href="http://wearekiss.com/simpless" target="_blank">Simpless</a></h4>
  663. <p>{{_i}}Mac, Linux, and PC app for drag and drop compiling of LESS files. Plus, the <a href="https://github.com/Paratron/SimpLESS" target="_blank">source code is on GitHub</a>.{{/i}}</p>
  664. </div><!-- /span4 -->
  665. </div><!-- /row -->
  666. </section>