1
0
Fork 0
mirror of https://github.com/twbs/bootstrap.git synced 2022-11-09 12:25:43 -05:00

Rearrange navbar.less and improve vertical divider support

This commit is contained in:
Mark Otto 2013-01-17 11:34:46 -08:00
parent 360f0c5359
commit 597a248d4a
2 changed files with 222 additions and 209 deletions

View file

@ -2975,6 +2975,52 @@ button.close {
clear: both; clear: both;
} }
.navbar .nav {
margin-top: 15px;
}
.navbar .nav > li > a {
padding-top: 15px;
padding-bottom: 15px;
line-height: 20px;
color: #777777;
}
.navbar .nav > li > a:hover,
.navbar .nav > li > a:focus {
color: #333333;
background-color: transparent;
}
.navbar .nav > .active > a,
.navbar .nav > .active > a:hover,
.navbar .nav > .active > a:focus {
color: #555555;
background-color: #d5d5d5;
}
.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 .brand { .navbar .brand {
display: inline-block; display: inline-block;
padding: 7px 15px; padding: 7px 15px;
@ -3010,66 +3056,16 @@ button.close {
margin-top: 3px; margin-top: 3px;
} }
.navbar .nav { .navbar .divider-vertical {
margin-top: 15px; height: 30px;
margin: 10px 9px;
border-right: 1px solid #fbfbfb;
border-left: 1px solid #e1e1e1;
} }
.navbar .nav > li > a { .navbar-form {
padding-top: 15px; margin-top: 9px;
padding-bottom: 15px; margin-bottom: 9px;
line-height: 20px;
color: #777777;
}
.navbar .nav > li > a:hover,
.navbar .nav > li > a:focus {
color: #333333;
background-color: transparent;
}
.navbar .nav > .active > a,
.navbar .nav > .active > a:hover,
.navbar .nav > .active > a:focus {
color: #555555;
background-color: #d5d5d5;
}
@media screen and (min-width: 768px) {
.navbar {
padding-top: 0;
padding-bottom: 0;
}
.navbar .brand {
float: left;
padding-top: 15px;
padding-bottom: 15px;
margin-left: -15px;
}
.navbar .nav {
float: left;
margin-top: 0;
}
.navbar .nav:before,
.navbar .nav:after {
display: table;
content: " ";
}
.navbar .nav:after {
clear: both;
}
.navbar .nav.pull-right {
float: right;
}
.navbar .nav > li {
float: left;
}
.navbar .btn-navbar {
display: none;
}
.nav-collapse.collapse {
height: auto !important;
overflow: visible !important;
}
} }
.navbar-inverse { .navbar-inverse {
@ -3110,38 +3106,47 @@ button.close {
background-color: #444; background-color: #444;
} }
.navbar-static-top { .navbar-inverse .divider-vertical {
position: static; border-right-color: #2f2f2f;
border-radius: 0; border-left-color: #151515;
} }
.navbar-fixed-top, @media screen and (min-width: 768px) {
.navbar-fixed-bottom { .navbar {
position: fixed; padding-top: 0;
right: 0; padding-bottom: 0;
left: 0; }
z-index: 1030; .navbar .brand {
border-radius: 0; float: left;
} padding-top: 15px;
padding-bottom: 15px;
.navbar-fixed-top { margin-left: -15px;
top: 0; }
} .navbar .nav {
float: left;
.navbar-fixed-bottom { margin-top: 0;
bottom: 0; }
} .navbar .nav:before,
.navbar .nav:after {
.navbar .divider-vertical { display: table;
height: 26px; content: " ";
margin: 7px 9px; }
border-right: 1px solid #fbfbfb; .navbar .nav:after {
border-left: 1px solid #e1e1e1; clear: both;
} }
.navbar .nav.pull-right {
.navbar-form { float: right;
margin-top: 9px; }
margin-bottom: 9px; .navbar .nav > li {
float: left;
}
.navbar .btn-navbar {
display: none;
}
.nav-collapse.collapse {
height: auto !important;
overflow: visible !important;
}
} }
/* /*

View file

@ -11,46 +11,6 @@
.clear_float(); .clear_float();
} }
// Brand/project name
// -------------------------
.navbar .brand {
display: inline-block;
padding: 7px 15px;
font-size: 18px;
font-weight: bold;
line-height: @line-height-base;
color: @navbar-brand-color;
&:hover {
color: @navbar-brand-color-hover;
text-decoration: none;
background-color: @navbar-brand-bg-hover;
}
}
// Responsive navbar button
// -------------------------
.btn-navbar {
float: right;
padding: 10px 12px;
background-color: #ddd;
border: 0;
border-radius: 4px;
// Bars
.icon-bar {
display: block;
width: 20px;
height: 2px;
background-color: #fff;
border-radius: 1px;
}
.icon-bar + .icon-bar {
margin-top: 3px;
}
}
// Navbar nav links // Navbar nav links
// ------------------------- // -------------------------
@ -77,6 +37,135 @@
} }
} }
//
// 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;
font-size: 18px;
font-weight: bold;
line-height: @line-height-base;
color: @navbar-brand-color;
&:hover {
color: @navbar-brand-color-hover;
text-decoration: none;
background-color: @navbar-brand-bg-hover;
}
}
// Collapsible navbar toggle
.btn-navbar {
float: right;
padding: 10px 12px;
background-color: #ddd;
border: 0;
border-radius: 4px;
// Bars
.icon-bar {
display: block;
width: 20px;
height: 2px;
background-color: #fff;
border-radius: 1px;
}
.icon-bar + .icon-bar {
margin-top: 3px;
}
}
// 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%);
}
// Navbar form
.navbar-form {
.navbar-vertical-align(32px); // Vertically center in navbar
}
// Inverse navbar
// --------------------------------------------------
.navbar-inverse {
background-color: @navbar-inverse-bg;
.brand {
color: @navbar-inverse-brand-color;
&:hover {
color: @navbar-inverse-brand-color-hover;
background-color: @navbar-inverse-brand-bg-hover;
}
}
.navbar-text {
color: @navbar-inverse-text;
}
.nav > li > a {
color: @navbar-inverse-link-color;
}
.nav > li > a:hover,
.nav > li > a:focus {
color: @navbar-inverse-link-color-hover;
background-color: @navbar-inverse-link-bg-hover;
}
.nav > .active > a,
.nav > .active > a:hover,
.nav > .active > a:focus {
color: @navbar-inverse-link-color-active;
background-color: @navbar-inverse-link-bg-active;
}
.btn-navbar {
background-color: #444;
}
.divider-vertical {
border-left-color: darken(@navbar-inverse-bg, 5%);
border-right-color: lighten(@navbar-inverse-bg, 5%);
}
}
// Inverse navbar
// --------------------------------------------------
@media screen and (min-width: 768px) { @media screen and (min-width: 768px) {
.navbar { .navbar {
padding-top: 0; padding-top: 0;
@ -111,87 +200,6 @@
} }
} }
// Inverse navbar
// -------------------------
.navbar-inverse {
background-color: @navbar-inverse-bg;
.brand {
color: @navbar-inverse-brand-color;
&:hover {
color: @navbar-inverse-brand-color-hover;
background-color: @navbar-inverse-brand-bg-hover;
}
}
.navbar-text {
color: @navbar-inverse-text;
}
.nav > li > a {
color: @navbar-inverse-link-color;
}
.nav > li > a:hover,
.nav > li > a:focus {
color: @navbar-inverse-link-color-hover;
background-color: @navbar-inverse-link-bg-hover;
}
.nav > .active > a,
.nav > .active > a:hover,
.nav > .active > a:focus {
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;
}
// 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
}
/* /*
// Janky solution for now to account for links outside the .nav // Janky solution for now to account for links outside the .nav