bootstrap 4.3.0 → 5.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +17 -2
  3. data/CHANGELOG.md +2 -14
  4. data/README.md +7 -4
  5. data/assets/javascripts/bootstrap/alert.js +173 -137
  6. data/assets/javascripts/bootstrap/base-component.js +182 -0
  7. data/assets/javascripts/bootstrap/button.js +102 -143
  8. data/assets/javascripts/bootstrap/carousel.js +481 -410
  9. data/assets/javascripts/bootstrap/collapse.js +340 -274
  10. data/assets/javascripts/bootstrap/dom/data.js +68 -0
  11. data/assets/javascripts/bootstrap/dom/event-handler.js +322 -0
  12. data/assets/javascripts/bootstrap/dom/manipulator.js +88 -0
  13. data/assets/javascripts/bootstrap/dom/selector-engine.js +127 -0
  14. data/assets/javascripts/bootstrap/dropdown.js +494 -400
  15. data/assets/javascripts/bootstrap/modal.js +834 -450
  16. data/assets/javascripts/bootstrap/offcanvas.js +866 -0
  17. data/assets/javascripts/bootstrap/popover.js +122 -199
  18. data/assets/javascripts/bootstrap/scrollspy.js +257 -241
  19. data/assets/javascripts/bootstrap/tab.js +219 -155
  20. data/assets/javascripts/bootstrap/toast.js +330 -190
  21. data/assets/javascripts/bootstrap/tooltip.js +710 -472
  22. data/assets/javascripts/bootstrap-global-this-define.js +6 -0
  23. data/assets/javascripts/bootstrap-global-this-undefine.js +2 -0
  24. data/assets/javascripts/bootstrap-sprockets.js +8 -1
  25. data/assets/javascripts/bootstrap.js +3547 -2809
  26. data/assets/javascripts/bootstrap.min.js +4 -4
  27. data/assets/stylesheets/_bootstrap-grid.scss +54 -18
  28. data/assets/stylesheets/_bootstrap-reboot.scss +7 -4
  29. data/assets/stylesheets/_bootstrap.scss +20 -11
  30. data/assets/stylesheets/bootstrap/_accordion.scss +118 -0
  31. data/assets/stylesheets/bootstrap/_alert.scss +15 -9
  32. data/assets/stylesheets/bootstrap/_badge.scss +2 -27
  33. data/assets/stylesheets/bootstrap/_breadcrumb.scss +5 -18
  34. data/assets/stylesheets/bootstrap/_button-group.scss +21 -45
  35. data/assets/stylesheets/bootstrap/_buttons.scss +28 -54
  36. data/assets/stylesheets/bootstrap/_card.scss +52 -125
  37. data/assets/stylesheets/bootstrap/_carousel.scss +70 -38
  38. data/assets/stylesheets/bootstrap/_close.scss +30 -31
  39. data/assets/stylesheets/bootstrap/_containers.scss +41 -0
  40. data/assets/stylesheets/bootstrap/_dropdown.scss +88 -39
  41. data/assets/stylesheets/bootstrap/_forms.scss +9 -330
  42. data/assets/stylesheets/bootstrap/_functions.scss +237 -27
  43. data/assets/stylesheets/bootstrap/_grid.scss +14 -33
  44. data/assets/stylesheets/bootstrap/_helpers.scss +9 -0
  45. data/assets/stylesheets/bootstrap/_images.scss +3 -3
  46. data/assets/stylesheets/bootstrap/_list-group.scss +61 -36
  47. data/assets/stylesheets/bootstrap/_mixins.scss +12 -16
  48. data/assets/stylesheets/bootstrap/_modal.scss +64 -84
  49. data/assets/stylesheets/bootstrap/_nav.scss +29 -10
  50. data/assets/stylesheets/bootstrap/_navbar.scss +93 -52
  51. data/assets/stylesheets/bootstrap/_offcanvas.scss +83 -0
  52. data/assets/stylesheets/bootstrap/_pagination.scss +13 -22
  53. data/assets/stylesheets/bootstrap/_placeholders.scss +51 -0
  54. data/assets/stylesheets/bootstrap/_popover.scss +29 -42
  55. data/assets/stylesheets/bootstrap/_progress.scss +10 -5
  56. data/assets/stylesheets/bootstrap/_reboot.scss +350 -208
  57. data/assets/stylesheets/bootstrap/_root.scss +42 -8
  58. data/assets/stylesheets/bootstrap/_spinners.scss +21 -7
  59. data/assets/stylesheets/bootstrap/_tables.scss +80 -114
  60. data/assets/stylesheets/bootstrap/_toasts.scss +21 -14
  61. data/assets/stylesheets/bootstrap/_tooltip.scss +21 -21
  62. data/assets/stylesheets/bootstrap/_transitions.scss +8 -1
  63. data/assets/stylesheets/bootstrap/_type.scss +40 -61
  64. data/assets/stylesheets/bootstrap/_utilities.scss +630 -17
  65. data/assets/stylesheets/bootstrap/_variables.scss +993 -487
  66. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +18 -0
  67. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +63 -0
  68. data/assets/stylesheets/bootstrap/forms/_form-check.scss +152 -0
  69. data/assets/stylesheets/bootstrap/forms/_form-control.scss +219 -0
  70. data/assets/stylesheets/bootstrap/forms/_form-range.scss +91 -0
  71. data/assets/stylesheets/bootstrap/forms/_form-select.scss +70 -0
  72. data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
  73. data/assets/stylesheets/bootstrap/forms/_input-group.scss +121 -0
  74. data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
  75. data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
  76. data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
  77. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +12 -0
  78. data/assets/stylesheets/bootstrap/helpers/_position.scss +30 -0
  79. data/assets/stylesheets/bootstrap/helpers/_ratio.scss +26 -0
  80. data/assets/stylesheets/bootstrap/helpers/_stacks.scss +15 -0
  81. data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
  82. data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
  83. data/assets/stylesheets/bootstrap/helpers/_visually-hidden.scss +8 -0
  84. data/assets/stylesheets/bootstrap/helpers/_vr.scss +8 -0
  85. data/assets/stylesheets/bootstrap/mixins/_alert.scss +3 -5
  86. data/assets/stylesheets/bootstrap/mixins/_backdrop.scss +14 -0
  87. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +37 -22
  88. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +7 -9
  89. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +14 -10
  90. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +77 -51
  91. data/assets/stylesheets/bootstrap/mixins/_caret.scss +10 -8
  92. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
  93. data/assets/stylesheets/bootstrap/mixins/_color-scheme.scss +7 -0
  94. data/assets/stylesheets/bootstrap/mixins/_container.scss +9 -0
  95. data/assets/stylesheets/bootstrap/mixins/_forms.scss +67 -115
  96. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +13 -11
  97. data/assets/stylesheets/bootstrap/mixins/_grid.scss +131 -32
  98. data/assets/stylesheets/bootstrap/mixins/_image.scss +0 -20
  99. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +5 -2
  100. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +17 -8
  101. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +1 -1
  102. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +21 -0
  103. data/assets/stylesheets/bootstrap/mixins/_transition.scss +18 -8
  104. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +89 -0
  105. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +29 -0
  106. data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
  107. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +274 -132
  108. data/bootstrap.gemspec +4 -6
  109. data/lib/bootstrap/version.rb +2 -2
  110. data/tasks/updater/js.rb +25 -6
  111. data/tasks/updater/network.rb +8 -2
  112. data/test/dummy_rails/app/assets/config/manifest.js +3 -0
  113. data/test/dummy_rails/app/assets/javascripts/application.js +4 -3
  114. data/test/dummy_rails/app/assets/stylesheets/.browserslistrc +1 -0
  115. data/test/dummy_rails/app/views/layouts/application.html.erb +3 -1
  116. data/test/dummy_rails/app/views/pages/root.html +89 -0
  117. data/test/dummy_rails/config/application.rb +0 -3
  118. data/test/gemfiles/rails_6_0.gemfile +7 -0
  119. data/test/gemfiles/rails_6_1.gemfile +7 -0
  120. data/test/support/dummy_rails_integration.rb +3 -1
  121. data/test/test_helper.rb +18 -13
  122. metadata +61 -79
  123. data/assets/javascripts/bootstrap/util.js +0 -171
  124. data/assets/stylesheets/bootstrap/_code.scss +0 -48
  125. data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -507
  126. data/assets/stylesheets/bootstrap/_input-group.scss +0 -193
  127. data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
  128. data/assets/stylesheets/bootstrap/_media.scss +0 -8
  129. data/assets/stylesheets/bootstrap/_print.scss +0 -141
  130. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -21
  131. data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
  132. data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
  133. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -66
  134. data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
  135. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -10
  136. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +0 -33
  137. data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
  138. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
  139. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -16
  140. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
  141. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
  142. data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
  143. data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
  144. data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
  145. data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
  146. data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
  147. data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
  148. data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
  149. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
  150. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
  151. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
  152. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
  153. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
  154. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
  155. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
  156. data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
  157. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
  158. data/test/dummy_rails/app/views/pages/root.html.slim +0 -58
