From f3ad4c7183251713eb021a400211cc9b07577080 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Tue, 21 Feb 2012 08:24:18 -0800 Subject: [PATCH] adding responsive utility classes and matching docs section with super neato table and test --- docs/assets/bootstrap.zip | Bin 53662 -> 53789 bytes docs/assets/css/bootstrap-responsive.css | 46 +++++++ docs/assets/css/docs.css | 64 +++++++++ docs/scaffolding.html | 161 +++++++++++++++++----- docs/templates/pages/scaffolding.mustache | 161 +++++++++++++++++----- less/responsive.less | 31 +++++ less/scaffolding.less | 6 +- 7 files changed, 390 insertions(+), 79 deletions(-) diff --git a/docs/assets/bootstrap.zip b/docs/assets/bootstrap.zip index 9764009092e7361cfca4910636ed5634c068c2f4..e51e7530627ab125d121e978d41030fb116086fc 100644 GIT binary patch delta 5218 zcmaJ_WmJ@H*Bu5N8UYE1E&&m#Ata;`q-*FBq=%BBV?erNXc3W;5*UyWNokP==~M(n zxmHza3d<5-}4SuuDz@ z2Xj2U2?1C*M_2#=4h5$Am$!@IX|aK@uXss*v}71Sy3NkE8G;W0+_(z>up{H-X^@(O zM9AHNYY2P*_9gZ5{GXAlMy4)v4U_>Vl}o-T>0~2;hXEQ@GBbjNI8)m|wO~n#fF&iG z>yP3%mFQ+4CjBzgW@L?O8l4*30xE2^9c!*JnC+XHB`dxSIGCsO4Y^@^eDUep>JeuXXL)<^X?xxM7T|LV%Ysy!h+!ng*lf#r|pj*vs1X7YE^ssnJ=f z;28!V=A>`_2?knk&=j(#ANr4X6t$?qzP#c)!^ecah+cWe(?CQ|LD>)I%DFeahRvTf z*3I?tnoqepABFVJmbrXJ4hSzsiM7gD5zg8_a7x-M;+je)PKFtOae=CEDQBiX38|=D z6U^6|eIsMcd~)~kPz^WlntvguaU<@+?p@vnT_^eqA^T@Bb0xfw3A^x2Hpp z(Rmh7hQ}R4f<-3u&QV_`B6@yxP|~(B<2$|siEl0M z+XT&a72?UGhj*=orm@L*%ks|^jjD=#4nBM6p!R>h5Gif$i;)Op=skZ}Eo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U$4|E<4)wQLF6gD-okm$szNIuDvJ=;v4!-0Oia4 z5UPbLcKGN4j-JSAzpE2Kj%|D#J08Oxz5QXC1ozv!^Eyo7_TO~}SLknF3}S7D?5`pk z=jP+(ew7Z{b2A*<@30odlhjB(Fhq0VEsiuysDJn~6`jS}Vkim^h$BvIqqVQDw=fUe zm=&Irh6t_E%VECJVI8i)0|V;$LU&rbsGi_-za&b@@KefRa97I7u)BVmRbZHhE9b18 zks%Aj#T>}AJQ7mCb1>444l2fqUc?O7=49ict|(6u+KfPJlmKHYbxY{oX;E1V0mn3u zKasV911d_uG}ZP8Vd3C=7i_42jwl8u*Ab_J__N=;kVDq=FaS;Ymd32ngfbU^;QK=;);RG~E=3XJNG` z)kYnE= zBKa|{|K`Xmu+S|A=BO5fRt`< zpv&H*I`p@%!^5=5gF#Ak@C`(Xj2*%z{yWb>iVjKr!Giuzr2?S3$&3KksSY47U=|O6 zB!*C3r$1DGd~`b#-Y_jjDd`POjg%h7{ol0RHSG$%p_#C-ZZe}kEmCW^0{~DM%-zl1 z)y$dqpG~}0-7e(THRFvhe(#Sx#=vVMqyPZ-zrJp~zq 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.

+
    +
  • Modify the width of column in our grid
  • +
  • Stack elements instead of float wherever necessary
  • +
  • Resize headings and text to be more appropriate for devices
  • +
+

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.

-
    -
  • Modify the width of column in our grid
  • -
  • Stack elements instead of float wherever necessary
  • -
  • Resize headings and text to be more appropriate for devices
  • -
-
- + +

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

+
    +
  • Phone✔ Phone
  • +
  • Tablet✔ Tablet
  • +
  • Desktop✔ Desktop
  • +
+

Hidden on...

+
    +
  • Phone✔ Phone
  • +
  • Tablet✔ Tablet
  • +
  • Desktop✔ Desktop
  • +
+
+
+ + +
+
+
+
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}}Modify the width of column in our grid{{/i}}
  • +
  • {{_i}}Stack elements instead of float wherever necessary{{/i}}
  • +
  • {{_i}}Resize headings and text to be more appropriate for devices{{/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}}Modify the width of column in our grid{{/i}}
  • -
  • {{_i}}Stack elements instead of float wherever necessary{{/i}}
  • -
  • {{_i}}Resize headings and text to be more appropriate for devices{{/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}}

+
    +
  • Phone✔ Phone
  • +
  • Tablet✔ Tablet
  • +
  • Desktop✔ Desktop
  • +
+

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

+
    +
  • Phone✔ Phone
  • +
  • Tablet✔ Tablet
  • +
  • Desktop✔ Desktop
  • +
+
+
+ + +
+
+
+
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 {