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