@@ -3,12 +3,12 @@
3
3
  // 1. .carousel.pointer-event should ideally be pan-y (to allow for users to scroll vertically)
4
4
  // even when their scroll action started on a carousel, but for compatibility (with Firefox)
5
5
  // we're preventing all actions instead
6
- // 2. The .carousel-item-left and .carousel-item-right is used to indicate where
6
+ // 2. The .carousel-item-start and .carousel-item-end is used to indicate where
7
7
  // the active slide is heading.
8
8
  // 3. .active.carousel-item is the current slide.
9
- // 4. .active.carousel-item-left and .active.carousel-item-right is the current
9
+ // 4. .active.carousel-item-start and .active.carousel-item-end is the current
10
10
  // slide in its in-transition state. Only one of these occurs at a time.
11
- // 5. .carousel-item-next.carousel-item-left and .carousel-item-prev.carousel-item-right
11
+ // 5. .carousel-item-next.carousel-item-start and .carousel-item-prev.carousel-item-end
12
12
  // is the upcoming slide in transition.
13
13
 
14
14
  .carousel {
@@ -42,16 +42,19 @@
42
42
  display: block;
43
43
  }
44
44
 
45
- .carousel-item-next:not(.carousel-item-left),
46
- .active.carousel-item-right {
45
+ /* rtl:begin:ignore */
46
+ .carousel-item-next:not(.carousel-item-start),
47
+ .active.carousel-item-end {
47
48
  transform: translateX(100%);
48
49
  }
49
50
 
50
- .carousel-item-prev:not(.carousel-item-right),
51
- .active.carousel-item-left {
51
+ .carousel-item-prev:not(.carousel-item-end),
52
+ .active.carousel-item-start {
52
53
  transform: translateX(-100%);
53
54
  }
54
55
 
56
+ /* rtl:end:ignore */
57
+
55
58
 
56
59
  //
57
60
  // Alternate transitions
@@ -65,17 +68,17 @@
65
68
  }
66
69
 
67
70
  .carousel-item.active,
68
- .carousel-item-next.carousel-item-left,
69
- .carousel-item-prev.carousel-item-right {
71
+ .carousel-item-next.carousel-item-start,
72
+ .carousel-item-prev.carousel-item-end {
70
73
  z-index: 1;
71
74
  opacity: 1;
72
75
  }
73
76
 
74
- .active.carousel-item-left,
75
- .active.carousel-item-right {
77
+ .active.carousel-item-start,
78
+ .active.carousel-item-end {
76
79
  z-index: 0;
77
80
  opacity: 0;
78
- @include transition(0s $carousel-transition-duration opacity);
81
+ @include transition(opacity 0s $carousel-transition-duration);
79
82
  }
80
83
  }
81
84
 
@@ -95,13 +98,17 @@
95
98
  align-items: center; // 2. vertically center contents
96
99
  justify-content: center; // 3. horizontally center contents
97
100
  width: $carousel-control-width;
101
+ padding: 0;
98
102
  color: $carousel-control-color;
99
103
  text-align: center;
104
+ background: none;
105
+ border: 0;
100
106
  opacity: $carousel-control-opacity;
101
107
  @include transition($carousel-control-transition);
102
108
 
103
109
  // Hover/focus state
104
- @include hover-focus {
110
+ &:hover,
111
+ &:focus {
105
112
  color: $carousel-control-color;
106
113
  text-decoration: none;
107
114
  outline: 0;
@@ -110,15 +117,11 @@
110
117
  }
111
118
  .carousel-control-prev {
112
119
  left: 0;
113
- @if $enable-gradients {
114
- background: linear-gradient(90deg, rgba($black, .25), rgba($black, .001));
115
- }
120
+ background-image: if($enable-gradients, linear-gradient(90deg, rgba($black, .25), rgba($black, .001)), null);
116
121
  }
117
122
  .carousel-control-next {
118
123
  right: 0;
119
- @if $enable-gradients {
120
- background: linear-gradient(270deg, rgba($black, .25), rgba($black, .001));
121
- }
124
+ background-image: if($enable-gradients, linear-gradient(270deg, rgba($black, .25), rgba($black, .001)), null);
122
125
  }
123
126
 
124
127
  // Icons for within
@@ -127,55 +130,68 @@
127
130
  display: inline-block;
128
131
  width: $carousel-control-icon-width;
129
132
  height: $carousel-control-icon-width;
130
- background: no-repeat 50% / 100% 100%;
131
- }
133
+ background-repeat: no-repeat;
134
+ background-position: 50%;
135
+ background-size: 100% 100%;
136
+ }
137
+
138
+ /* rtl:options: {
139
+ "autoRename": true,
140
+ "stringMap":[ {
141
+ "name" : "prev-next",
142
+ "search" : "prev",
143
+ "replace" : "next"
144
+ } ]
145
+ } */
132
146
  .carousel-control-prev-icon {
133
- background-image: $carousel-control-prev-icon-bg;
147
+ background-image: escape-svg($carousel-control-prev-icon-bg);
134
148
  }
135
149
  .carousel-control-next-icon {
136
- background-image: $carousel-control-next-icon-bg;
150
+ background-image: escape-svg($carousel-control-next-icon-bg);
137
151
  }
138
152
 
139
-
140
- // Optional indicator pips
153
+ // Optional indicator pips/controls
141
154
  //
142
- // Add an ordered list with the following class and add a list item for each
143
- // slide your carousel holds.
155
+ // Add a container (such as a list) with the following class and add an item (ideally a focusable control,
156
+ // like a button) with data-bs-target for each slide your carousel holds.
144
157
 
145
158
  .carousel-indicators {
146
159
  position: absolute;
147
160
  right: 0;
148
161
  bottom: 0;
149
162
  left: 0;
150
- z-index: 15;
163
+ z-index: 2;
151
164
  display: flex;
152
165
  justify-content: center;
153
- padding-left: 0; // override <ol> default
166
+ padding: 0;
154
167
  // Use the .carousel-control's width as margin so we don't overlay those
155
168
  margin-right: $carousel-control-width;
169
+ margin-bottom: 1rem;
156
170
  margin-left: $carousel-control-width;
157
171
  list-style: none;
158
172
 
159
- li {
173
+ [data-bs-target] {
160
174
  box-sizing: content-box;
161
175
  flex: 0 1 auto;
162
176
  width: $carousel-indicator-width;
163
177
  height: $carousel-indicator-height;
178
+ padding: 0;
164
179
  margin-right: $carousel-indicator-spacer;
165
180
  margin-left: $carousel-indicator-spacer;
166
181
  text-indent: -999px;
167
182
  cursor: pointer;
168
183
  background-color: $carousel-indicator-active-bg;
169
184
  background-clip: padding-box;
185
+ border: 0;
170
186
  // Use transparent borders to increase the hit area by 10px on top and bottom.
171
187
  border-top: $carousel-indicator-hit-area-height solid transparent;
172
188
  border-bottom: $carousel-indicator-hit-area-height solid transparent;
173
- opacity: .5;
189
+ opacity: $carousel-indicator-opacity;
174
190
  @include transition($carousel-indicator-transition);
175
191
  }
176
192
 
177
193
  .active {
178
- opacity: 1;
194
+ opacity: $carousel-indicator-active-opacity;
179
195
  }
180
196
  }
181
197
 
@@ -186,12 +202,28 @@
186
202
 
187
203
  .carousel-caption {
188
204
  position: absolute;
189
- right: (100% - $carousel-caption-width) / 2;
190
- bottom: 20px;
191
- left: (100% - $carousel-caption-width) / 2;
192
- z-index: 10;
193
- padding-top: 20px;
194
- padding-bottom: 20px;
205
+ right: (100% - $carousel-caption-width) * .5;
206
+ bottom: $carousel-caption-spacer;
207
+ left: (100% - $carousel-caption-width) * .5;
208
+ padding-top: $carousel-caption-padding-y;
209
+ padding-bottom: $carousel-caption-padding-y;
195
210
  color: $carousel-caption-color;
196
211
  text-align: center;
197
212
  }
213
+
214
+ // Dark mode carousel
215
+
216
+ .carousel-dark {
217
+ .carousel-control-prev-icon,
218
+ .carousel-control-next-icon {
219
+ filter: $carousel-dark-control-icon-filter;
220
+ }
221
+
222
+ .carousel-indicators [data-bs-target] {
223
+ background-color: $carousel-dark-indicator-active-bg;
224
+ }
225
+
226
+ .carousel-caption {
227
+ color: $carousel-dark-caption-color;
228
+ }
229
+ }
@@ -1,41 +1,40 @@
1
- .close {
2
- float: right;
3
- @include font-size($close-font-size);
4
- font-weight: $close-font-weight;
5
- line-height: 1;
6
- color: $close-color;
7
- text-shadow: $close-text-shadow;
8
- opacity: .5;
1
+ // transparent background and border properties included for button version.
2
+ // iOS requires the button element instead of an anchor tag.
3
+ // If you want the anchor version, it requires `href="#"`.
4
+ // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile
5
+
6
+ .btn-close {
7
+ box-sizing: content-box;
8
+ width: $btn-close-width;
9
+ height: $btn-close-height;
10
+ padding: $btn-close-padding-y $btn-close-padding-x;
11
+ color: $btn-close-color;
12
+ background: transparent escape-svg($btn-close-bg) center / $btn-close-width auto no-repeat; // include transparent for button elements
13
+ border: 0; // for button elements
14
+ @include border-radius();
15
+ opacity: $btn-close-opacity;
9
16
 
10
17
  // Override <a>'s hover style
11
- @include hover {
12
- color: $close-color;
18
+ &:hover {
19
+ color: $btn-close-color;
13
20
  text-decoration: none;
21
+ opacity: $btn-close-hover-opacity;
14
22
  }
15
23
 
16
- &:not(:disabled):not(.disabled) {
17
- @include hover-focus {
18
- opacity: .75;
19
- }
24
+ &:focus {
25
+ outline: 0;
26
+ box-shadow: $btn-close-focus-shadow;
27
+ opacity: $btn-close-focus-opacity;
20
28
  }
21
- }
22
29
 
23
- // Additional properties for button version
24
- // iOS requires the button element instead of an anchor tag.
25
- // If you want the anchor version, it requires `href="#"`.
26
- // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile
27
-
28
- // stylelint-disable-next-line selector-no-qualifying-type
29
- button.close {
30
- padding: 0;
31
- background-color: transparent;
32
- border: 0;
33
- appearance: none;
30
+ &:disabled,
31
+ &.disabled {
32
+ pointer-events: none;
33
+ user-select: none;
34
+ opacity: $btn-close-disabled-opacity;
35
+ }
34
36
  }
35
37
 
36
- // Future-proof disabling of clicks on `<a>` elements
37
-
38
- // stylelint-disable-next-line selector-no-qualifying-type
39
- a.close.disabled {
40
- pointer-events: none;
38
+ .btn-close-white {
39
+ filter: $btn-close-white-filter;
41
40
  }
@@ -0,0 +1,41 @@
1
+ // Container widths
2
+ //
3
+ // Set the container width, and override it for fixed navbars in media queries.
4
+
5
+ @if $enable-grid-classes {
6
+ // Single container class with breakpoint max-widths
7
+ .container,
8
+ // 100% wide container at all breakpoints
9
+ .container-fluid {
10
+ @include make-container();
11
+ }
12
+
13
+ // Responsive containers that are 100% wide until a breakpoint
14
+ @each $breakpoint, $container-max-width in $container-max-widths {
15
+ .container-#{$breakpoint} {
16
+ @extend .container-fluid;
17
+ }
18
+
19
+ @include media-breakpoint-up($breakpoint, $grid-breakpoints) {
20
+ %responsive-container-#{$breakpoint} {
21
+ max-width: $container-max-width;
22
+ }
23
+
24
+ // Extend each breakpoint which is smaller or equal to the current breakpoint
25
+ $extend-breakpoint: true;
26
+
27
+ @each $name, $width in $grid-breakpoints {
28
+ @if ($extend-breakpoint) {
29
+ .container#{breakpoint-infix($name, $grid-breakpoints)} {
30
+ @extend %responsive-container-#{$breakpoint};
31
+ }
32
+
33
+ // Once the current breakpoint is reached, stop extending
34
+ @if ($breakpoint == $name) {
35
+ $extend-breakpoint: false;
36
+ }
37
+ }
38
+ }
39
+ }
40
+ }
41
+ }
@@ -1,8 +1,8 @@
1
1
  // The dropdown wrapper (`<div>`)
2
2
  .dropup,
3
- .dropright,
3
+ .dropend,
4
4
  .dropdown,
5
- .dropleft {
5
+ .dropstart {
6
6
  position: relative;
7
7
  }
8
8
 
@@ -10,20 +10,17 @@
10
10
  white-space: nowrap;
11
11
 
12
12
  // Generate the caret automatically
13
- @include caret;
13
+ @include caret();
14
14
  }
15
15
 
16
16
  // The dropdown menu
17
17
  .dropdown-menu {
18
18
  position: absolute;
19
- top: 100%;
20
- left: 0;
21
19
  z-index: $zindex-dropdown;
22
20
  display: none; // none by default, but block on "open" of the menu
23
- float: left;
24
21
  min-width: $dropdown-min-width;
25
- padding: $dropdown-padding-y 0;
26
- margin: $dropdown-spacer 0 0; // override default ul
22
+ padding: $dropdown-padding-y $dropdown-padding-x;
23
+ margin: 0; // Override default margin of ul
27
24
  @include font-size($dropdown-font-size);
28
25
  color: $dropdown-color;
29
26
  text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer)
@@ -33,28 +30,47 @@
33
30
  border: $dropdown-border-width solid $dropdown-border-color;
34
31
  @include border-radius($dropdown-border-radius);
35
32
  @include box-shadow($dropdown-box-shadow);
33
+
34
+ &[data-bs-popper] {
35
+ top: 100%;
36
+ left: 0;
37
+ margin-top: $dropdown-spacer;
38
+ }
36
39
  }
37
40
 
41
+ // scss-docs-start responsive-breakpoints
42
+ // We deliberately hardcode the `bs-` prefix because we check
43
+ // this custom property in JS to determine Popper's positioning
44
+
38
45
  @each $breakpoint in map-keys($grid-breakpoints) {
39
46
  @include media-breakpoint-up($breakpoint) {
40
47
  $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
41
48
 
42
- .dropdown-menu#{$infix}-left {
43
- right: auto;
44
- left: 0;
49
+ .dropdown-menu#{$infix}-start {
50
+ --bs-position: start;
51
+
52
+ &[data-bs-popper] {
53
+ right: auto;
54
+ left: 0;
55
+ }
45
56
  }
46
57
 
47
- .dropdown-menu#{$infix}-right {
48
- right: 0;
49
- left: auto;
58
+ .dropdown-menu#{$infix}-end {
59
+ --bs-position: end;
60
+
61
+ &[data-bs-popper] {
62
+ right: 0;
63
+ left: auto;
64
+ }
50
65
  }
51
66
  }
52
67
  }
