`)
2 | .dropup,
3 | .dropright,
4 | .dropdown,
5 | .dropleft {
6 | position: relative;
7 | }
8 |
9 | .dropdown-toggle {
10 | // Generate the caret automatically
11 | @include caret;
12 | }
13 |
14 | // The dropdown menu
15 | .dropdown-menu {
16 | position: absolute;
17 | top: 100%;
18 | left: 0;
19 | z-index: $zindex-dropdown;
20 | display: none; // none by default, but block on "open" of the menu
21 | float: left;
22 | min-width: $dropdown-min-width;
23 | padding: $dropdown-padding-y 0;
24 | margin: $dropdown-spacer 0 0; // override default ul
25 | font-size: $font-size-base; // Redeclare because nesting can cause inheritance issues
26 | color: $body-color;
27 | text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer)
28 | list-style: none;
29 | background-color: $dropdown-bg;
30 | background-clip: padding-box;
31 | border: $dropdown-border-width solid $dropdown-border-color;
32 | @include border-radius($dropdown-border-radius);
33 | @include box-shadow($dropdown-box-shadow);
34 | }
35 |
36 | @each $breakpoint in map-keys($grid-breakpoints) {
37 | @include media-breakpoint-up($breakpoint) {
38 | $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
39 |
40 | .dropdown-menu#{$infix}-right {
41 | right: 0;
42 | left: auto;
43 | }
44 | }
45 | }
46 |
47 | @each $breakpoint in map-keys($grid-breakpoints) {
48 | @include media-breakpoint-up($breakpoint) {
49 | $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
50 |
51 | .dropdown-menu#{$infix}-left {
52 | right: auto;
53 | left: 0;
54 | }
55 | }
56 | }
57 |
58 | // Allow for dropdowns to go bottom up (aka, dropup-menu)
59 | // Just add .dropup after the standard .dropdown class and you're set.
60 | .dropup {
61 | .dropdown-menu {
62 | top: auto;
63 | bottom: 100%;
64 | margin-top: 0;
65 | margin-bottom: $dropdown-spacer;
66 | }
67 |
68 | .dropdown-toggle {
69 | @include caret(up);
70 | }
71 | }
72 |
73 | .dropright {
74 | .dropdown-menu {
75 | top: 0;
76 | right: auto;
77 | left: 100%;
78 | margin-top: 0;
79 | margin-left: $dropdown-spacer;
80 | }
81 |
82 | .dropdown-toggle {
83 | @include caret(right);
84 | &::after {
85 | vertical-align: 0;
86 | }
87 | }
88 | }
89 |
90 | .dropleft {
91 | .dropdown-menu {
92 | top: 0;
93 | right: 100%;
94 | left: auto;
95 | margin-top: 0;
96 | margin-right: $dropdown-spacer;
97 | }
98 |
99 | .dropdown-toggle {
100 | @include caret(left);
101 | &::before {
102 | vertical-align: 0;
103 | }
104 | }
105 | }
106 |
107 | // When enabled Popper.js, reset basic dropdown position
108 | // stylelint-disable-next-line no-duplicate-selectors
109 | .dropdown-menu {
110 | &[x-placement^="top"],
111 | &[x-placement^="right"],
112 | &[x-placement^="bottom"],
113 | &[x-placement^="left"] {
114 | right: auto;
115 | bottom: auto;
116 | }
117 | }
118 |
119 | // Dividers (basically an `
`) within the dropdown
120 | .dropdown-divider {
121 | @include nav-divider($dropdown-divider-bg);
122 | }
123 |
124 | // Links, buttons, and more within the dropdown menu
125 | //
126 | // `