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

163 lines
2.8 KiB
SCSS
Raw Normal View History

// Base class
2012-06-29 00:46:45 -04:00
//
// Kickstart any navigation component with a set of style resets. Works with
// `<nav>`s or `<ul>`s.
2014-07-09 16:51:49 -04:00
.nav {
padding-left: 0;
2014-07-14 02:33:54 -04:00
margin-bottom: 0;
list-style: none;
2014-07-09 16:51:49 -04:00
}
.nav-link {
display: inline-block;
2014-07-09 16:51:49 -04:00
@include hover-focus {
2014-07-09 16:51:49 -04:00
text-decoration: none;
}
// Disabled state lightens text and removes hover/tab effects
&.disabled {
2014-12-02 17:02:35 -05:00
color: $nav-disabled-link-color;
2014-07-09 16:51:49 -04:00
@include plain-hover-focus {
2014-12-02 17:02:35 -05:00
color: $nav-disabled-link-hover-color;
cursor: $cursor-disabled;
background-color: transparent;
2014-07-09 16:51:49 -04:00
}
}
}
// Nav inline
.nav-inline {
.nav-item {
display: inline-block;
}
.nav-item + .nav-item,
.nav-link + .nav-link {
margin-left: 1rem;
}
}
//
2012-11-03 19:14:44 -04:00
// Tabs
//
.nav-tabs {
2014-12-02 17:02:35 -05:00
border-bottom: 1px solid $nav-tabs-border-color;
@include clearfix();
.nav-item {
2013-04-16 10:45:51 -04:00
float: left;
// Make the list-items overlay the bottom border
margin-bottom: -1px;
2013-04-16 10:45:51 -04:00
+ .nav-item {
margin-left: .2rem;
2013-04-16 10:45:51 -04:00
}
}
.nav-link {
display: block;
padding: $nav-link-padding;
border: $nav-tabs-link-border-width solid transparent;
@include border-radius($border-radius $border-radius 0 0);
2013-04-16 10:45:51 -04:00
@include hover-focus {
2014-12-02 17:02:35 -05:00
border-color: $nav-tabs-link-hover-border-color $nav-tabs-link-hover-border-color $nav-tabs-border-color;
2013-04-16 10:45:51 -04:00
}
&.disabled {
@include plain-hover-focus {
color: $nav-disabled-link-color;
background-color: transparent;
border-color: transparent;
}
}
}
2013-04-16 10:45:51 -04:00
.nav-link.active,
.nav-item.open .nav-link {
@include plain-hover-focus {
2014-12-02 17:02:35 -05:00
color: $nav-tabs-active-link-hover-color;
background-color: $nav-tabs-active-link-hover-bg;
border-color: $nav-tabs-active-link-hover-border-color $nav-tabs-active-link-hover-border-color transparent;
2013-04-16 10:45:51 -04:00
}
}
}
//
// Pills
//
.nav-pills {
@include clearfix();
.nav-item {
float: left;
+ .nav-item {
margin-left: .2rem;
}
}
.nav-link {
display: block;
padding: $nav-link-padding;
2014-12-02 17:02:35 -05:00
@include border-radius($nav-pills-border-radius);
}
.nav-link.active,
.nav-item.open .nav-link {
@include plain-hover-focus {
2014-12-02 17:02:35 -05:00
color: $component-active-color;
cursor: default;
background-color: $component-active-bg;
}
}
}
.nav-stacked {
.nav-item {
display: block;
float: none;
+ .nav-item {
margin-top: .2rem;
margin-left: 0;
}
}
}
//
// Tabbable tabs
//
// Hide tabbable panes to start, show them when `.active`
.tab-content {
> .tab-pane {
display: none;
}
2013-07-07 00:51:47 -04:00
> .active {
display: block;
}
}
//
// Dropdowns
//
.nav-tabs .dropdown-menu {
// Make dropdown border overlap tab border
margin-top: -1px;
2012-11-03 19:14:44 -04:00
// Remove the top rounded corners here since there is a hard edge above the menu
2014-12-02 17:02:35 -05:00
@include border-top-radius(0);
}