mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-01 17:32:41 +02:00
adding responsive utility classes and matching docs section with super neato table and test
This commit is contained in:
Binary file not shown.
46
docs/assets/css/bootstrap-responsive.css
vendored
46
docs/assets/css/bootstrap-responsive.css
vendored
@@ -21,6 +21,52 @@
|
|||||||
display: none;
|
display: none;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
.visible-phone {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.visible-tablet {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.visible-desktop {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.hidden-phone {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.hidden-tablet {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.hidden-desktop {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
@media (max-width: 767px) {
|
||||||
|
.visible-phone {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.hidden-phone {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.hidden-desktop {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.visible-desktop {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media (min-width: 768px) and (max-width: 979px) {
|
||||||
|
.visible-tablet {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.hidden-tablet {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.hidden-desktop {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.visible-desktop {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
@media (max-width: 480px) {
|
@media (max-width: 480px) {
|
||||||
.nav-collapse {
|
.nav-collapse {
|
||||||
-webkit-transform: translate3d(0, 0, 0);
|
-webkit-transform: translate3d(0, 0, 0);
|
||||||
|
@@ -557,6 +557,70 @@ form.well {
|
|||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Responsive table
|
||||||
|
------------------------- */
|
||||||
|
.responsive-utilities th small {
|
||||||
|
display: block;
|
||||||
|
font-weight: normal;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
.responsive-utilities tbody th {
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
.responsive-utilities td {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.responsive-utilities td.is-visible {
|
||||||
|
color: #468847;
|
||||||
|
background-color: #dff0d8 !important;
|
||||||
|
}
|
||||||
|
.responsive-utilities td.is-hidden {
|
||||||
|
color: #ccc;
|
||||||
|
background-color: #f9f9f9 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Responsive tests
|
||||||
|
------------------------- */
|
||||||
|
.responsive-utilities-test {
|
||||||
|
margin-top: 5px;
|
||||||
|
margin-left: 0;
|
||||||
|
list-style: none;
|
||||||
|
overflow: hidden; /* clear floats */
|
||||||
|
}
|
||||||
|
.responsive-utilities-test li {
|
||||||
|
position: relative;
|
||||||
|
float: left;
|
||||||
|
width: 25%;
|
||||||
|
height: 43px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: bold;
|
||||||
|
line-height: 43px;
|
||||||
|
color: #999;
|
||||||
|
text-align: center;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
-webkit-border-radius: 4px;
|
||||||
|
-moz-border-radius: 4px;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
.responsive-utilities-test li + li {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
.responsive-utilities-test span {
|
||||||
|
position: absolute;
|
||||||
|
top: -1px;
|
||||||
|
left: -1px;
|
||||||
|
right: -1px;
|
||||||
|
bottom: -1px;
|
||||||
|
-webkit-border-radius: 4px;
|
||||||
|
-moz-border-radius: 4px;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
.responsive-utilities-test span {
|
||||||
|
color: #468847;
|
||||||
|
background-color: #dff0d8;
|
||||||
|
border: 1px solid #d6e9c6;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Responsive Docs
|
/* Responsive Docs
|
||||||
-------------------------------------------------- */
|
-------------------------------------------------- */
|
||||||
|
@@ -173,7 +173,7 @@
|
|||||||
<div class="span4">
|
<div class="span4">
|
||||||
<p>The default grid system provided as part of Bootstrap is a <strong>940px-wide, 12-column grid</strong>.</p>
|
<p>The default grid system provided as part of Bootstrap is a <strong>940px-wide, 12-column grid</strong>.</p>
|
||||||
<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>
|
<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>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<pre class="prettyprint linenums">
|
<pre class="prettyprint linenums">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -181,11 +181,11 @@
|
|||||||
<div class="span8">...</div>
|
<div class="span8">...</div>
|
||||||
</div>
|
</div>
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<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>
|
<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>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
</div><!-- /row -->
|
</div><!-- /.row -->
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
@@ -229,7 +229,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /span6 -->
|
</div><!-- /.span -->
|
||||||
<div class="span6">
|
<div class="span6">
|
||||||
<pre class="prettyprint linenums">
|
<pre class="prettyprint linenums">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -242,8 +242,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
</div>
|
</div><!-- /.row -->
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
@@ -291,11 +291,11 @@
|
|||||||
<div class="span4">
|
<div class="span4">
|
||||||
<h3>Percents, not pixels</h3>
|
<h3>Percents, not pixels</h3>
|
||||||
<p>The fluid grid system uses percents for column widths instead of fixed pixels. It also has the same responsive variations as our fixed grid system, ensuring proper proportions for key screen resolutions and devices.</p>
|
<p>The fluid grid system uses percents for column widths instead of fixed pixels. It also has the same responsive variations as our fixed grid system, ensuring proper proportions for key screen resolutions and devices.</p>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<h3>Fluid rows</h3>
|
<h3>Fluid rows</h3>
|
||||||
<p>Make any row fluid simply by changing <code>.row</code> to <code>.row-fluid</code>. The columns stay the exact same, making it super straightforward to flip between fixed and fluid layouts.</p>
|
<p>Make any row fluid simply by changing <code>.row</code> to <code>.row-fluid</code>. The columns stay the exact same, making it super straightforward to flip between fixed and fluid layouts.</p>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<h3>Markup</h3>
|
<h3>Markup</h3>
|
||||||
<pre class="prettyprint linenums">
|
<pre class="prettyprint linenums">
|
||||||
@@ -304,8 +304,8 @@
|
|||||||
<div class="span8">...</div>
|
<div class="span8">...</div>
|
||||||
</div>
|
</div>
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
</div><!-- /row -->
|
</div><!-- /.row -->
|
||||||
|
|
||||||
<h2>Fluid nesting</h2>
|
<h2>Fluid nesting</h2>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -324,7 +324,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
<div class="span6">
|
<div class="span6">
|
||||||
<pre class="prettyprint linenums">
|
<pre class="prettyprint linenums">
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
@@ -337,8 +337,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
</div>
|
</div><!-- /.row -->
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@@ -385,16 +385,16 @@
|
|||||||
<div class="span4">
|
<div class="span4">
|
||||||
<h3>Variables in LESS</h3>
|
<h3>Variables in LESS</h3>
|
||||||
<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>
|
<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>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<h3>How to customize</h3>
|
<h3>How to customize</h3>
|
||||||
<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="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.</p>
|
<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="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.</p>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<h3>Staying responsive</h3>
|
<h3>Staying responsive</h3>
|
||||||
<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>
|
<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>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
</div><!-- /row -->
|
</div><!-- /.row -->
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@@ -421,7 +421,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</pre>
|
</pre>
|
||||||
</div><!-- /col -->
|
</div><!-- /.span -->
|
||||||
<div class="span6">
|
<div class="span6">
|
||||||
<h2>Fluid layout</h2>
|
<h2>Fluid layout</h2>
|
||||||
<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>
|
<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>
|
||||||
@@ -441,8 +441,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</pre>
|
</pre>
|
||||||
</div><!-- /col -->
|
</div><!-- /.span -->
|
||||||
</div><!-- /row -->
|
</div><!-- /.row -->
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
@@ -457,8 +457,16 @@
|
|||||||
<!-- Supported devices -->
|
<!-- Supported devices -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<img src="assets/img/responsive-illustrations.png" alt="Responsive devices">
|
<p><img src="assets/img/responsive-illustrations.png" alt="Responsive devices"></p>
|
||||||
</div>
|
<h3>What they do</h3>
|
||||||
|
<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>
|
||||||
|
<ul>
|
||||||
|
<li>Modify the width of column in our grid</li>
|
||||||
|
<li>Stack elements instead of float wherever necessary</li>
|
||||||
|
<li>Resize headings and text to be more appropriate for devices</li>
|
||||||
|
</ul>
|
||||||
|
<p>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.</p>
|
||||||
|
</div><!-- /.span -->
|
||||||
<div class="span8">
|
<div class="span8">
|
||||||
<h2>Supported devices</h2>
|
<h2>Supported devices</h2>
|
||||||
<p>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:</p>
|
<p>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:</p>
|
||||||
@@ -506,23 +514,15 @@
|
|||||||
<h3>Requires meta tag</h3>
|
<h3>Requires meta tag</h3>
|
||||||
<p>To ensure devices display responsive pages properly, include the viewport meta tag.</p>
|
<p>To ensure devices display responsive pages properly, include the viewport meta tag.</p>
|
||||||
<pre class="prettyprint linenums"><meta name="viewport" content="width=device-width, initial-scale=1.0"></pre>
|
<pre class="prettyprint linenums"><meta name="viewport" content="width=device-width, initial-scale=1.0"></pre>
|
||||||
|
</div><!-- /.span -->
|
||||||
<h3>What they do</h3>
|
</div><!-- /.row -->
|
||||||
<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>
|
|
||||||
<ul>
|
|
||||||
<li>Modify the width of column in our grid</li>
|
|
||||||
<li>Stack elements instead of float wherever necessary</li>
|
|
||||||
<li>Resize headings and text to be more appropriate for devices</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<!-- Media query code -->
|
<!-- Media query code -->
|
||||||
<h2>Using the media queries</h2>
|
<h2>Using the media queries</h2>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="span5">
|
<div class="span4">
|
||||||
<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>
|
<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>
|
||||||
<ol>
|
<ol>
|
||||||
<li>Use the compiled responsive version, bootstrap-responsive.css</li>
|
<li>Use the compiled responsive version, bootstrap-responsive.css</li>
|
||||||
@@ -530,8 +530,8 @@
|
|||||||
<li>Modify and recompile responsive.less as a separate file</li>
|
<li>Modify and recompile responsive.less as a separate file</li>
|
||||||
</ol>
|
</ol>
|
||||||
<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>
|
<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>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
<div class="span7">
|
<div class="span8">
|
||||||
<pre class="prettyprint linenums">
|
<pre class="prettyprint linenums">
|
||||||
// Landscape phones and down
|
// Landscape phones and down
|
||||||
@media (max-width: 480px) { ... }
|
@media (max-width: 480px) { ... }
|
||||||
@@ -545,8 +545,93 @@
|
|||||||
// Large desktop
|
// Large desktop
|
||||||
@media (min-width: 1200px) { .. }
|
@media (min-width: 1200px) { .. }
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
</div>
|
</div><!-- /.row -->
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<!-- Responsive utility classes -->
|
||||||
|
<h2>Responsive utility classes</h2>
|
||||||
|
<div class="row">
|
||||||
|
<div class="span4">
|
||||||
|
<h3>What are they</h2>
|
||||||
|
<p>For faster mobile-friendly development, use these basic utility classes for showing and hidding content by device.</p>
|
||||||
|
<h3>When to use</h2>
|
||||||
|
<p>Use on a limited basis and avoid creating entirely different versions of the same site. Instead, use them to complement each device's presentation.</p>
|
||||||
|
<p>For example, you might show a <code><select></code> element for nav on mobile layouts, but not on tablets or desktops.</p>
|
||||||
|
</div><!-- /.span -->
|
||||||
|
<div class="span8">
|
||||||
|
<h3>Support classes</h3>
|
||||||
|
<p>Shown here is a table of the classes we support and their effect on a given media query layout (labeled by device). They can be found in <code>responsive.less</code>.</p>
|
||||||
|
<table class="table table-bordered table-striped responsive-utilities">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Class</th>
|
||||||
|
<th>Phones <small>480px and below</small></th>
|
||||||
|
<th>Tablets <small>767px and below</small></th>
|
||||||
|
<th>Desktops <small>768px and above</small></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th><code>.visible-phone</code></th>
|
||||||
|
<td class="is-visible">Visible</td>
|
||||||
|
<td class="is-hidden">Hidden</td>
|
||||||
|
<td class="is-hidden">Hidden</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><code>.visible-tablet</code></th>
|
||||||
|
<td class="is-hidden">Hidden</td>
|
||||||
|
<td class="is-visible">Visible</td>
|
||||||
|
<td class="is-hidden">Hidden</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><code>.visible-desktop</code></th>
|
||||||
|
<td class="is-hidden">Hidden</td>
|
||||||
|
<td class="is-hidden">Hidden</td>
|
||||||
|
<td class="is-visible">Visible</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><code>.hidden-phone</code></th>
|
||||||
|
<td class="is-hidden">Hidden</td>
|
||||||
|
<td class="is-visible">Visible</td>
|
||||||
|
<td class="is-visible">Visible</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><code>.hidden-tablet</code></th>
|
||||||
|
<td class="is-visible">Visible</td>
|
||||||
|
<td class="is-hidden">Hidden</td>
|
||||||
|
<td class="is-visible">Visible</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><code>.hidden-desktop</code></th>
|
||||||
|
<td class="is-visible">Visible</td>
|
||||||
|
<td class="is-visible">Visible</td>
|
||||||
|
<td class="is-hidden">Hidden</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h3>Test case</h3>
|
||||||
|
<p>Resize your browser or load on different devices to test the above clases.</p>
|
||||||
|
<h4>Visible on...</h4>
|
||||||
|
<ul class="responsive-utilities-test">
|
||||||
|
<li>Phone<span class="visible-phone">✔ Phone</span></li>
|
||||||
|
<li>Tablet<span class="visible-tablet">✔ Tablet</span></li>
|
||||||
|
<li>Desktop<span class="visible-desktop">✔ Desktop</span></li>
|
||||||
|
</ul>
|
||||||
|
<h4>Hidden on...</h4>
|
||||||
|
<ul class="responsive-utilities-test hidden-on">
|
||||||
|
<li>Phone<span class="hidden-phone">✔ Phone</span></li>
|
||||||
|
<li>Tablet<span class="hidden-tablet">✔ Tablet</span></li>
|
||||||
|
<li>Desktop<span class="hidden-desktop">✔ Desktop</span></li>
|
||||||
|
</ul>
|
||||||
|
</div><!-- /.span -->
|
||||||
|
</div><!-- /.row -->
|
||||||
|
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="span4">
|
||||||
|
</div><!-- /.span -->
|
||||||
|
</div><!-- /.row -->
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
161
docs/templates/pages/scaffolding.mustache
vendored
161
docs/templates/pages/scaffolding.mustache
vendored
@@ -97,7 +97,7 @@
|
|||||||
<div class="span4">
|
<div class="span4">
|
||||||
<p>{{_i}}The default grid system provided as part of Bootstrap is a <strong>940px-wide, 12-column grid</strong>.{{/i}}</p>
|
<p>{{_i}}The default grid system provided as part of Bootstrap is a <strong>940px-wide, 12-column grid</strong>.{{/i}}</p>
|
||||||
<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>
|
<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>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<pre class="prettyprint linenums">
|
<pre class="prettyprint linenums">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -105,11 +105,11 @@
|
|||||||
<div class="span8">...</div>
|
<div class="span8">...</div>
|
||||||
</div>
|
</div>
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<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>
|
<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>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
</div><!-- /row -->
|
</div><!-- /.row -->
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
@@ -153,7 +153,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /span6 -->
|
</div><!-- /.span -->
|
||||||
<div class="span6">
|
<div class="span6">
|
||||||
<pre class="prettyprint linenums">
|
<pre class="prettyprint linenums">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -166,8 +166,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
</div>
|
</div><!-- /.row -->
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
@@ -215,11 +215,11 @@
|
|||||||
<div class="span4">
|
<div class="span4">
|
||||||
<h3>{{_i}}Percents, not pixels{{/i}}</h3>
|
<h3>{{_i}}Percents, not pixels{{/i}}</h3>
|
||||||
<p>{{_i}}The fluid grid system uses percents for column widths instead of fixed pixels. It also has the same responsive variations as our fixed grid system, ensuring proper proportions for key screen resolutions and devices.{{/i}}</p>
|
<p>{{_i}}The fluid grid system uses percents for column widths instead of fixed pixels. It also has the same responsive variations as our fixed grid system, ensuring proper proportions for key screen resolutions and devices.{{/i}}</p>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<h3>{{_i}}Fluid rows{{/i}}</h3>
|
<h3>{{_i}}Fluid rows{{/i}}</h3>
|
||||||
<p>{{_i}}Make any row fluid simply by changing <code>.row</code> to <code>.row-fluid</code>. The columns stay the exact same, making it super straightforward to flip between fixed and fluid layouts.{{/i}}</p>
|
<p>{{_i}}Make any row fluid simply by changing <code>.row</code> to <code>.row-fluid</code>. The columns stay the exact same, making it super straightforward to flip between fixed and fluid layouts.{{/i}}</p>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<h3>{{_i}}Markup{{/i}}</h3>
|
<h3>{{_i}}Markup{{/i}}</h3>
|
||||||
<pre class="prettyprint linenums">
|
<pre class="prettyprint linenums">
|
||||||
@@ -228,8 +228,8 @@
|
|||||||
<div class="span8">...</div>
|
<div class="span8">...</div>
|
||||||
</div>
|
</div>
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
</div><!-- /row -->
|
</div><!-- /.row -->
|
||||||
|
|
||||||
<h2>{{_i}}Fluid nesting{{/i}}</h2>
|
<h2>{{_i}}Fluid nesting{{/i}}</h2>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -248,7 +248,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
<div class="span6">
|
<div class="span6">
|
||||||
<pre class="prettyprint linenums">
|
<pre class="prettyprint linenums">
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
@@ -261,8 +261,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
</div>
|
</div><!-- /.row -->
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@@ -309,16 +309,16 @@
|
|||||||
<div class="span4">
|
<div class="span4">
|
||||||
<h3>{{_i}}Variables in LESS{{/i}}</h3>
|
<h3>{{_i}}Variables in LESS{{/i}}</h3>
|
||||||
<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>
|
<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>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<h3>{{_i}}How to customize{{/i}}</h3>
|
<h3>{{_i}}How to customize{{/i}}</h3>
|
||||||
<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>
|
<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>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<h3>{{_i}}Staying responsive{{/i}}</h3>
|
<h3>{{_i}}Staying responsive{{/i}}</h3>
|
||||||
<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>
|
<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>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
</div><!-- /row -->
|
</div><!-- /.row -->
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@@ -345,7 +345,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</pre>
|
</pre>
|
||||||
</div><!-- /col -->
|
</div><!-- /.span -->
|
||||||
<div class="span6">
|
<div class="span6">
|
||||||
<h2>{{_i}}Fluid layout{{/i}}</h2>
|
<h2>{{_i}}Fluid layout{{/i}}</h2>
|
||||||
<p>{{_i}}<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.{{/i}}</p>
|
<p>{{_i}}<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.{{/i}}</p>
|
||||||
@@ -365,8 +365,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</pre>
|
</pre>
|
||||||
</div><!-- /col -->
|
</div><!-- /.span -->
|
||||||
</div><!-- /row -->
|
</div><!-- /.row -->
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
@@ -381,8 +381,16 @@
|
|||||||
<!-- Supported devices -->
|
<!-- Supported devices -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<img src="assets/img/responsive-illustrations.png" alt="Responsive devices">
|
<p><img src="assets/img/responsive-illustrations.png" alt="Responsive devices"></p>
|
||||||
</div>
|
<h3>{{_i}}What they do{{/i}}</h3>
|
||||||
|
<p>{{_i}}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>.{{/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>
|
||||||
|
</div><!-- /.span -->
|
||||||
<div class="span8">
|
<div class="span8">
|
||||||
<h2>{{_i}}Supported devices{{/i}}</h2>
|
<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>
|
<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>
|
||||||
@@ -430,23 +438,15 @@
|
|||||||
<h3>{{_i}}Requires meta tag{{/i}}</h3>
|
<h3>{{_i}}Requires meta tag{{/i}}</h3>
|
||||||
<p>{{_i}}To ensure devices display responsive pages properly, include the viewport meta tag.{{/i}}</p>
|
<p>{{_i}}To ensure devices display responsive pages properly, include the viewport meta tag.{{/i}}</p>
|
||||||
<pre class="prettyprint linenums"><meta name="viewport" content="width=device-width, initial-scale=1.0"></pre>
|
<pre class="prettyprint linenums"><meta name="viewport" content="width=device-width, initial-scale=1.0"></pre>
|
||||||
|
</div><!-- /.span -->
|
||||||
<h3>{{_i}}What they do{{/i}}</h3>
|
</div><!-- /.row -->
|
||||||
<p>{{_i}}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>.{{/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>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<!-- Media query code -->
|
<!-- Media query code -->
|
||||||
<h2>{{_i}}Using the media queries{{/i}}</h2>
|
<h2>{{_i}}Using the media queries{{/i}}</h2>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="span5">
|
<div class="span4">
|
||||||
<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>
|
<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>
|
||||||
<ol>
|
<ol>
|
||||||
<li>{{_i}}Use the compiled responsive version, bootstrap-responsive.css{{/i}}</li>
|
<li>{{_i}}Use the compiled responsive version, bootstrap-responsive.css{{/i}}</li>
|
||||||
@@ -454,8 +454,8 @@
|
|||||||
<li>{{_i}}Modify and recompile responsive.less as a separate file{{/i}}</li>
|
<li>{{_i}}Modify and recompile responsive.less as a separate file{{/i}}</li>
|
||||||
</ol>
|
</ol>
|
||||||
<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>
|
<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>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
<div class="span7">
|
<div class="span8">
|
||||||
<pre class="prettyprint linenums">
|
<pre class="prettyprint linenums">
|
||||||
// {{_i}}Landscape phones and down{{/i}}
|
// {{_i}}Landscape phones and down{{/i}}
|
||||||
@media (max-width: 480px) { ... }
|
@media (max-width: 480px) { ... }
|
||||||
@@ -469,6 +469,91 @@
|
|||||||
// {{_i}}Large desktop{{/i}}
|
// {{_i}}Large desktop{{/i}}
|
||||||
@media (min-width: 1200px) { .. }
|
@media (min-width: 1200px) { .. }
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div><!-- /.span -->
|
||||||
</div>
|
</div><!-- /.row -->
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<!-- Responsive utility classes -->
|
||||||
|
<h2>{{_i}}Responsive utility classes{{/i}}</h2>
|
||||||
|
<div class="row">
|
||||||
|
<div class="span4">
|
||||||
|
<h3>{{_i}}What are they{{/i}}</h2>
|
||||||
|
<p>{{_i}}For faster mobile-friendly development, use these basic utility classes for showing and hidding content by device.{{/i}}</p>
|
||||||
|
<h3>{{_i}}When to use{{/i}}</h2>
|
||||||
|
<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>
|
||||||
|
<p>{{_i}}For example, you might show a <code><select></code> element for nav on mobile layouts, but not on tablets or desktops.{{/i}}</p>
|
||||||
|
</div><!-- /.span -->
|
||||||
|
<div class="span8">
|
||||||
|
<h3>{{_i}}Support classes{{/i}}</h3>
|
||||||
|
<p>{{_i}}Shown here is a table of the classes we support 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>480px and below</small>{{/i}}</th>
|
||||||
|
<th>{{_i}}Tablets <small>767px and below</small>{{/i}}</th>
|
||||||
|
<th>{{_i}}Desktops <small>768px and above</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}}Test case{{/i}}</h3>
|
||||||
|
<p>{{_i}}Resize your browser or load on different devices to test the above clases.{{/i}}</p>
|
||||||
|
<h4>{{_i}}Visible on...{{/i}}</h4>
|
||||||
|
<ul class="responsive-utilities-test">
|
||||||
|
<li>Phone<span class="visible-phone">✔ Phone</span></li>
|
||||||
|
<li>Tablet<span class="visible-tablet">✔ Tablet</span></li>
|
||||||
|
<li>Desktop<span class="visible-desktop">✔ Desktop</span></li>
|
||||||
|
</ul>
|
||||||
|
<h4>{{_i}}Hidden on...{{/i}}</h4>
|
||||||
|
<ul class="responsive-utilities-test hidden-on">
|
||||||
|
<li>Phone<span class="hidden-phone">✔ Phone</span></li>
|
||||||
|
<li>Tablet<span class="hidden-tablet">✔ Tablet</span></li>
|
||||||
|
<li>Desktop<span class="hidden-desktop">✔ Desktop</span></li>
|
||||||
|
</ul>
|
||||||
|
</div><!-- /.span -->
|
||||||
|
</div><!-- /.row -->
|
||||||
|
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="span4">
|
||||||
|
</div><!-- /.span -->
|
||||||
|
</div><!-- /.row -->
|
||||||
</section>
|
</section>
|
||||||
|
@@ -31,6 +31,37 @@
|
|||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Visibility utilities
|
||||||
|
|
||||||
|
// For desktops
|
||||||
|
.visible-phone { display: none; }
|
||||||
|
.visible-tablet { display: none; }
|
||||||
|
.visible-desktop { display: block; }
|
||||||
|
.hidden-phone { display: block; }
|
||||||
|
.hidden-tablet { display: block; }
|
||||||
|
.hidden-desktop { display: none; }
|
||||||
|
|
||||||
|
// Phones only
|
||||||
|
@media (max-width: 767px) {
|
||||||
|
// Show
|
||||||
|
.visible-phone { display: block; }
|
||||||
|
// Hide
|
||||||
|
.hidden-phone { display: none; }
|
||||||
|
// Hide everything else
|
||||||
|
.hidden-desktop { display: block; }
|
||||||
|
.visible-desktop { display: none; }
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tablets & small desktops only
|
||||||
|
@media (min-width: 768px) and (max-width: 979px) {
|
||||||
|
// Show
|
||||||
|
.visible-tablet { display: block; }
|
||||||
|
// Hide
|
||||||
|
.hidden-tablet { display: none; }
|
||||||
|
// Hide everything else
|
||||||
|
.hidden-desktop { display: block; }
|
||||||
|
.visible-desktop { display: none; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// UP TO LANDSCAPE PHONE
|
// UP TO LANDSCAPE PHONE
|
||||||
|
@@ -3,8 +3,8 @@
|
|||||||
// -------------------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
// STRUCTURAL LAYOUT
|
// Body reset
|
||||||
// -----------------
|
// ----------
|
||||||
|
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@@ -16,7 +16,7 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// LINKS
|
// Links
|
||||||
// -----
|
// -----
|
||||||
|
|
||||||
a {
|
a {
|
||||||
|
Reference in New Issue
Block a user