.navbar-form:after {
clear: both;
}
+.navbar-form input,
+.navbar-form select,
+.navbar-form .radio,
+.navbar-form .checkbox {
+ margin-top: 5px;
+}
.navbar-form input, .navbar-form select {
display: inline-block;
- margin-top: 5px;
margin-bottom: 0;
}
-.navbar-form .radio, .navbar-form .checkbox {
- margin-top: 5px;
-}
.navbar-form input[type="image"], .navbar-form input[type="checkbox"], .navbar-form input[type="radio"] {
margin-top: 3px;
}
// COMPONENT MIXINS
// --------------------------------------------------
-// NAV DIVIDER
+// Horizontal dividers
// -------------------------
// Dividers (basically an hr) within dropdowns and nav lists
.nav-divider() {
*margin: -5px 0 5px;
}
-// BUTTON BACKGROUNDS
+// Button backgrounds
// ------------------
.buttonBackground(@startColor, @endColor) {
// gradientBar will set the background to a pleasing blend of these, to support IE<=9
}
}
-// POPOVER ARROWS
+// Navbar vertical align
+// -------------------------
+// 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(@elementHeight) {
+ margin-top: (@navbarHeight - @elementHeight) / 2;
+}
+
+// Popover arrows
// -------------------------
// For tipsies and popovers
#popoverArrow {
// Buttons in navbar
.btn,
.btn-group {
- margin-top: 5px; // make buttons vertically centered in navbar
+ .navbarVerticalAlign(30px); // Vertically center in navbar
}
.btn-group .btn {
margin-top: 0; // then undo the margin here so we don't accidentally double it
margin-bottom: 0; // remove default bottom margin
.clearfix();
input,
+ select,
+ .radio,
+ .checkbox {
+ .navbarVerticalAlign(30px); // Vertically center in navbar
+ }
+ input,
select {
display: inline-block;
- margin-top: 5px;
margin-bottom: 0;
}
- .radio,
- .checkbox {
- margin-top: 5px;
- }
input[type="image"],
input[type="checkbox"],
input[type="radio"] {
.navbar-search {
position: relative;
float: left;
- margin-top: 6px;
+ .navbarVerticalAlign(28px); // Vertically center in navbar
margin-bottom: 0;
.search-query {
padding: 4px 9px;