0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-28 10:24:19 +01:00
Bootstrap/less/navs.less

253 lines
4.7 KiB
Plaintext
Raw Normal View History

2012-06-29 06:46:45 +02:00
//
// Navs
// --------------------------------------------------
2012-11-04 00:14:44 +01:00
// Base class
// -------------------------
.nav {
margin-left: 0;
margin-bottom: @baseLineHeight;
list-style: none;
2012-11-04 00:14:44 +01:00
.clearfix();
}
.nav > li {
float: left;
}
.nav > li > a {
display: block;
2012-11-04 00:14:44 +01:00
padding: 8px 12px;
}
.nav > li > a:hover {
text-decoration: none;
2012-01-22 00:24:06 +01:00
background-color: @grayLighter;
}
// Redeclare pull classes because of specifity
.nav > .pull-right {
float: right;
}
// Nav headers (for dropdowns and lists)
2012-07-18 07:40:38 +02:00
.nav-header {
display: block;
padding: 3px 15px;
font-size: 11px;
font-weight: bold;
line-height: @baseLineHeight;
color: @grayLight;
text-shadow: 0 1px 0 rgba(255,255,255,.5);
text-transform: uppercase;
}
// Space them out when they follow another list item (link)
.nav li + .nav-header {
margin-top: 9px;
}
// Dividers (basically an hr) within the dropdown
.nav .divider {
.nav-divider();
}
2012-11-04 00:14:44 +01:00
// Tabs
// -------------------------
// Give the tabs something to sit on
.nav-tabs {
border-bottom: 1px solid #ddd;
}
// Make the list-items overlay the bottom border
.nav-tabs > li {
margin-bottom: -1px;
}
// Actual tabs (as links)
.nav-tabs > li > a {
2012-11-04 00:14:44 +01:00
margin-right: 2px;
line-height: @baseLineHeight;
border: 1px solid transparent;
border-radius: 4px 4px 0 0;
&:hover {
2012-01-22 00:24:06 +01:00
border-color: @grayLighter @grayLighter #ddd;
}
}
// Active state, and it's :hover to override normal :hover
.nav-tabs > .active > a,
.nav-tabs > .active > a:hover {
color: @gray;
2012-09-13 21:16:18 +02:00
background-color: @bodyBackground;
border: 1px solid #ddd;
border-bottom-color: transparent;
cursor: default;
}
2012-11-04 00:14:44 +01:00
// Lists
// -------------------------
.nav-list {
background-color: #fff;
border-radius: 6px;
.box-shadow(0 1px 4px rgba(0,0,0,.065))
}
.nav-list > li {
float: none;
}
.nav-list > li > a {
margin-bottom: -1px; // pull up the following link for a 1px border between
border: 1px solid #e5e5e5;
}
.nav-list > li > a:hover {
background-color: #f5f5f5;
}
.nav-list > li:first-child > a {
border-radius: 6px 6px 0 0;
}
.nav-list > li:last-child > a {
border-radius: 0 0 6px 6px;
}
.nav-list > .active > a,
.nav-list > .active > a:hover {
position: relative;
z-index: 2;
padding: 9px 15px;
color: #fff;
text-shadow: 0 1px 0 rgba(0,0,0,.15);
background-color: @linkColor;
border-width: 0;
.box-shadow(~"inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1)")
}
// Pills
// -------------------------
// Links rendered as pills
.nav-pills > li > a {
border-radius: 5px;
}
2012-11-04 00:14:44 +01:00
.nav-pills > li + li > a {
margin-left: 2px;
}
// Active state
.nav-pills > .active > a,
.nav-pills > .active > a:hover {
color: @white;
background-color: @linkColor;
}
2012-11-04 00:14:44 +01:00
// Stacked pills
.nav-stacked > li {
float: none;
}
2012-11-04 00:14:44 +01:00
.nav-stacked > li + li > a {
margin-top: 2px;
margin-left: 0; // no need for the gap between nav items
}
2012-11-04 00:14:44 +01:00
// Dropdowns
// -------------------------
.nav-tabs .dropdown-menu {
2012-11-04 00:14:44 +01:00
// Remove the top rounded corners here since there is a hard edge above the menu
.border-top-radius(0);
}
// Default dropdown links
// -------------------------
// Make carets use linkColor to start
2012-06-25 05:42:31 +02:00
.nav .dropdown-toggle .caret {
border-top-color: @linkColor;
border-bottom-color: @linkColor;
2012-11-04 00:14:44 +01:00
margin-top: 8px;
}
2012-06-25 05:42:31 +02:00
.nav .dropdown-toggle:hover .caret {
border-top-color: @linkColorHover;
border-bottom-color: @linkColorHover;
}
// Active dropdown links
// -------------------------
2012-06-25 05:42:31 +02:00
.nav .active .dropdown-toggle .caret {
border-top-color: #fff;
border-bottom-color: #fff;
}
.nav-tabs .active .dropdown-toggle .caret {
border-top-color: @gray;
border-bottom-color: @gray;
}
// Active:hover dropdown links
// -------------------------
.nav > .dropdown.active > a:hover {
cursor: pointer;
}
// Open dropdowns
// -------------------------
.nav-tabs .open .dropdown-toggle,
.nav-pills .open .dropdown-toggle,
.nav > li.dropdown.open.active > a:hover {
2012-01-22 00:24:06 +01:00
color: @white;
background-color: @grayLight;
border-color: @grayLight;
}
.nav li.dropdown.open .caret,
.nav li.dropdown.open.active .caret,
.nav li.dropdown.open a:hover .caret {
2012-01-22 00:24:06 +01:00
border-top-color: @white;
border-bottom-color: @white;
.opacity(100);
}
// Dropdowns in stacked tabs
.tabs-stacked .open > a:hover {
2012-01-22 00:24:06 +01:00
border-color: @grayLight;
}
2012-11-04 00:14:44 +01:00
// Tabbable tabs
// -------------------------
// Clear any floats
.tabbable {
.clearfix();
}
2012-02-12 02:27:08 +01:00
.tab-content {
overflow: auto; // prevent content from running below tabs
2012-02-12 02:27:08 +01:00
}
// Show/hide tabbable areas
.tab-content > .tab-pane,
.pill-content > .pill-pane {
display: none;
}
.tab-content > .active,
.pill-content > .active {
display: block;
}
2012-11-04 00:14:44 +01:00
// Disabled state
// -------------------------
// Gray out text
.nav > .disabled > a {
color: @grayLight;
}
// Nuke hover effects
.nav > .disabled > a:hover {
text-decoration: none;
background-color: transparent;
cursor: default;
}