diff --git a/docs/assets/bootstrap.zip b/docs/assets/bootstrap.zip index 9764009092..e51e753062 100644 Binary files a/docs/assets/bootstrap.zip and b/docs/assets/bootstrap.zip differ diff --git a/docs/assets/css/bootstrap-responsive.css b/docs/assets/css/bootstrap-responsive.css index 9dd71c62d5..90f63b6226 100644 --- a/docs/assets/css/bootstrap-responsive.css +++ b/docs/assets/css/bootstrap-responsive.css @@ -21,6 +21,52 @@ display: none; 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) { .nav-collapse { -webkit-transform: translate3d(0, 0, 0); diff --git a/docs/assets/css/docs.css b/docs/assets/css/docs.css index f5d63f90dc..36da6853ce 100644 --- a/docs/assets/css/docs.css +++ b/docs/assets/css/docs.css @@ -557,6 +557,70 @@ form.well { 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 -------------------------------------------------- */ diff --git a/docs/scaffolding.html b/docs/scaffolding.html index 97d2bf4c5d..a35012e9c8 100644 --- a/docs/scaffolding.html +++ b/docs/scaffolding.html @@ -173,7 +173,7 @@

The default grid system provided as part of Bootstrap is a 940px-wide, 12-column grid.

It also has four responsive variations for various devices and resolutions: phone, tablet portrait, table landscape and small desktops, and large widescreen desktops.

-
+
 <div class="row">
@@ -181,11 +181,11 @@
   <div class="span8">...</div>
 </div>
 
-
+

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.

-
- + +
@@ -229,7 +229,7 @@ - +
 <div class="row">
@@ -242,8 +242,8 @@
   </div>
 </div>
 
-
- + + @@ -291,11 +291,11 @@

Percents, not pixels

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.

-
+

Fluid rows

Make any row fluid simply by changing .row to .row-fluid. The columns stay the exact same, making it super straightforward to flip between fixed and fluid layouts.

-
+

Markup

@@ -304,8 +304,8 @@
   <div class="span8">...</div>
 </div>
 
-
- + +

Fluid nesting

@@ -324,7 +324,7 @@
- +
 <div class="row-fluid">
@@ -337,8 +337,8 @@
   </div>
 </div>
 
-
- + + @@ -385,16 +385,16 @@

Variables in LESS

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.

-
+

How to customize

Modifying the grid means changing the three @grid* variables and recompiling Bootstrap. Change the grid variables in variables.less and use one of the four ways documented to recompile. If you're adding more columns, be sure to add the CSS for those in grid.less.

-
+

Staying responsive

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.

-
- + + @@ -421,7 +421,7 @@ </div> </body> - +

Fluid layout

<div class="container-fluid"> gives flexible page structure, min- and max-widths, and a left-hand sidebar. It's great for apps and docs.

@@ -441,8 +441,8 @@ </div> </div> -
- + + @@ -457,8 +457,16 @@
- Responsive devices -
+

Responsive devices

+

What they do

+

Media queries allow for custom CSS based on a number of conditions—ratios, widths, display type, etc—but usually focuses around min-width and max-width.

+ +

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.

+

Supported devices

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:

@@ -506,23 +514,15 @@

Requires meta tag

To ensure devices display responsive pages properly, include the viewport meta tag.

<meta name="viewport" content="width=device-width, initial-scale=1.0">
- -

What they do

-

Media queries allow for custom CSS based on a number of conditions—ratios, widths, display type, etc—but usually focuses around min-width and max-width.

- -
- + +

Using the media queries

-
+

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:

  1. Use the compiled responsive version, bootstrap-responsive.css
  2. @@ -530,8 +530,8 @@
  3. Modify and recompile responsive.less as a separate file

Why not just include it? Truth be told, not everything needs to be responsive. Instead of encouraging developers to remove this feature, we figure it best to enable it.

-
-
+
+
   // Landscape phones and down
   @media (max-width: 480px) { ... }
@@ -545,8 +545,93 @@
   // Large desktop
   @media (min-width: 1200px) { .. }
 
-
-
+
+ +
+ + +

Responsive utility classes

+
+
+

What are they

+

For faster mobile-friendly development, use these basic utility classes for showing and hidding content by device.

+

When to use

+

Use on a limited basis and avoid creating entirely different versions of the same site. Instead, use them to complement each device's presentation.

+

For example, you might show a <select> element for nav on mobile layouts, but not on tablets or desktops.

+
+
+

Support classes

+

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 responsive.less.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ClassPhones 480px and belowTablets 767px and belowDesktops 768px and above
.visible-phoneVisible
.visible-tabletVisible
.visible-desktopVisible
.hidden-phoneVisibleVisible
.hidden-tabletVisibleVisible
.hidden-desktopVisibleVisible
+

Test case

+

Resize your browser or load on different devices to test the above clases.

+

Visible on...

+ +

Hidden on...

+ +
+
+ + +
+
+
+
diff --git a/docs/templates/pages/scaffolding.mustache b/docs/templates/pages/scaffolding.mustache index bc4953b24d..fff47d4383 100644 --- a/docs/templates/pages/scaffolding.mustache +++ b/docs/templates/pages/scaffolding.mustache @@ -97,7 +97,7 @@

{{_i}}The default grid system provided as part of Bootstrap is a 940px-wide, 12-column grid.{{/i}}

{{_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}}

-
+
 <div class="row">
@@ -105,11 +105,11 @@
   <div class="span8">...</div>
 </div>
 
-
+

{{_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}}

-
- + +
@@ -153,7 +153,7 @@ - +
 <div class="row">
@@ -166,8 +166,8 @@
   </div>
 </div>
 
-
- + + @@ -215,11 +215,11 @@

{{_i}}Percents, not pixels{{/i}}

{{_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}}

-
+

{{_i}}Fluid rows{{/i}}

{{_i}}Make any row fluid simply by changing .row to .row-fluid. The columns stay the exact same, making it super straightforward to flip between fixed and fluid layouts.{{/i}}

-
+

{{_i}}Markup{{/i}}

@@ -228,8 +228,8 @@
   <div class="span8">...</div>
 </div>
 
-
- + +

{{_i}}Fluid nesting{{/i}}

@@ -248,7 +248,7 @@
- +
 <div class="row-fluid">
@@ -261,8 +261,8 @@
   </div>
 </div>
 
-
- + + @@ -309,16 +309,16 @@

{{_i}}Variables in LESS{{/i}}

{{_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}}

-
+

{{_i}}How to customize{{/i}}

{{_i}}Modifying the grid means changing the three @grid* variables and recompiling Bootstrap. Change the grid variables in variables.less and use one of the four ways documented to recompile. If you're adding more columns, be sure to add the CSS for those in grid.less.{{/i}}

-
+

{{_i}}Staying responsive{{/i}}

{{_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}}

-
- + + @@ -345,7 +345,7 @@ </div> </body> - +

{{_i}}Fluid layout{{/i}}

{{_i}}<div class="container-fluid"> gives flexible page structure, min- and max-widths, and a left-hand sidebar. It's great for apps and docs.{{/i}}

@@ -365,8 +365,8 @@ </div> </div> -
- + + @@ -381,8 +381,16 @@
- Responsive devices -
+

Responsive devices

+

{{_i}}What they do{{/i}}

+

{{_i}}Media queries allow for custom CSS based on a number of conditions—ratios, widths, display type, etc—but usually focuses around min-width and max-width.{{/i}}

+ +

{{_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}}

+

{{_i}}Supported devices{{/i}}

{{_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}}

@@ -430,23 +438,15 @@

{{_i}}Requires meta tag{{/i}}

{{_i}}To ensure devices display responsive pages properly, include the viewport meta tag.{{/i}}

<meta name="viewport" content="width=device-width, initial-scale=1.0">
- -

{{_i}}What they do{{/i}}

-

{{_i}}Media queries allow for custom CSS based on a number of conditions—ratios, widths, display type, etc—but usually focuses around min-width and max-width.{{/i}}

- -
- + +

{{_i}}Using the media queries{{/i}}

-
+

{{_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}}

  1. {{_i}}Use the compiled responsive version, bootstrap-responsive.css{{/i}}
  2. @@ -454,8 +454,8 @@
  3. {{_i}}Modify and recompile responsive.less as a separate file{{/i}}

{{_i}}Why not just include it? 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}}

-
-
+
+
   // {{_i}}Landscape phones and down{{/i}}
   @media (max-width: 480px) { ... }
@@ -469,6 +469,91 @@
   // {{_i}}Large desktop{{/i}}
   @media (min-width: 1200px) { .. }
 
-
-
+
+ +
+ + +

{{_i}}Responsive utility classes{{/i}}

+
+
+

{{_i}}What are they{{/i}}

+

{{_i}}For faster mobile-friendly development, use these basic utility classes for showing and hidding content by device.{{/i}}

+

{{_i}}When to use{{/i}}

+

{{_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}}

+

{{_i}}For example, you might show a <select> element for nav on mobile layouts, but not on tablets or desktops.{{/i}}

+
+
+

{{_i}}Support classes{{/i}}

+

{{_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 responsive.less.{{/i}}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{{_i}}Class{{/i}}{{_i}}Phones 480px and below{{/i}}{{_i}}Tablets 767px and below{{/i}}{{_i}}Desktops 768px and above{{/i}}
.visible-phone{{_i}}Visible{{/i}}
.visible-tablet{{_i}}Visible{{/i}}
.visible-desktop{{_i}}Visible{{/i}}
.hidden-phone{{_i}}Visible{{/i}}{{_i}}Visible{{/i}}
.hidden-tablet{{_i}}Visible{{/i}}{{_i}}Visible{{/i}}
.hidden-desktop{{_i}}Visible{{/i}}{{_i}}Visible{{/i}}
+

{{_i}}Test case{{/i}}

+

{{_i}}Resize your browser or load on different devices to test the above clases.{{/i}}

+

{{_i}}Visible on...{{/i}}

+ +

{{_i}}Hidden on...{{/i}}

+ +
+
+ + +
+
+
+
diff --git a/less/responsive.less b/less/responsive.less index 8c39f088e7..9cfb592962 100644 --- a/less/responsive.less +++ b/less/responsive.less @@ -31,6 +31,37 @@ 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 diff --git a/less/scaffolding.less b/less/scaffolding.less index 47ce53818b..c2e683ac67 100644 --- a/less/scaffolding.less +++ b/less/scaffolding.less @@ -3,8 +3,8 @@ // ------------------------------------------------------------------------------------------- -// STRUCTURAL LAYOUT -// ----------------- +// Body reset +// ---------- body { margin: 0; @@ -16,7 +16,7 @@ body { } -// LINKS +// Links // ----- a {