2015-11-27 20:12:37 -08:00
|
|
|
// The dropdown wrapper (`<div>`)
|
2015-01-18 13:39:40 -08:00
|
|
|
.dropup,
|
2018-03-13 02:44:05 +09:00
|
|
|
.dropright,
|
|
|
|
.dropdown,
|
|
|
|
.dropleft {
|
2013-08-01 20:07:34 +02:00
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
2014-07-08 14:23:34 -07:00
|
|
|
.dropdown-toggle {
|
2019-01-13 08:43:52 +01:00
|
|
|
white-space: nowrap;
|
|
|
|
|
2014-07-08 14:23:34 -07:00
|
|
|
// Generate the caret automatically
|
2019-07-24 08:41:18 +02:00
|
|
|
@include caret();
|
2013-08-12 21:23:28 -07:00
|
|
|
}
|
|
|
|
|
2015-11-27 20:12:37 -08:00
|
|
|
// The dropdown menu
|
2011-12-21 16:22:20 -06:00
|
|
|
.dropdown-menu {
|
|
|
|
position: absolute;
|
2012-01-18 14:02:18 +01:00
|
|
|
top: 100%;
|
2012-01-27 16:06:58 -05:00
|
|
|
left: 0;
|
2014-12-02 14:02:35 -08:00
|
|
|
z-index: $zindex-dropdown;
|
2012-01-07 03:45:24 -08:00
|
|
|
display: none; // none by default, but block on "open" of the menu
|
2012-04-16 16:34:08 -07:00
|
|
|
float: left;
|
2016-02-16 00:42:10 -08:00
|
|
|
min-width: $dropdown-min-width;
|
2020-09-21 16:27:26 -07:00
|
|
|
padding: $dropdown-padding-y $dropdown-padding-x;
|
2017-07-31 11:45:51 -07:00
|
|
|
margin: $dropdown-spacer 0 0; // override default ul
|
2019-02-07 23:32:05 +01:00
|
|
|
@include font-size($dropdown-font-size);
|
2019-01-20 22:38:29 +01:00
|
|
|
color: $dropdown-color;
|
2014-03-24 20:02:56 -07:00
|
|
|
text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer)
|
2014-12-11 12:05:29 -08:00
|
|
|
list-style: none;
|
2014-12-02 14:02:35 -08:00
|
|
|
background-color: $dropdown-bg;
|
2014-12-11 12:05:29 -08:00
|
|
|
background-clip: padding-box;
|
2015-11-14 22:30:16 -08:00
|
|
|
border: $dropdown-border-width solid $dropdown-border-color;
|
2017-10-22 17:47:31 -03:00
|
|
|
@include border-radius($dropdown-border-radius);
|
2016-01-09 15:31:29 -08:00
|
|
|
@include box-shadow($dropdown-box-shadow);
|
2015-08-17 11:21:10 -07:00
|
|
|
}
|
2011-12-21 16:22:20 -06:00
|
|
|
|
2018-10-21 17:01:22 +09:00
|
|
|
@each $breakpoint in map-keys($grid-breakpoints) {
|
|
|
|
@include media-breakpoint-up($breakpoint) {
|
|
|
|
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
|
|
|
|
|
|
|
|
.dropdown-menu#{$infix}-left {
|
|
|
|
right: auto;
|
|
|
|
left: 0;
|
|
|
|
}
|
2019-01-07 10:12:51 +09:00
|
|
|
|
|
|
|
.dropdown-menu#{$infix}-right {
|
|
|
|
right: 0;
|
|
|
|
left: auto;
|
|
|
|
}
|
2018-10-21 17:01:22 +09:00
|
|
|
}
|
2018-03-13 02:44:05 +09:00
|
|
|
}
|
|
|
|
|
2017-10-10 16:46:43 +03:00
|
|
|
// Allow for dropdowns to go bottom up (aka, dropup-menu)
|
|
|
|
// Just add .dropup after the standard .dropdown class and you're set.
|
|
|
|
.dropup {
|
|
|
|
.dropdown-menu {
|
2018-03-13 02:44:05 +09:00
|
|
|
top: auto;
|
|
|
|
bottom: 100%;
|
2017-10-10 16:46:43 +03:00
|
|
|
margin-top: 0;
|
|
|
|
margin-bottom: $dropdown-spacer;
|
|
|
|
}
|
|
|
|
|
|
|
|
.dropdown-toggle {
|
|
|
|
@include caret(up);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-29 23:29:13 +01:00
|
|
|
.dropright {
|
|
|
|
.dropdown-menu {
|
2018-03-13 02:44:05 +09:00
|
|
|
top: 0;
|
|
|
|
right: auto;
|
|
|
|
left: 100%;
|
2017-10-29 23:29:13 +01:00
|
|
|
margin-top: 0;
|
|
|
|
margin-left: $dropdown-spacer;
|
|
|
|
}
|
|
|
|
|
|
|
|
.dropdown-toggle {
|
|
|
|
@include caret(right);
|
|
|
|
&::after {
|
|
|
|
vertical-align: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.dropleft {
|
|
|
|
.dropdown-menu {
|
2018-03-13 02:44:05 +09:00
|
|
|
top: 0;
|
|
|
|
right: 100%;
|
|
|
|
left: auto;
|
2017-10-29 23:29:13 +01:00
|
|
|
margin-top: 0;
|
|
|
|
margin-right: $dropdown-spacer;
|
|
|
|
}
|
|
|
|
|
|
|
|
.dropdown-toggle {
|
|
|
|
@include caret(left);
|
|
|
|
&::before {
|
|
|
|
vertical-align: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-21 21:51:49 +02:00
|
|
|
// When Popper is enabled, reset the basic dropdown position
|
2018-10-22 20:57:09 +02:00
|
|
|
// stylelint-disable-next-line no-duplicate-selectors
|
2018-03-13 02:44:05 +09:00
|
|
|
.dropdown-menu {
|
|
|
|
&[x-placement^="top"],
|
|
|
|
&[x-placement^="right"],
|
|
|
|
&[x-placement^="bottom"],
|
|
|
|
&[x-placement^="left"] {
|
|
|
|
right: auto;
|
|
|
|
bottom: auto;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-27 20:12:37 -08:00
|
|
|
// Dividers (basically an `<hr>`) within the dropdown
|
2015-08-17 11:21:10 -07:00
|
|
|
.dropdown-divider {
|
2019-08-21 10:38:14 +02:00
|
|
|
@include nav-divider($dropdown-divider-bg, $dropdown-divider-margin-y, true);
|
2012-01-08 01:50:12 -08:00
|
|
|
}
|
2012-01-08 00:49:38 -08:00
|
|
|
|
2015-08-17 11:19:14 -07:00
|
|
|
// Links, buttons, and more within the dropdown menu
|
2015-08-23 01:12:00 -07:00
|
|
|
//
|
2015-11-27 20:12:37 -08:00
|
|
|
// `<button>`-specific styles are denoted with `// For <button>s`
|
2015-08-17 11:19:14 -07:00
|
|
|
.dropdown-item {
|
|
|
|
display: block;
|
2015-08-23 01:12:00 -07:00
|
|
|
width: 100%; // For `<button>`s
|
2017-04-08 14:17:06 -07:00
|
|
|
padding: $dropdown-item-padding-y $dropdown-item-padding-x;
|
2015-08-17 11:19:14 -07:00
|
|
|
clear: both;
|
2016-10-19 21:41:27 +02:00
|
|
|
font-weight: $font-weight-normal;
|
2015-08-17 11:19:14 -07:00
|
|
|
color: $dropdown-link-color;
|
2015-08-23 01:12:00 -07:00
|
|
|
text-align: inherit; // For `<button>`s
|
2020-03-05 15:22:52 +01:00
|
|
|
text-decoration: if($link-decoration == none, null, none);
|
2015-08-17 11:19:14 -07:00
|
|
|
white-space: nowrap; // prevent links from randomly breaking onto new lines
|
2017-11-06 02:23:36 +02:00
|
|
|
background-color: transparent; // For `<button>`s
|
2015-08-23 01:12:00 -07:00
|
|
|
border: 0; // For `<button>`s
|
2015-08-17 18:18:37 -07:00
|
|
|
|
2019-02-03 22:07:16 +01:00
|
|
|
// Prevent dropdown overflow if there's no padding
|
|
|
|
// See https://github.com/twbs/bootstrap/pull/27703
|
|
|
|
@if $dropdown-padding-y == 0 {
|
|
|
|
&:first-child {
|
|
|
|
@include border-top-radius($dropdown-inner-border-radius);
|
|
|
|
}
|
2018-11-21 23:24:13 +01:00
|
|
|
|
2019-02-03 22:07:16 +01:00
|
|
|
&:last-child {
|
|
|
|
@include border-bottom-radius($dropdown-inner-border-radius);
|
|
|
|
}
|
2018-11-21 23:24:13 +01:00
|
|
|
}
|
|
|
|
|
2019-07-24 10:53:13 +03:00
|
|
|
@include hover-focus() {
|
2014-12-02 14:02:35 -08:00
|
|
|
color: $dropdown-link-hover-color;
|
2014-12-11 12:05:29 -08:00
|
|
|
text-decoration: none;
|
2017-10-19 09:03:33 -07:00
|
|
|
@include gradient-bg($dropdown-link-hover-bg);
|
2013-07-06 22:27:56 -07:00
|
|
|
}
|
2012-06-19 19:17:42 -07:00
|
|
|
|
2016-12-28 00:20:06 -08:00
|
|
|
&.active,
|
|
|
|
&:active {
|
|
|
|
color: $dropdown-link-active-color;
|
|
|
|
text-decoration: none;
|
2017-10-19 09:03:33 -07:00
|
|
|
@include gradient-bg($dropdown-link-active-bg);
|
2013-07-06 22:27:56 -07:00
|
|
|
}
|
2013-08-11 17:47:30 -07:00
|
|
|
|
2016-12-28 00:20:06 -08:00
|
|
|
&.disabled,
|
|
|
|
&:disabled {
|
|
|
|
color: $dropdown-link-disabled-color;
|
2018-06-11 16:52:56 +03:00
|
|
|
pointer-events: none;
|
2016-12-28 00:20:06 -08:00
|
|
|
background-color: transparent;
|
|
|
|
// Remove CSS gradients if they're enabled
|
|
|
|
@if $enable-gradients {
|
|
|
|
background-image: none;
|
2015-08-17 11:19:14 -07:00
|
|
|
}
|
2013-07-06 22:27:56 -07:00
|
|
|
}
|
2012-06-19 13:52:07 -07:00
|
|
|
}
|
|
|
|
|
2017-04-14 11:25:53 +02:00
|
|
|
.dropdown-menu.show {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
2013-07-17 23:54:09 -07:00
|
|
|
// Dropdown section headers
|
|
|
|
.dropdown-header {
|
|
|
|
display: block;
|
2020-02-15 05:06:02 -06:00
|
|
|
padding: $dropdown-header-padding;
|
2016-10-02 18:25:51 -07:00
|
|
|
margin-bottom: 0; // for use with heading elements
|
2019-02-07 23:32:05 +01:00
|
|
|
@include font-size($font-size-sm);
|
2014-12-02 14:02:35 -08:00
|
|
|
color: $dropdown-header-color;
|
2014-06-18 19:07:55 +02:00
|
|
|
white-space: nowrap; // as with > li > a
|
2013-07-17 23:54:09 -07:00
|
|
|
}
|
2018-01-21 22:40:55 -08:00
|
|
|
|
|
|
|
// Dropdown text
|
|
|
|
.dropdown-item-text {
|
|
|
|
display: block;
|
|
|
|
padding: $dropdown-item-padding-y $dropdown-item-padding-x;
|
|
|
|
color: $dropdown-link-color;
|
|
|
|
}
|