aboutsummaryrefslogtreecommitdiff
path: root/less
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2013-01-17 11:34:46 -0800
committerMark Otto <[email protected]>2013-01-17 11:34:46 -0800
commit597a248d4ac8bf873d3227c2db285877061ed7b8 (patch)
tree84ade3b03766a7cbd7f1ed343bb0afb129aa764c /less
parent360f0c5359917d3a54d4822a7cc348ef787fef12 (diff)
downloadbootstrap-597a248d4ac8bf873d3227c2db285877061ed7b8.tar.xz
bootstrap-597a248d4ac8bf873d3227c2db285877061ed7b8.zip
Rearrange navbar.less and improve vertical divider support
Diffstat (limited to 'less')
-rw-r--r--less/navbar.less200
1 files changed, 104 insertions, 96 deletions
diff --git a/less/navbar.less b/less/navbar.less
index be2073fa2..7484becbd 100644
--- a/less/navbar.less
+++ b/less/navbar.less
@@ -11,9 +11,63 @@
.clear_float();
}
-// Brand/project name
+// Navbar nav links
// -------------------------
+.navbar {
+ .nav {
+ margin-top: 15px; // space out from .navbar .brand and .btn-navbar
+ }
+ .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;
+ }
+ .nav > li > a:hover,
+ .nav > li > a:focus {
+ color: @navbar-link-color-hover;
+ background-color: @navbar-link-bg-hover;
+ }
+ .nav > .active > a,
+ .nav > .active > a:hover,
+ .nav > .active > a:focus {
+ color: @navbar-link-color-active;
+ background-color: @navbar-link-bg-active;
+ }
+}
+
+
+
+//
+// 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
+// --------------------------------------------------
+
+// Brand/project name
.navbar .brand {
display: inline-block;
padding: 7px 15px;
@@ -28,9 +82,7 @@
}
}
-// Responsive navbar button
-// -------------------------
-
+// Collapsible navbar toggle
.btn-navbar {
float: right;
padding: 10px 12px;
@@ -51,68 +103,23 @@
}
}
-// Navbar nav links
-// -------------------------
-
-.navbar {
- .nav {
- margin-top: 15px; // space out from .navbar .brand and .btn-navbar
- }
- .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;
- }
- .nav > li > a:hover,
- .nav > li > a:focus {
- color: @navbar-link-color-hover;
- background-color: @navbar-link-bg-hover;
- }
- .nav > .active > a,
- .nav > .active > a:hover,
- .nav > .active > a:focus {
- color: @navbar-link-color-active;
- background-color: @navbar-link-bg-active;
- }
+// Dividers in navbar
+.navbar .divider-vertical {
+ height: @navbar-height * .6;
+ margin: (@navbar-height * .2) 9px;
+ border-left: 1px solid darken(@navbar-bg, 5%);
+ border-right: 1px solid lighten(@navbar-bg, 5%);
}
-@media screen and (min-width: 768px) {
- .navbar {
- padding-top: 0;
- padding-bottom: 0;
- }
- .navbar .brand {
- float: left;
- padding-top: (@navbar-height - @line-height-base) / 2;
- padding-bottom: (@navbar-height - @line-height-base) / 2;
- margin-left: -15px;
- }
- .navbar .nav {
- float: left;
- margin-top: 0; // undo top margin to make nav extend full height of navbar
- .clear_float();
+// Navbar form
+.navbar-form {
+ .navbar-vertical-align(32px); // Vertically center in navbar
+}
- &.pull-right {
- float: right;
- }
- }
- .navbar .nav > li {
- float: left;
- }
- // Required to make the collapsing navbar work on regular desktops
- .navbar .btn-navbar {
- display: none;
- }
- .nav-collapse.collapse {
- height: auto !important;
- overflow: visible !important;
- }
-}
// Inverse navbar
-// -------------------------
+// --------------------------------------------------
.navbar-inverse {
background-color: @navbar-inverse-bg;
@@ -143,54 +150,55 @@
color: @navbar-inverse-link-color-active;
background-color: @navbar-inverse-link-bg-active;
}
+
.btn-navbar {
background-color: #444;
}
-}
-
-
-//
-// Navbar alignment options
-// --------------------------------------------------
-
-// Static navbar
-.navbar-static-top {
- position: static;
- border-radius: 0;
+ .divider-vertical {
+ border-left-color: darken(@navbar-inverse-bg, 5%);
+ border-right-color: lighten(@navbar-inverse-bg, 5%);
+ }
}
-// 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
+// Inverse navbar
// --------------------------------------------------
-// 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
-}
+@media screen and (min-width: 768px) {
+ .navbar {
+ padding-top: 0;
+ padding-bottom: 0;
+ }
+ .navbar .brand {
+ float: left;
+ padding-top: (@navbar-height - @line-height-base) / 2;
+ padding-bottom: (@navbar-height - @line-height-base) / 2;
+ margin-left: -15px;
+ }
+ .navbar .nav {
+ float: left;
+ margin-top: 0; // undo top margin to make nav extend full height of navbar
+ .clear_float();
+ &.pull-right {
+ float: right;
+ }
+ }
+ .navbar .nav > li {
+ float: left;
+ }
+ // Required to make the collapsing navbar work on regular desktops
+ .navbar .btn-navbar {
+ display: none;
+ }
+ .nav-collapse.collapse {
+ height: auto !important;
+ overflow: visible !important;
+ }
+}
/*