68
+ // scss-docs-end responsive-breakpoints
53
69
 
54
70
  // Allow for dropdowns to go bottom up (aka, dropup-menu)
55
71
  // Just add .dropup after the standard .dropdown class and you're set.
56
72
  .dropup {
57
- .dropdown-menu {
73
+ .dropdown-menu[data-bs-popper] {
58
74
  top: auto;
59
75
  bottom: 100%;
60
76
  margin-top: 0;
@@ -66,8 +82,8 @@
66
82
  }
67
83
  }
68
84
 
69
- .dropright {
70
- .dropdown-menu {
85
+ .dropend {
86
+ .dropdown-menu[data-bs-popper] {
71
87
  top: 0;
72
88
  right: auto;
73
89
  left: 100%;
@@ -76,15 +92,15 @@
76
92
  }
77
93
 
78
94
  .dropdown-toggle {
79
- @include caret(right);
95
+ @include caret(end);
80
96
  &::after {
81
97
  vertical-align: 0;
82
98
  }
83
99
  }
84
100
  }
85
101
 
86
- .dropleft {
87
- .dropdown-menu {
102
+ .dropstart {
103
+ .dropdown-menu[data-bs-popper] {
88
104
  top: 0;
89
105
  right: 100%;
90
106
  left: auto;
@@ -93,28 +109,20 @@
93
109
  }
94
110
 
95
111
  .dropdown-toggle {
96
- @include caret(left);
112
+ @include caret(start);
97
113
  &::before {
98
114
  vertical-align: 0;
99
115
  }
100
116
  }
101
117
  }
102
118
 
103
- // When enabled Popper.js, reset basic dropdown position
104
- // stylelint-disable-next-line no-duplicate-selectors
105
- .dropdown-menu {
106
- &[x-placement^="top"],
107
- &[x-placement^="right"],
108
- &[x-placement^="bottom"],
109
- &[x-placement^="left"] {
110
- right: auto;
111
- bottom: auto;
112
- }
113
- }
114
119
 
115
120
  // Dividers (basically an `<hr>`) within the dropdown
116
121
  .dropdown-divider {
117
- @include nav-divider($dropdown-divider-bg, $dropdown-divider-margin-y);
122
+ height: 0;
123
+ margin: $dropdown-divider-margin-y 0;
124
+ overflow: hidden;
125
+ border-top: 1px solid $dropdown-divider-bg;
118
126
  }
119
127
 
120
128
  // Links, buttons, and more within the dropdown menu
@@ -128,6 +136,7 @@
128
136
  font-weight: $font-weight-normal;
129
137
  color: $dropdown-link-color;
130
138
  text-align: inherit; // For `<button>`s
139
+ text-decoration: if($link-decoration == none, null, none);
131
140
  white-space: nowrap; // prevent links from randomly breaking onto new lines
132
141
  background-color: transparent; // For `<button>`s
133
142
  border: 0; // For `<button>`s
@@ -144,9 +153,10 @@
144
153
  }
145
154
  }
146
155
 
147
- @include hover-focus {
156
+ &:hover,
157
+ &:focus {
148
158
  color: $dropdown-link-hover-color;
149
- text-decoration: none;
159
+ text-decoration: if($link-hover-decoration == underline, none, null);
150
160
  @include gradient-bg($dropdown-link-hover-bg);
151
161
  }
152
162
 
@@ -163,9 +173,7 @@
163
173
  pointer-events: none;
164
174
  background-color: transparent;
165
175
  // Remove CSS gradients if they're enabled
166
- @if $enable-gradients {
167
- background-image: none;
168
- }
176
+ background-image: if($enable-gradients, none, null);
169
177
  }
170
178
  }
171
179
 
@@ -176,7 +184,7 @@
176
184
  // Dropdown section headers
177
185
  .dropdown-header {
178
186
  display: block;
179
- padding: $dropdown-padding-y $dropdown-item-padding-x;
187
+ padding: $dropdown-header-padding;
180
188
  margin-bottom: 0; // for use with heading elements
181
189
  @include font-size($font-size-sm);
182
190
  color: $dropdown-header-color;
@@ -189,3 +197,44 @@
189
197
  padding: $dropdown-item-padding-y $dropdown-item-padding-x;
190
198
  color: $dropdown-link-color;
191
199
  }
200
+
201
+ // Dark dropdowns
202
+ .dropdown-menu-dark {
203
+ color: $dropdown-dark-color;
204
+ background-color: $dropdown-dark-bg;
205
+ border-color: $dropdown-dark-border-color;
206
+ @include box-shadow($dropdown-dark-box-shadow);
207
+
208
+ .dropdown-item {
209
+ color: $dropdown-dark-link-color;
210
+
211
+ &:hover,
212
+ &:focus {
213
+ color: $dropdown-dark-link-hover-color;
214
+ @include gradient-bg($dropdown-dark-link-hover-bg);
215
+ }
216
+
217
+ &.active,
218
+ &:active {
219
+ color: $dropdown-dark-link-active-color;
220
+ @include gradient-bg($dropdown-dark-link-active-bg);
221
+ }
222
+
223
+ &.disabled,
224
+ &:disabled {
225
+ color: $dropdown-dark-link-disabled-color;
226
+ }
227
+ }
228
+
229
+ .dropdown-divider {
230
+ border-color: $dropdown-dark-divider-bg;
231
+ }
232
+
233
+ .dropdown-item-text {
234
+ color: $dropdown-dark-link-color;
235
+ }
236
+
237
+ .dropdown-header {
238
+ color: $dropdown-dark-header-color;
239
+ }
240
+ }