2015-08-17 18:33:34 -07:00
|
|
|
// Base class
|
2012-06-28 21:46:45 -07:00
|
|
|
//
|
2015-08-17 18:33:34 -07:00
|
|
|
// Kickstart any navigation component with a set of style resets. Works with
|
2019-03-07 21:38:33 +09:00
|
|
|
// `<nav>`s, `<ul>`s or `<ol>`s.
|
2012-01-07 20:40:28 -08:00
|
|
|
|
2014-07-09 13:51:49 -07:00
|
|
|
.nav {
|
2022-03-28 15:05:37 -07:00
|
|
|
// scss-docs-start nav-css-vars
|
|
|
|
--#{$prefix}nav-link-padding-x: #{$nav-link-padding-x};
|
|
|
|
--#{$prefix}nav-link-padding-y: #{$nav-link-padding-y};
|
|
|
|
@include rfs($nav-link-font-size, --#{$prefix}nav-link-font-size);
|
2022-05-22 19:24:08 -07:00
|
|
|
--#{$prefix}nav-link-font-weight: #{$nav-link-font-weight};
|
2022-03-28 15:05:37 -07:00
|
|
|
--#{$prefix}nav-link-color: #{$nav-link-color};
|
|
|
|
--#{$prefix}nav-link-hover-color: #{$nav-link-hover-color};
|
|
|
|
--#{$prefix}nav-link-disabled-color: #{$nav-link-disabled-color};
|
|
|
|
// scss-docs-end nav-css-vars
|
|
|
|
|
2016-12-23 10:39:53 -08:00
|
|
|
display: flex;
|
2017-01-23 23:58:22 -08:00
|
|
|
flex-wrap: wrap;
|
2015-04-26 00:02:25 -07:00
|
|
|
padding-left: 0;
|
2014-07-13 23:33:54 -07:00
|
|
|
margin-bottom: 0;
|
2015-04-26 00:02:25 -07:00
|
|
|
list-style: none;
|
2014-07-09 13:51:49 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
.nav-link {
|
2016-12-23 10:39:53 -08:00
|
|
|
display: block;
|
2022-03-28 15:05:37 -07:00
|
|
|
padding: var(--#{$prefix}nav-link-padding-y) var(--#{$prefix}nav-link-padding-x);
|
|
|
|
@include font-size(var(--#{$prefix}nav-link-font-size));
|
|
|
|
font-weight: var(--#{$prefix}nav-link-font-weight);
|
|
|
|
color: var(--#{$prefix}nav-link-color);
|
2020-03-05 15:22:52 +01:00
|
|
|
text-decoration: if($link-decoration == none, null, none);
|
2020-04-06 13:29:39 +02:00
|
|
|
@include transition($nav-link-transition);
|
2014-07-09 13:51:49 -07:00
|
|
|
|
2018-09-18 02:10:07 +03:00
|
|
|
&:hover,
|
|
|
|
&:focus {
|
2022-03-28 15:05:37 -07:00
|
|
|
color: var(--#{$prefix}nav-link-hover-color);
|
2020-03-20 09:35:55 +01:00
|
|
|
text-decoration: if($link-hover-decoration == underline, none, null);
|
2014-07-09 13:51:49 -07:00
|
|
|
}
|
|
|
|
|
2017-04-10 22:07:44 +01:00
|
|
|
// Disabled state lightens text
|
2014-07-09 16:04:31 -07:00
|
|
|
&.disabled {
|
2022-03-28 15:05:37 -07:00
|
|
|
color: var(--#{$prefix}nav-link-disabled-color);
|
2018-11-05 01:47:14 +05:30
|
|
|
pointer-events: none;
|
|
|
|
cursor: default;
|
2014-07-09 13:51:49 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-07-09 16:04:31 -07:00
|
|
|
//
|
2012-11-03 16:14:44 -07:00
|
|
|
// Tabs
|
2014-07-09 16:04:31 -07:00
|
|
|
//
|
2012-01-07 20:40:28 -08:00
|
|
|
|
2012-01-30 21:29:50 -08:00
|
|
|
.nav-tabs {
|
2022-03-28 15:05:37 -07:00
|
|
|
// scss-docs-start nav-tabs-css-vars
|
|
|
|
--#{$prefix}nav-tabs-border-width: #{$nav-tabs-border-width};
|
|
|
|
--#{$prefix}nav-tabs-border-color: #{$nav-tabs-border-color};
|
|
|
|
--#{$prefix}nav-tabs-border-radius: #{$nav-tabs-border-radius};
|
|
|
|
--#{$prefix}nav-tabs-link-hover-border-color: #{$nav-tabs-link-hover-border-color};
|
|
|
|
--#{$prefix}nav-tabs-link-active-color: #{$nav-tabs-link-active-color};
|
|
|
|
--#{$prefix}nav-tabs-link-active-bg: #{$nav-tabs-link-active-bg};
|
|
|
|
--#{$prefix}nav-tabs-link-active-border-color: #{$nav-tabs-link-active-border-color};
|
|
|
|
// scss-docs-end nav-tabs-css-vars
|
|
|
|
|
|
|
|
border-bottom: var(--#{$prefix}nav-tabs-border-width) solid var(--#{$prefix}nav-tabs-border-color);
|
2014-07-09 16:04:31 -07:00
|
|
|
|
|
|
|
.nav-link {
|
2022-03-28 15:05:37 -07:00
|
|
|
margin-bottom: calc(var(--#{$prefix}nav-tabs-border-width) * -1); // stylelint-disable-line function-disallowed-list
|
2021-02-09 05:23:45 +00:00
|
|
|
background: none;
|
2022-03-28 15:05:37 -07:00
|
|
|
border: var(--#{$prefix}nav-tabs-border-width) solid transparent;
|
|
|
|
@include border-top-radius(var(--#{$prefix}nav-tabs-border-radius));
|
2013-04-16 16:45:51 +02:00
|
|
|
|
2018-09-18 02:10:07 +03:00
|
|
|
&:hover,
|
|
|
|
&:focus {
|
2021-02-09 05:23:45 +00:00
|
|
|
// Prevents active .nav-link tab overlapping focus outline of previous/next .nav-link
|
|
|
|
isolation: isolate;
|
2022-03-28 15:05:37 -07:00
|
|
|
border-color: var(--#{$prefix}nav-tabs-link-hover-border-color);
|
2013-04-16 16:45:51 +02:00
|
|
|
}
|
2015-08-18 20:25:31 -07:00
|
|
|
|
2022-05-06 04:26:15 +02:00
|
|
|
&.disabled,
|
|
|
|
&:disabled {
|
2022-03-28 15:05:37 -07:00
|
|
|
color: var(--#{$prefix}nav-link-disabled-color);
|
2016-12-28 00:03:06 -08:00
|
|
|
background-color: transparent;
|
|
|
|
border-color: transparent;
|
2015-08-18 20:25:31 -07:00
|
|
|
}
|
2014-07-09 16:04:31 -07:00
|
|
|
}
|
2013-04-16 16:45:51 +02:00
|
|
|
|
2015-08-18 20:25:31 -07:00
|
|
|
.nav-link.active,
|
2016-12-28 14:49:21 -08:00
|
|
|
.nav-item.show .nav-link {
|
2022-03-28 15:05:37 -07:00
|
|
|
color: var(--#{$prefix}nav-tabs-link-active-color);
|
|
|
|
background-color: var(--#{$prefix}nav-tabs-link-active-bg);
|
|
|
|
border-color: var(--#{$prefix}nav-tabs-link-active-border-color);
|
2013-04-16 16:45:51 +02:00
|
|
|
}
|
2016-01-06 15:51:23 -08:00
|
|
|
|
|
|
|
.dropdown-menu {
|
|
|
|
// Make dropdown border overlap tab border
|
2022-03-28 15:05:37 -07:00
|
|
|
margin-top: calc(var(--#{$prefix}nav-tabs-border-width) * -1); // stylelint-disable-line function-disallowed-list
|
2016-01-06 15:51:23 -08:00
|
|
|
// Remove the top rounded corners here since there is a hard edge above the menu
|
|
|
|
@include border-top-radius(0);
|
|
|
|
}
|
2012-11-04 00:52:10 -07:00
|
|
|
}
|
|
|
|
|
2013-01-17 17:02:35 -08:00
|
|
|
|
2014-07-09 16:04:31 -07:00
|
|
|
//
|
|
|
|
// Pills
|
|
|
|
//
|
2013-08-02 09:42:50 -07:00
|
|
|
|
2014-07-09 16:04:31 -07:00
|
|
|
.nav-pills {
|
2022-03-28 15:05:37 -07:00
|
|
|
// scss-docs-start nav-pills-css-vars
|
|
|
|
--#{$prefix}nav-pills-border-radius: #{$nav-pills-border-radius};
|
|
|
|
--#{$prefix}nav-pills-link-active-color: #{$nav-pills-link-active-color};
|
|
|
|
--#{$prefix}nav-pills-link-active-bg: #{$nav-pills-link-active-bg};
|
|
|
|
// scss-docs-end nav-pills-css-vars
|
|
|
|
|
2014-07-09 16:04:31 -07:00
|
|
|
.nav-link {
|
2021-02-09 05:23:45 +00:00
|
|
|
background: none;
|
|
|
|
border: 0;
|
2022-03-28 15:05:37 -07:00
|
|
|
@include border-radius(var(--#{$prefix}nav-pills-border-radius));
|
2022-05-06 04:26:15 +02:00
|
|
|
|
|
|
|
&:disabled {
|
|
|
|
color: var(--#{$prefix}nav-link-disabled-color);
|
|
|
|
background-color: transparent;
|
|
|
|
border-color: transparent;
|
|
|
|
}
|
2017-05-30 11:36:59 -07:00
|
|
|
}
|
2013-10-28 20:51:39 -07:00
|
|
|
|
2017-05-30 11:36:59 -07:00
|
|
|
.nav-link.active,
|
|
|
|
.show > .nav-link {
|
2022-03-28 15:05:37 -07:00
|
|
|
color: var(--#{$prefix}nav-pills-link-active-color);
|
|
|
|
@include gradient-bg(var(--#{$prefix}nav-pills-link-active-bg));
|
2013-08-16 14:01:32 -07:00
|
|
|
}
|
2013-08-02 09:42:50 -07:00
|
|
|
}
|
|
|
|
|
2016-12-23 10:40:54 -08:00
|
|
|
|
|
|
|
//
|
|
|
|
// Justified variants
|
|
|
|
//
|
|
|
|
|
|
|
|
.nav-fill {
|
2020-06-06 00:27:35 +05:30
|
|
|
> .nav-link,
|
2014-07-09 16:04:31 -07:00
|
|
|
.nav-item {
|
2016-12-23 10:40:54 -08:00
|
|
|
flex: 1 1 auto;
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
}
|
2013-08-26 17:37:52 -07:00
|
|
|
|
2016-12-23 10:40:54 -08:00
|
|
|
.nav-justified {
|
2020-06-06 00:27:35 +05:30
|
|
|
> .nav-link,
|
2016-12-23 10:40:54 -08:00
|
|
|
.nav-item {
|
2017-03-19 15:47:34 -07:00
|
|
|
flex-basis: 0;
|
2017-03-19 17:47:53 -07:00
|
|
|
flex-grow: 1;
|
2016-12-23 10:40:54 -08:00
|
|
|
text-align: center;
|
2013-08-02 09:42:50 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-26 11:59:28 +01:00
|
|
|
.nav-fill,
|
|
|
|
.nav-justified {
|
|
|
|
.nav-item .nav-link {
|
|
|
|
width: 100%; // Make sure button will grow
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-02 09:42:50 -07:00
|
|
|
|
2013-02-17 20:18:29 -08:00
|
|
|
// Tabbable tabs
|
2014-07-09 16:04:31 -07:00
|
|
|
//
|
2013-10-13 15:55:13 -07:00
|
|
|
// Hide tabbable panes to start, show them when `.active`
|
2016-12-23 10:40:54 -08:00
|
|
|
|
2013-10-13 15:55:13 -07:00
|
|
|
.tab-content {
|
|
|
|
> .tab-pane {
|
|
|
|
display: none;
|
|
|
|
}
|
2013-07-06 21:51:47 -07:00
|
|
|
> .active {
|
|
|
|
display: block;
|
|
|
|
}
|
2013-02-17 20:18:29 -08:00
|
|
|
}
|