2 ================================================== -->
3 <header class="jumbotron subhead" id="overview">
4 <div class="container">
5 <h1>{{_i}}Extending Bootstrap{{/i}}</h1>
6 <p class="lead">{{_i}}Extend Bootstrap to take advantage of included styles and components, as well as LESS variables and mixins.{{/i}}</p>
10 <div class="container">
13 ================================================== -->
15 <div class="span3 bs-docs-sidebar">
16 <ul class="nav nav-list bs-docs-sidenav">
17 <li><a href="#built-with-less"><i class="icon-chevron-right"></i> {{_i}}Built with LESS{{/i}}</a></li>
18 <li><a href="#compiling"><i class="icon-chevron-right"></i> {{_i}}Compiling Bootstrap{{/i}}</a></li>
19 <li><a href="#static-assets"><i class="icon-chevron-right"></i> {{_i}}Use as static assets{{/i}}</a></li>
27 ================================================== -->
28 <section id="built-with-less">
29 <div class="page-header">
30 <h1>{{_i}}Built with LESS{{/i}}</h1>
33 <img style="float: right; height: 36px; margin: 10px 20px 20px" src="assets/img/less-logo-large.png" alt="LESS CSS">
34 <p class="lead">{{_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>
36 <h3>{{_i}}Why LESS?{{/i}}</h3>
37 <p>{{_i}}One of Bootstrap's creators wrote a quick <a href="http://www.wordsbyf.at/2012/03/08/why-less/">blog post about this</a>, summarized here:{{/i}}</p>
39 <li>{{_i}}Bootstrap compiles faster ~6x faster with Less compared to Sass{{/i}}</li>
40 <li>{{_i}}Less is written in JavaScript, making it easier to us to dive in and patch compared to Ruby with Sass.{{/i}}</li>
41 <li>{{_i}}Less is more; we want to feel like we're writing CSS and making Bootstrap approachable to all.{{/i}}</li>
44 <h3>{{_i}}What's included?{{/i}}</h3>
45 <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>
47 <h3>{{_i}}Learn more{{/i}}</h3>
48 <p>{{_i}}Visit the official website at <a href="http://lesscss.org">http://lesscss.org</a> to learn more.{{/i}}</p>
53 <!-- COMPILING LESS AND BOOTSTRAP
54 ================================================== -->
55 <section id="compiling">
56 <div class="page-header">
57 <h1>{{_i}}Compiling Bootstrap with Less{{/i}}</h1>
60 <p class="lead">{{_i}}Since our CSS is written with Less and utilizes variables and mixins, it needs to be compiled for final production implementation. Here's how.{{/i}}</p>
62 <div class="alert alert-info">
63 {{_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}}
66 <h2>{{_i}}Tools for compiling{{/i}}</h2>
68 <h3>{{_i}}Command line{{/i}}</h3>
69 <p>{{_i}}Follow <a href="https://github.com/twbs/bootstrap#developers">the instructions in the project readme</a> on GitHub for compiling via command line.{{/i}}</p>
71 <h3>{{_i}}JavaScript{{/i}}</h3>
72 <p>{{_i}}<a href="http://lesscss.org/">Download the latest Less.js</a> and include the path to it (and Bootstrap) in the <code><head></code>.{{/i}}</p>
73 <pre class="prettyprint">
74 <link rel="stylesheet/less" href="/path/to/bootstrap.less">
75 <script src="/path/to/less.js"></script>
77 <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>
79 <h3>{{_i}}Unofficial Mac app{{/i}}</h3>
80 <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. If you like, you can toggle preferences in the app for automatic minifying and which directory the compiled files end up in.{{/i}}</p>
82 <h3>{{_i}}More apps{{/i}}</h3>
83 <h4><a href="http://crunchapp.net/" target="_blank">Crunch</a></h4>
84 <p>{{_i}}Crunch is a great looking LESS editor and compiler built on Adobe Air.{{/i}}</p>
85 <h4><a href="http://incident57.com/codekit/" target="_blank">CodeKit</a></h4>
86 <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>
87 <h4><a href="http://wearekiss.com/simpless" target="_blank">Simpless</a></h4>
88 <p>{{_i}}Mac, Linux, and Windows 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>
95 ================================================== -->
96 <section id="static-assets">
97 <div class="page-header">
98 <h1>{{_i}}Use as static assets{{/i}}</h1>
100 <p class="lead">{{_i}}<a href="./getting-started.html">Quickly start</a> any web project by dropping in the compiled or minified CSS and JS. Layer on custom styles separately for easy upgrades and maintenance moving forward.{{/i}}</p>
102 <h3>{{_i}}Setup file structure{{/i}}</h3>
103 <p>{{_i}}Download the latest compiled Bootstrap and place into your project. For example, you might have something like this:{{/i}}</p>
105 <span class="icon-folder-open"></span> app/
106 <span class="icon-folder-open"></span> layouts/
107 <span class="icon-folder-open"></span> templates/
108 <span class="icon-folder-open"></span> public/
109 <span class="icon-folder-open"></span> css/
110 <span class="icon-file"></span> bootstrap.min.css
111 <span class="icon-folder-open"></span> js/
112 <span class="icon-file"></span> bootstrap.min.js
113 <span class="icon-folder-open"></span> img/
114 <span class="icon-file"></span> glyphicons-halflings.png
115 <span class="icon-file"></span> glyphicons-halflings-white.png
118 <h3>{{_i}}Utilize starter template{{/i}}</h3>
119 <p>{{_i}}Copy the following base HTML to get started.{{/i}}</p>
120 <pre class="prettyprint linenums">
123 <title>Bootstrap 101 Template</title>
124 <!-- Bootstrap -->
125 <link href="public/css/bootstrap.min.css" rel="stylesheet">
128 <h1>Hello, world!</h1>
129 <!-- Bootstrap -->
130 <script src="public/js/bootstrap.min.js"></script>
135 <h3>{{_i}}Layer on custom code{{/i}}</h3>
136 <p>{{_i}}Work in your custom CSS, JS, and more as necessary to make Bootstrap your own with your own separate CSS and JS files.{{/i}}</p>
137 <pre class="prettyprint linenums">
140 <title>Bootstrap 101 Template</title>
141 <!-- Bootstrap -->
142 <link href="public/css/bootstrap.min.css" rel="stylesheet">
143 <!-- Project -->
144 <link href="public/css/application.css" rel="stylesheet">
147 <h1>Hello, world!</h1>
148 <!-- Bootstrap -->
149 <script src="public/js/bootstrap.min.js"></script>
150 <!-- Project -->
151 <script src="public/js/application.js"></script>
161 </div>{{! /.container }}