twbs--bootstrap/scss/_nav.scss

128 lines
2.3 KiB
SCSS
Raw Normal View History

// Base class
2012-06-29 04:46:45 +00:00
//
// Kickstart any navigation component with a set of style resets. Works with
2019-03-07 12:38:33 +00:00
// `<nav>`s, `<ul>`s or `<ol>`s.
2014-07-09 20:51:49 +00:00
.nav {
display: flex;
flex-wrap: wrap;
padding-left: 0;
2014-07-14 06:33:54 +00:00
margin-bottom: 0;
list-style: none;
2014-07-09 20:51:49 +00:00
}
.nav-link {
display: block;
padding: $nav-link-padding-y $nav-link-padding-x;
@include font-size($nav-link-font-size);
font-weight: $nav-link-font-weight;
color: $nav-link-color;
text-decoration: if($link-decoration == none, null, none);
2020-04-06 11:29:39 +00:00
@include transition($nav-link-transition);
2014-07-09 20:51:49 +00:00
&:hover,
&:focus {
color: $nav-link-hover-color;
text-decoration: if($link-hover-decoration == underline, none, null);
2014-07-09 20:51:49 +00:00
}
2017-04-10 21:07:44 +00:00
// Disabled state lightens text
&.disabled {
color: $nav-link-disabled-color;
pointer-events: none;
cursor: default;
2014-07-09 20:51:49 +00:00
}
}
//
2012-11-03 23:14:44 +00:00
// Tabs
//
.nav-tabs {
border-bottom: $nav-tabs-border-width solid $nav-tabs-border-color;
.nav-link {
margin-bottom: -$nav-tabs-border-width;
border: $nav-tabs-border-width solid transparent;
@include border-top-radius($nav-tabs-border-radius);
2013-04-16 14:45:51 +00:00
&:hover,
&:focus {
border-color: $nav-tabs-link-hover-border-color;
2013-04-16 14:45:51 +00:00
}
&.disabled {
color: $nav-link-disabled-color;
background-color: transparent;
border-color: transparent;
}
}
2013-04-16 14:45:51 +00:00
.nav-link.active,
.nav-item.show .nav-link {
color: $nav-tabs-link-active-color;
background-color: $nav-tabs-link-active-bg;
border-color: $nav-tabs-link-active-border-color;
2013-04-16 14:45:51 +00:00
}
.dropdown-menu {
// Make dropdown border overlap tab border
margin-top: -$nav-tabs-border-width;
// Remove the top rounded corners here since there is a hard edge above the menu
@include border-top-radius(0);
}
}
//
// Pills
//
.nav-pills {
.nav-link {
2014-12-02 22:02:35 +00:00
@include border-radius($nav-pills-border-radius);
}
.nav-link.active,
.show > .nav-link {
color: $nav-pills-link-active-color;
@include gradient-bg($nav-pills-link-active-bg);
}
}
//
// Justified variants
//
.nav-fill {
> .nav-link,
.nav-item {
flex: 1 1 auto;
text-align: center;
}
}
.nav-justified {
> .nav-link,
.nav-item {
flex-basis: 0;
2017-03-20 00:47:53 +00:00
flex-grow: 1;
text-align: center;
}
}
// Tabbable tabs
//
// Hide tabbable panes to start, show them when `.active`
.tab-content {
> .tab-pane {
display: none;
}
2013-07-07 04:51:47 +00:00
> .active {
display: block;
}
}