5 <title>Scaffolding - SugarCRM Patterns and Styleguide</title>
6 <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
7 <meta name="apple-mobile-web-app-capable" content="yes">
8 <meta name="apple-mobile-web-app-status-bar-style" content="black">
9 <meta name="description" content="">
10 <meta name="author" content="">
12 <!-- HTML5 shim, for IE6-8 support of HTML elements -->
14 <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
17 <link href="../../themes/default/css/bootstrap.css" rel="stylesheet">
19 <link href="js/google-code-prettify/prettify.css" rel="stylesheet">
20 <link href="../../themes/default/images/sugar_icon.ico" rel="SHORTCUT ICON">
22 <body data-spy="scroll" data-target=".subnav" data-offset="60">
23 <div class="navbar navbar-fixed-top">
24 <div class="navbar-inner">
25 <div class="container">
26 <a class="cube" href="index.html" rel="tooltip" title="Dashboard"></a>
27 <div class="nav-collapse">
30 <a href="index.html">Overview</a>
33 <a href="scaffolding.html">Scaffolding</a>
36 <a href="base-css.html">Base CSS</a>
39 <a href="components.html">Components</a>
42 <a href="widgets.html">Widgets</a>
45 <a href="less.html">Quick Styles</a>
53 <div class="container">
54 <header class="jumbotron subhead" id="overview">
56 <p class="lead">Bootstrap is built on a responsive 12-column grid. We've also included fixed- and fluid-width layouts based on that system.</p>
58 <ul class="nav nav-pills">
59 <li><a href="#grid-system">Grid system</a></li>
60 <li><a href="#layouts">Layouts</a></li>
61 <li><a href="#responsive">Responsive design</a></li>
65 <section id="grid-system">
66 <div class="page-header">
67 <h1>Grid system <small>12 columns with a responsive twist</small></h1>
69 <h2>Default 940px grid</h2>
70 <div class="row show-grid">
71 <div class="span1">1</div>
72 <div class="span1">1</div>
73 <div class="span1">1</div>
74 <div class="span1">1</div>
75 <div class="span1">1</div>
76 <div class="span1">1</div>
77 <div class="span1">1</div>
78 <div class="span1">1</div>
79 <div class="span1">1</div>
80 <div class="span1">1</div>
81 <div class="span1">1</div>
82 <div class="span1">1</div>
84 <div class="row show-grid">
85 <div class="span4">4</div>
86 <div class="span4">4</div>
87 <div class="span4">4</div>
89 <div class="row show-grid">
90 <div class="span4">4</div>
91 <div class="span8">8</div>
93 <div class="row show-grid">
94 <div class="span6">6</div>
95 <div class="span6">6</div>
97 <div class="row show-grid">
98 <div class="span12">12</div>
102 <p>The default grid system provided as part of Bootstrap is a <strong>940px-wide, 12-column grid</strong>.</p>
103 <p>It also has four responsive variations for various devices and resolutions: phone, tablet portrait, table landscape and small desktops, and large widescreen desktops.</p>
106 <pre class="prettyprint linenums">
107 <div class="row">
108 <div class="span4">...</div>
109 <div class="span8">...</div>
114 <p>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.</p>
120 <h2>Offsetting columns</h2>
121 <div class="row show-grid">
122 <div class="span4">4</div>
123 <div class="span4 offset4">4 offset 4</div>
125 <div class="row show-grid">
126 <div class="span3 offset3">3 offset 3</div>
127 <div class="span3 offset3">3 offset 3</div>
129 <div class="row show-grid">
130 <div class="span8 offset4">8 offset 4</div>
132 <pre class="prettyprint linenums">
133 <div class="row">
134 <div class="span4">...</div>
135 <div class="span4 offset4">...</div>
141 <h2>Nesting columns</h2>
144 <p>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.</p>
146 <div class="row show-grid">
149 <div class="row show-grid">
161 <pre class="prettyprint linenums">
162 <div class="row">
163 <div class="span12">
165 <div class="row">
166 <div class="span6">Level 2</div>
167 <div class="span6">Level 2</div>
175 <h2>Grid customization</h2>
176 <table class="table table-bordered table-striped">
180 <th>Default value</th>
186 <td><code>@gridColumns</code></td>
188 <td>Number of columns</td>
191 <td><code>@gridColumnWidth</code></td>
193 <td>Width of each column</td>
196 <td><code>@gridGutterWidth</code></td>
198 <td>Negative space between columns</td>
201 <td><code>@siteWidth</code></td>
202 <td><em>Computed sum of all columns and gutters</em></td>
203 <td>Counts number of columns and gutters to set width of the <code>.container-fixed()</code> mixin</td>
209 <h3>Variables in LESS</h3>
210 <p>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.</p>
213 <h3>How to customize</h3>
214 <p>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="#compiling">four ways documented to recompile</a>. If you're adding more columns, be sure to add the CSS for those in grid.less.</p>
217 <h3>Staying responsive</h3>
218 <p>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.</p>
223 <section id="layouts">
224 <div class="page-header">
225 <h1>Layouts <small>Basic templates to create webpages</small></h1>
230 <h2>Fixed layout</h2>
231 <p>The default and simple 940px-wide, centered layout for just about any website or page provided by a single <code><div class="container"></code>.</p>
232 <div class="minicon-layout">
233 <div class="minicon-layout-body"></div>
235 <pre class="prettyprint linenums">
237 <div class="container">
244 <h2>Fluid layout</h2>
245 <p><code><div class="container-fluid"></code> gives flexible page structure, min- and max-widths, and a left-hand sidebar. It's great for apps and docs.</p>
246 <div class="minicon-layout fluid">
247 <div class="minicon-layout-sidebar"></div>
248 <div class="minicon-layout-body"></div>
250 <pre class="prettyprint linenums">
251 <div class="container-fluid">
252 <div class="row-fluid">
253 <div class="span2">
254 <!--Sidebar content-->
256 <div class="span10">
257 <!--Body content-->
265 <section id="responsive">
266 <div class="page-header">
267 <h1>Responsive design <small>Media queries for various devices and resolutions</small></h1>
269 <!-- Supported devices -->
272 <img src="img/responsive-illustrations.png" alt="Responsive devices">
275 <h2>Supported devices</h2>
276 <p>Bootstrap supports a handful of media queries to help make your projects more appropriate on different devices and screen resolutions. Here's what's included:</p>
277 <table class="table table-bordered table-striped">
281 <th>Layout width</th>
282 <th>Column width</th>
283 <th>Gutter width</th>
289 <td>480px and below</td>
290 <td class="muted" colspan="2">Fluid columns, no fixed widths</td>
293 <td>Portrait tablets</td>
294 <td>480px to 768px</td>
295 <td class="muted" colspan="2">Fluid columns, no fixed widths</td>
298 <td>Landscape tablets</td>
299 <td>768px to 980px</td>
305 <td>980px and up</td>
310 <td>Large display</td>
311 <td>1210px and up</td>
318 <h3>What they do</h3>
319 <p>Media queries allow for custom CSS based on a number of conditions—ratios, widths, display type, etc—but usually focuses around <code>min-width</code> and <code>max-width</code>.</p>
321 <li>Modify the width of column in our grid</li>
322 <li>Stack elements instead of float wherever necessary</li>
323 <li>Resize headings and text to be more appropriate for devices</li>
330 <!-- Media query code -->
331 <h2>Using the media queries</h2>
334 <p>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:</p>
336 <li>Use the compiled responsive version, bootstrap-responsive.css</li>
337 <li>Add @import "responsive.less" and recompile Bootstrap</li>
338 <li>Modify and recompile responsive.less as a separate</li>
340 <p><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.</p>
343 <pre class="prettyprint linenums">
344 // Landscape phones and down
345 @media (max-width: 480px) { ... }
347 // Landscape phone to portrait tablet
348 @media (max-width: 768px) { ... }
350 // Portrait tablet to landscape and desktop
351 @media (min-width: 768px) and (max-width: 980px) { ... }
354 @media (min-width: 1200px) { .. }
361 <script src="../../cache/include/javascript/sugar_grp1_jquery.js"></script>
362 <script src="js/google-code-prettify/prettify.js"></script>
363 <script src="js/application.js"></script>