]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
More navbar derping
authorMark Otto <otto@github.com>
Thu, 17 Jan 2013 00:14:41 +0000 (16:14 -0800)
committerMark Otto <otto@github.com>
Thu, 17 Jan 2013 00:14:41 +0000 (16:14 -0800)
docs/assets/css/bootstrap.css
docs/components.html
docs/templates/pages/components.mustache
less/bootstrap.less
less/forms.less
less/mixins.less
less/navbar.less
less/variables.less

index e73506ac1aeb48de072d1993504ac39e8e0f0138..70eaace2651a07979291e6b05c347074b55d6ad0 100644 (file)
@@ -949,10 +949,9 @@ input[type="search"],
 input[type="tel"],
 input[type="color"],
 .uneditable-input {
-  display: block;
+  display: inline-block;
   min-height: 34px;
   padding: 6px 9px;
-  margin-bottom: 10px;
   font-size: 14px;
   line-height: 20px;
   color: #555555;
@@ -2868,6 +2867,7 @@ button.close {
 .navbar {
   padding: 15px;
   background-color: #eeeeee;
+  border-radius: 4px;
 }
 
 .navbar:before,
@@ -2882,16 +2882,17 @@ button.close {
 
 .navbar .brand {
   display: inline-block;
-  padding: 7px 15px;
+  padding: 15px 15px;
   font-size: 18px;
   font-weight: bold;
-  line-height: 1;
+  line-height: 20px;
   color: #777777;
 }
 
 .navbar .brand:hover {
+  color: #5e5e5e;
   text-decoration: none;
-  background-color: #ddd;
+  background-color: transparent;
 }
 
 .btn-navbar {
@@ -2918,7 +2919,13 @@ button.close {
   margin-top: 15px;
 }
 
+.navbar .nav > li {
+  float: left;
+}
+
 .navbar .nav > li > a {
+  padding-top: 15px;
+  padding-bottom: 15px;
   line-height: 20px;
   color: #777777;
 }
@@ -2933,7 +2940,37 @@ button.close {
 .navbar .nav > .active > a:hover,
 .navbar .nav > .active > a:focus {
   color: #555555;
-  background-color: #e1e1e1;
+  background-color: #d5d5d5;
+}
+
+@media screen and (min-width: 992px) {
+  .navbar {
+    padding-top: 0;
+    padding-bottom: 0;
+  }
+  .navbar .brand {
+    float: left;
+    margin-left: -15px;
+  }
+  .navbar .nav {
+    margin-top: 0;
+  }
+  .navbar .nav:before,
+  .navbar .nav:after {
+    display: table;
+    content: " ";
+  }
+  .navbar .nav:after {
+    clear: both;
+  }
+  .navbar .btn-navbar {
+    display: none;
+  }
+  .nav-collapse.collapse {
+    float: left;
+    height: auto !important;
+    overflow: visible !important;
+  }
 }
 
 .navbar-inverse {
@@ -2969,6 +3006,40 @@ button.close {
   background-color: #444;
 }
 
+.navbar-static-top {
+  position: static;
+  border-radius: 0;
+}
+
+.navbar-fixed-top,
+.navbar-fixed-bottom {
+  position: fixed;
+  right: 0;
+  left: 0;
+  z-index: 1030;
+  border-radius: 0;
+}
+
+.navbar-fixed-top {
+  top: 0;
+}
+
+.navbar-fixed-bottom {
+  bottom: 0;
+}
+
+.navbar .divider-vertical {
+  height: 26px;
+  margin: 7px 9px;
+  border-right: 1px solid #fbfbfb;
+  border-left: 1px solid #e1e1e1;
+}
+
+.navbar-form {
+  margin-top: 9px;
+  margin-bottom: 9px;
+}
+
 /*
 
 // COMMON STYLES
@@ -4737,41 +4808,10 @@ a.badge:hover {
       }
     */
   
-    /* Required to make the collapsing navbar work on regular desktops */
-  
   }
   .container {
     max-width: 940px;
   }
-  .navbar {
-    padding-top: 0;
-    padding-bottom: 0;
-  }
-  .navbar .brand {
-    float: left;
-    padding-top: 11px;
-    padding-bottom: 11px;
-    margin-left: -15px;
-  }
-  .navbar .nav {
-    margin-top: 0;
-    overflow: hidden;
-  }
-  .navbar .nav > li {
-    float: left;
-  }
-  .navbar .nav > li > a {
-    padding-top: 10px;
-    padding-bottom: 10px;
-  }
-  .navbar .btn-navbar {
-    display: none;
-  }
-  .nav-collapse.collapse {
-    float: left;
-    height: auto !important;
-    overflow: visible !important;
-  }
 }
 
 @media screen and (min-width: 1200px) {
index 17ea3a0d465a3f36592fdaac163049fa1c31412f..c1049747c24989206b6aaee446c8a598591ed66e 100644 (file)
           <div class="bs-docs-example">
             <div class="navbar">
               <form class="navbar-form pull-left">
-                <input type="text" class="span2">
+                <input type="text" style="width: 200px;">
                 <button type="submit" class="btn">Submit</button>
               </form>
             </div>
           </div>
 <pre class="prettyprint linenums">
-&lt;form class="navbar-form pull-left"&gt;
-  &lt;input type="text" class="span2"&gt;
+&lt;form class="pull-left"&gt;
+  &lt;input type="text" style="width: 200px;"&gt;
   &lt;button type="submit" class="btn"&gt;Submit&lt;/button&gt;
 &lt;/form&gt;
-</pre>
-
-          <h3>Search form</h3>
-          <p>For a more customized search form, add <code>.navbar-search</code> to the <code>form</code> and <code>.search-query</code> to the input for specialized styles in the navbar.</p>
-          <div class="bs-docs-example">
-            <div class="navbar">
-              <form class="navbar-search pull-left">
-                <input type="text" class="search-query" placeholder="Search">
-              </form>
-            </div>
-          </div>
-<pre class="prettyprint linenums">
-&lt;form class="navbar-search pull-left"&gt;
-  &lt;input type="text" class="search-query" placeholder="Search"&gt;
-&lt;/form&gt;
 </pre>
 
           <h3>Component alignment</h3>
index 10a7ab0675aa9e0f4cc5b22029ef49bb2aff4546..8ec40dcad5d65fc6e472fbafc3fa95eea12cba3b 100644 (file)
           <div class="bs-docs-example">
             <div class="navbar">
               <form class="navbar-form pull-left">
-                <input type="text" class="span2">
+                <input type="text" style="width: 200px;">
                 <button type="submit" class="btn">Submit</button>
               </form>
             </div>
           </div>{{! /example }}
 <pre class="prettyprint linenums">
-&lt;form class="navbar-form pull-left"&gt;
-  &lt;input type="text" class="span2"&gt;
+&lt;form class="pull-left"&gt;
+  &lt;input type="text" style="width: 200px;"&gt;
   &lt;button type="submit" class="btn"&gt;Submit&lt;/button&gt;
 &lt;/form&gt;
-</pre>
-
-          <h3>Search form</h3>
-          <p>For a more customized search form, add <code>.navbar-search</code> to the <code>form</code> and <code>.search-query</code> to the input for specialized styles in the navbar.</p>
-          <div class="bs-docs-example">
-            <div class="navbar">
-              <form class="navbar-search pull-left">
-                <input type="text" class="search-query" placeholder="Search">
-              </form>
-            </div>
-          </div>{{! /example }}
-<pre class="prettyprint linenums">
-&lt;form class="navbar-search pull-left"&gt;
-  &lt;input type="text" class="search-query" placeholder="Search"&gt;
-&lt;/form&gt;
 </pre>
 
           <h3>Component alignment</h3>
index 2fd0b843858749965da9f71cd0068dc2ad41ad47..3150af6773b554c3949875578e7e37daeeb93852 100644 (file)
     max-width: 940px;
   }
 
-  .navbar {
-    padding-top: 0;
-    padding-bottom: 0;
-  }
-  .navbar .brand {
-    float: left;
-    padding-top: 11px;
-    padding-bottom: 11px;
-    margin-left: -15px;
-  }
-  .navbar .nav {
-    overflow: hidden; /* clearfix */
-    margin-top: 0; /* undo top margin to make nav extend full height of navbar */
-  }
-  .navbar .nav > li {
-    float: left;
-  }
-  .navbar .nav > li > a {
-    padding-top: 10px;
-    padding-bottom: 10px;
-  }
-
-  /* Required to make the collapsing navbar work on regular desktops */
-  .navbar .btn-navbar {
-    display: none;
-  }
-  .nav-collapse.collapse {
-    float: left;
-    height: auto !important;
-    overflow: visible !important;
-  }
-
 }
 
 // Responsive: Large desktops and up
index 781218b444e4a6e222e1e788a91a2bcafe67f3e8..0415f217e5b632db42b90a7207cd9a6e6d3461e9 100644 (file)
@@ -55,11 +55,11 @@ input[type="search"],
 input[type="tel"],
 input[type="color"],
 .uneditable-input {
-  display: block;
+  display: inline-block;
   .box-sizing(border-box); // Makes inputs behave like true block-level elements
   min-height: @input-height; // Make inputs at least the height of their button counterpart (base line-height + padding + border)
   padding: 6px 9px;
-  margin-bottom: @line-height-base / 2;
+  // margin-bottom: @line-height-base / 2;
   font-size: @font-size-base;
   line-height: @line-height-base;
   color: @gray;
index b530495548f7c9a6c74e9770c1881ea76c783646..f00ad6b8e09c71cee99c03fe568da34aca912bce 100644 (file)
 // -------------------------
 // Vertically center elements in the navbar.
 // Example: an element has a height of 30px, so write out `.navbarVerticalAlign(30px);` to calculate the appropriate top margin.
-.navbarVerticalAlign(@element-height) {
+.navbar-vertical-align(@element-height) {
   margin-top: (@navbar-height - @element-height) / 2;
+  margin-bottom: (@navbar-height - @element-height) / 2;
 }
 
 
index 30d7050e8b21bf79581be5ad85e9e12f87540c0d..4353e2a945af66a81a10e6b85d4890be81d89370 100644 (file)
@@ -6,24 +6,31 @@
 .navbar {
   padding: 15px;
   background-color: @navbar-bg;
+  border-radius: @border-radius-base;
+  // Prevent floats from breaking the navbar
   .clear_float();
 }
 
 // Brand/project name
+// -------------------------
+
 .navbar .brand {
   display: inline-block;
-  padding: 7px 15px;
+  padding: ((@navbar-height - @line-height-base) / 2) 15px;
   font-size: 18px;
   font-weight: bold;
-  line-height: 1;
+  line-height: @line-height-base;
   color: @navbar-brand-color;
   &:hover {
+    color: @navbar-brand-color-hover;
     text-decoration: none;
-    background-color: #ddd;
+    background-color: @navbar-brand-bg-hover;
   }
 }
 
 // Responsive navbar button
+// -------------------------
+
 .btn-navbar {
   float: right;
   padding: 10px 12px;
   }
 }
 
-// Nav links
+// Navbar nav links
+// -------------------------
+
 .navbar {
   .nav {
     margin-top: 15px; // space out from .navbar .brand and .btn-navbar
   }
+  .nav > li {
+    float: left;
+  }
   .nav > li > a {
+    padding-top: (@navbar-height - @line-height-base) / 2;
+    padding-bottom: (@navbar-height - @line-height-base) / 2;
     color: @navbar-link-color;
     line-height: 20px;
   }
     background-color: @navbar-link-bg-active;
   }
 }
+@media screen and (min-width: 992px) {
+
+  .navbar {
+    padding-top: 0;
+    padding-bottom: 0;
+  }
+  .navbar .brand {
+    float: left;
+    margin-left: -15px;
+  }
+  .navbar .nav {
+    .clear_float();
+    margin-top: 0; // undo top margin to make nav extend full height of navbar
+  }
+
+  // Required to make the collapsing navbar work on regular desktops
+  .navbar .btn-navbar {
+    display: none;
+  }
+  .nav-collapse.collapse {
+    float: left;
+    height: auto !important;
+    overflow: visible !important;
+  }
+
+}
 
 // Inverse navbar
+// -------------------------
+
 .navbar-inverse {
     background-color: @navbar-inverse-bg;
 
 
 
 
+//
+// Navbar alignment options
+// --------------------------------------------------
+
+// Static navbar
+.navbar-static-top {
+  position: static;
+  border-radius: 0;
+}
+
+// Fixed navbar
+.navbar-fixed-top,
+.navbar-fixed-bottom {
+  position: fixed;
+  right: 0;
+  left: 0;
+  z-index: @zindex-navbar-fixed;
+  border-radius: 0;
+}
+.navbar-fixed-top    { top: 0; }
+.navbar-fixed-bottom { bottom: 0; }
+
+
+//
+// Navbar optional components
+// --------------------------------------------------
+
+// Dividers in navbar
+.navbar .divider-vertical {
+  height: 26px;
+  margin: 7px 9px;
+  border-left: 1px solid darken(@navbar-bg, 5%);
+  border-right: 1px solid lighten(@navbar-bg, 5%);
+}
+
+// Navbar form
+.navbar-form {
+  .navbar-vertical-align(32px); // Vertically center in navbar
+}
 
 /*
 
index e5327f3364052c634e60628a60a1c9c77b472808..a7069ddb426c04c0ec9d5859747f825a0c1b5ee5 100644 (file)
 // Navbar
 // -------------------------
 
-@navbar-collapse-width:            979px;
-@navbar-collapse-width-desktop:    @navbar-collapse-width + 1;
+// Responsive collapsing
+// @navbar-collapse-width:            979px;
+// @navbar-collapse-width-desktop:    @navbar-collapse-width + 1;
 
-@navbar-height:                    44px;
+// Basics of a navbar
+@navbar-height:                    50px;
+@navbar-text:                      #777;
 @navbar-bg:                        #eee;
 
-@navbar-text:                      #777;
+// Navbar brand label
+@navbar-brand-color:               @navbar-link-color;
+@navbar-brand-color-hover:         darken(@navbar-link-color, 10%);
+@navbar-brand-bg-hover:            transparent;
+
+// Navbar links
 @navbar-link-color:                #777;
-@navbar-link-color-hover:          @grayDark;
-@navbar-link-color-active:         @gray;
+@navbar-link-color-hover:          #333;
+@navbar-link-color-active:         #555;
 @navbar-link-bg-hover:             transparent;
-@navbar-link-bg-active:            darken(@navbar-bg, 5%);
+@navbar-link-bg-active:            darken(@navbar-bg, 10%);
+
 
-@navbar-brand-color:               @navbar-link-color;
 
 // Inverted navbar
 @navbar-inverse-bg:                         #222;