mirror of
https://github.com/twbs/bootstrap.git
synced 2024-11-29 11:24:18 +01:00
244 lines
4.8 KiB
Plaintext
244 lines
4.8 KiB
Plaintext
// NAVBAR (FIXED AND STATIC)
|
|
// -------------------------
|
|
|
|
// Navbar variables
|
|
@navBarHeight: 40px;
|
|
@navBarBgStart: #333;
|
|
@navBarBgEnd: #222;
|
|
|
|
// Common styles
|
|
.navbar {
|
|
overflow: visible;
|
|
}
|
|
// gradient is applied to it's own element because overflow visible is not honored by ie when filter is present
|
|
.navbar-inner {
|
|
background-color: @navBarBgEnd;
|
|
#gradient > .vertical(@navBarBgStart, @navBarBgEnd);
|
|
@shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.1);
|
|
.box-shadow(@shadow);
|
|
}
|
|
// Text and links
|
|
.navbar {
|
|
// Hover and active states
|
|
.brand:hover,
|
|
.nav .active > a {
|
|
color: @white;
|
|
text-decoration: none;
|
|
background-color: @navBarBgStart;
|
|
background-color: rgba(255,255,255,.05);
|
|
}
|
|
// Website or project name
|
|
.brand {
|
|
float: left;
|
|
display: block;
|
|
padding: 8px 20px 12px;
|
|
margin-left: -20px; // negative indent to left-align the text down the page
|
|
font-size: 20px;
|
|
font-weight: 200;
|
|
line-height: 1;
|
|
color: @white;
|
|
}
|
|
// Plain text in topbar
|
|
p {
|
|
margin: 0;
|
|
line-height: 40px;
|
|
a:hover {
|
|
color: @white;
|
|
background-color: transparent;
|
|
}
|
|
}
|
|
// Buttons in navbar
|
|
.btn {
|
|
margin-top: 5px; // make buttons vertically centered in navbar
|
|
}
|
|
}
|
|
|
|
// Navbar forms
|
|
.navbar-form {
|
|
margin-bottom: 0; // remove default bottom margin
|
|
input,
|
|
select {
|
|
display: inline-block;
|
|
margin-bottom: 0;
|
|
}
|
|
}
|
|
|
|
// Navbar search
|
|
.navbar-search {
|
|
position: relative;
|
|
float: left;
|
|
margin-top: 6px;
|
|
margin-bottom: 0;
|
|
.search-query {
|
|
padding: 4px 9px;
|
|
#font > .sans-serif(13px, normal, 1);
|
|
color: @white;
|
|
color: rgba(255,255,255,.75);
|
|
background-color: #444;
|
|
background-color: rgba(255,255,255,.3);
|
|
border: 1px solid #111;
|
|
@shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0px rgba(255,255,255,.15);
|
|
.box-shadow(@shadow);
|
|
.transition(none);
|
|
|
|
// Placeholder text gets special styles; can't be bundled together though for some reason
|
|
&:-moz-placeholder {
|
|
color: @grayLighter;
|
|
}
|
|
&::-webkit-input-placeholder {
|
|
color: @grayLighter;
|
|
}
|
|
// Hover states
|
|
&:hover {
|
|
color: @white;
|
|
background-color: @grayLight;
|
|
background-color: rgba(255,255,255,.5);
|
|
}
|
|
// Focus states (we use .focused since IE8 and down doesn't support :focus)
|
|
&:focus,
|
|
&.focused {
|
|
padding: 5px 10px;
|
|
color: @grayDark;
|
|
text-shadow: 0 1px 0 @white;
|
|
background-color: @white;
|
|
border: 0;
|
|
.box-shadow(0 0 3px rgba(0,0,0,.15));
|
|
outline: 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
// Static navbar
|
|
.navbar-static {
|
|
margin-bottom: @baseLineHeight;
|
|
}
|
|
.navbar-static .navbar-inner {
|
|
padding-left: 20px;
|
|
padding-right: 20px;
|
|
.border-radius(4px);
|
|
}
|
|
|
|
// Fixed navbar
|
|
.navbar-fixed {
|
|
position: fixed;
|
|
top: 0;
|
|
right: 0;
|
|
left: 0;
|
|
z-index: @zindexFixedNavbar;
|
|
}
|
|
|
|
|
|
|
|
// NAVIGATION
|
|
// ----------
|
|
|
|
.navbar .nav {
|
|
position: relative;
|
|
left: 0;
|
|
display: block;
|
|
float: left;
|
|
margin: 0 10px 0 0;
|
|
}
|
|
.navbar .nav.pull-right {
|
|
float: right; // redeclare due to specificity
|
|
}
|
|
.navbar .nav > li {
|
|
display: block;
|
|
float: left;
|
|
}
|
|
|
|
// Links
|
|
.navbar .nav > li > a {
|
|
float: none;
|
|
padding: 10px 10px 11px;
|
|
line-height: 19px;
|
|
color: @grayLight;
|
|
text-decoration: none;
|
|
text-shadow: 0 -1px 0 rgba(0,0,0,.25);
|
|
}
|
|
// Hover
|
|
.navbar .nav > li > a:hover {
|
|
background-color: transparent;
|
|
color: @white;
|
|
text-decoration: none;
|
|
}
|
|
|
|
// Active nav items
|
|
.navbar .nav .active > a {
|
|
background-color: #222;
|
|
background-color: rgba(0,0,0,.5);
|
|
}
|
|
|
|
// Dividers (basically a vertical hr)
|
|
.navbar .vertical-divider {
|
|
height: 40px;
|
|
width: 1px;
|
|
margin: 0 5px;
|
|
overflow: hidden;
|
|
background-color: #222;
|
|
border-right: 1px solid #444;
|
|
}
|
|
|
|
// Secondary (floated right) nav in topbar
|
|
.navbar .nav.pull-right {
|
|
margin-left: 10px;
|
|
margin-right: 0;
|
|
}
|
|
|
|
|
|
|
|
// Dropdown menus
|
|
// --------------
|
|
|
|
// Menu position and menu carets
|
|
.navbar .dropdown-menu {
|
|
top: 42px;
|
|
.border-radius(4px);
|
|
&:before {
|
|
content: '';
|
|
display: inline-block;
|
|
border-left: 7px solid transparent;
|
|
border-right: 7px solid transparent;
|
|
border-bottom: 7px solid #ccc;
|
|
border-bottom-color: rgba(0,0,0,.1);
|
|
position: absolute;
|
|
top: -7px;
|
|
left: 12px;
|
|
}
|
|
&:after {
|
|
content: '';
|
|
display: inline-block;
|
|
border-left: 6px solid transparent;
|
|
border-right: 6px solid transparent;
|
|
border-bottom: 6px solid #fff;
|
|
position: absolute;
|
|
top: -6px;
|
|
left: 13px;
|
|
}
|
|
}
|
|
|
|
// Dropdown toggle caret
|
|
.navbar .dropdown-toggle .caret,
|
|
.navbar .open.dropdown .caret {
|
|
border-top-color: #fff;
|
|
}
|
|
|
|
// Remove background color from open dropdown
|
|
.navbar .open .dropdown-toggle {
|
|
background-color: transparent;
|
|
}
|
|
|
|
// Right aligned menus need alt position
|
|
.navbar .nav.pull-right .dropdown-menu {
|
|
right: 0;
|
|
&:before {
|
|
left: auto;
|
|
right: 12px;
|
|
}
|
|
&:after {
|
|
left: auto;
|
|
right: 13px;
|
|
}
|
|
}
|