bootstrap 4.6.0 → 5.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +61 -0
  3. data/Gemfile +1 -0
  4. data/README.md +33 -6
  5. data/Rakefile +10 -1
  6. data/assets/javascripts/bootstrap/alert.js +53 -155
  7. data/assets/javascripts/bootstrap/base-component.js +83 -0
  8. data/assets/javascripts/bootstrap/button.js +43 -198
  9. data/assets/javascripts/bootstrap/carousel.js +285 -550
  10. data/assets/javascripts/bootstrap/collapse.js +169 -323
  11. data/assets/javascripts/bootstrap/dom/data.js +62 -0
  12. data/assets/javascripts/bootstrap/dom/event-handler.js +236 -0
  13. data/assets/javascripts/bootstrap/dom/manipulator.js +71 -0
  14. data/assets/javascripts/bootstrap/dom/selector-engine.js +103 -0
  15. data/assets/javascripts/bootstrap/dropdown.js +300 -467
  16. data/assets/javascripts/bootstrap/modal.js +226 -575
  17. data/assets/javascripts/bootstrap/offcanvas.js +245 -0
  18. data/assets/javascripts/bootstrap/popover.js +61 -205
  19. data/assets/javascripts/bootstrap/scrollspy.js +216 -287
  20. data/assets/javascripts/bootstrap/tab.js +226 -203
  21. data/assets/javascripts/bootstrap/toast.js +136 -209
  22. data/assets/javascripts/bootstrap/tooltip.js +411 -757
  23. data/assets/javascripts/bootstrap/util/backdrop.js +139 -0
  24. data/assets/javascripts/bootstrap/util/component-functions.js +41 -0
  25. data/assets/javascripts/bootstrap/util/config.js +67 -0
  26. data/assets/javascripts/bootstrap/util/focustrap.js +113 -0
  27. data/assets/javascripts/bootstrap/util/index.js +281 -0
  28. data/assets/javascripts/bootstrap/util/sanitizer.js +110 -0
  29. data/assets/javascripts/bootstrap/util/scrollbar.js +112 -0
  30. data/assets/javascripts/bootstrap/util/swipe.js +134 -0
  31. data/assets/javascripts/bootstrap/util/template-factory.js +150 -0
  32. data/assets/javascripts/bootstrap-global-this-define.js +6 -0
  33. data/assets/javascripts/bootstrap-global-this-undefine.js +2 -0
  34. data/assets/javascripts/bootstrap-sprockets.js +23 -7
  35. data/assets/javascripts/bootstrap.js +3649 -3587
  36. data/assets/javascripts/bootstrap.min.js +3 -3
  37. data/assets/stylesheets/_bootstrap-grid.scss +53 -21
  38. data/assets/stylesheets/_bootstrap-reboot.scss +5 -7
  39. data/assets/stylesheets/_bootstrap-utilities.scss +19 -0
  40. data/assets/stylesheets/_bootstrap.scss +21 -13
  41. data/assets/stylesheets/bootstrap/_accordion.scss +158 -0
  42. data/assets/stylesheets/bootstrap/_alert.scss +32 -16
  43. data/assets/stylesheets/bootstrap/_badge.scss +15 -31
  44. data/assets/stylesheets/bootstrap/_breadcrumb.scss +22 -24
  45. data/assets/stylesheets/bootstrap/_button-group.scss +27 -48
  46. data/assets/stylesheets/bootstrap/_buttons.scss +136 -71
  47. data/assets/stylesheets/bootstrap/_card.scss +66 -113
  48. data/assets/stylesheets/bootstrap/_carousel.scss +83 -36
  49. data/assets/stylesheets/bootstrap/_close.scss +51 -28
  50. data/assets/stylesheets/bootstrap/_containers.scss +41 -0
  51. data/assets/stylesheets/bootstrap/_dropdown.scss +129 -71
  52. data/assets/stylesheets/bootstrap/_forms.scss +9 -347
  53. data/assets/stylesheets/bootstrap/_functions.scss +181 -23
  54. data/assets/stylesheets/bootstrap/_grid.scss +18 -52
  55. data/assets/stylesheets/bootstrap/_helpers.scss +12 -0
  56. data/assets/stylesheets/bootstrap/_images.scss +1 -1
  57. data/assets/stylesheets/bootstrap/_list-group.scss +77 -34
  58. data/assets/stylesheets/bootstrap/_maps.scss +174 -0
  59. data/assets/stylesheets/bootstrap/_mixins.scss +10 -15
  60. data/assets/stylesheets/bootstrap/_modal.scss +107 -110
  61. data/assets/stylesheets/bootstrap/_nav.scss +102 -25
  62. data/assets/stylesheets/bootstrap/_navbar.scss +129 -172
  63. data/assets/stylesheets/bootstrap/_offcanvas.scss +146 -0
  64. data/assets/stylesheets/bootstrap/_pagination.scss +72 -37
  65. data/assets/stylesheets/bootstrap/_placeholders.scss +51 -0
  66. data/assets/stylesheets/bootstrap/_popover.scss +99 -73
  67. data/assets/stylesheets/bootstrap/_progress.scss +35 -14
  68. data/assets/stylesheets/bootstrap/_reboot.scss +319 -192
  69. data/assets/stylesheets/bootstrap/_root.scss +177 -9
  70. data/assets/stylesheets/bootstrap/_spinners.scss +44 -24
  71. data/assets/stylesheets/bootstrap/_tables.scss +101 -115
  72. data/assets/stylesheets/bootstrap/_toasts.scss +54 -27
  73. data/assets/stylesheets/bootstrap/_tooltip.scss +67 -63
  74. data/assets/stylesheets/bootstrap/_transitions.scss +8 -1
  75. data/assets/stylesheets/bootstrap/_type.scss +40 -59
  76. data/assets/stylesheets/bootstrap/_utilities.scss +806 -18
  77. data/assets/stylesheets/bootstrap/_variables-dark.scss +87 -0
  78. data/assets/stylesheets/bootstrap/_variables.scss +1216 -615
  79. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +95 -0
  80. data/assets/stylesheets/bootstrap/forms/_form-check.scss +189 -0
  81. data/assets/stylesheets/bootstrap/forms/_form-control.scss +214 -0
  82. data/assets/stylesheets/bootstrap/forms/_form-range.scss +91 -0
  83. data/assets/stylesheets/bootstrap/forms/_form-select.scss +80 -0
  84. data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
  85. data/assets/stylesheets/bootstrap/forms/_input-group.scss +132 -0
  86. data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
  87. data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
  88. data/assets/stylesheets/bootstrap/helpers/_color-bg.scss +7 -0
  89. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +30 -0
  90. data/assets/stylesheets/bootstrap/helpers/_focus-ring.scss +5 -0
  91. data/assets/stylesheets/bootstrap/helpers/_icon-link.scss +25 -0
  92. data/assets/stylesheets/bootstrap/helpers/_position.scss +36 -0
  93. data/assets/stylesheets/bootstrap/helpers/_ratio.scss +26 -0
  94. data/assets/stylesheets/bootstrap/helpers/_stacks.scss +15 -0
  95. data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
  96. data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
  97. data/assets/stylesheets/bootstrap/helpers/_visually-hidden.scss +8 -0
  98. data/assets/stylesheets/bootstrap/helpers/_vr.scss +8 -0
  99. data/assets/stylesheets/bootstrap/mixins/_alert.scss +11 -6
  100. data/assets/stylesheets/bootstrap/mixins/_backdrop.scss +14 -0
  101. data/assets/stylesheets/bootstrap/mixins/_banner.scss +7 -0
  102. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +10 -8
  103. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +7 -9
  104. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +20 -16
  105. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +60 -100
  106. data/assets/stylesheets/bootstrap/mixins/_caret.scss +34 -27
  107. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
  108. data/assets/stylesheets/bootstrap/mixins/_color-mode.scss +21 -0
  109. data/assets/stylesheets/bootstrap/mixins/_color-scheme.scss +7 -0
  110. data/assets/stylesheets/bootstrap/mixins/_container.scss +11 -0
  111. data/assets/stylesheets/bootstrap/mixins/_forms.scss +53 -85
  112. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +13 -11
  113. data/assets/stylesheets/bootstrap/mixins/_grid.scss +119 -37
  114. data/assets/stylesheets/bootstrap/mixins/_image.scss +1 -21
  115. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +7 -2
  116. data/assets/stylesheets/bootstrap/mixins/_lists.scss +1 -1
  117. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +7 -19
  118. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +3 -3
  119. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +24 -0
  120. data/assets/stylesheets/bootstrap/mixins/_transition.scss +1 -1
  121. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +97 -0
  122. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +33 -0
  123. data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
  124. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +276 -132
  125. data/bootstrap.gemspec +6 -7
  126. data/lib/bootstrap/engine.rb +7 -1
  127. data/lib/bootstrap/version.rb +2 -2
  128. data/tasks/updater/js.rb +31 -7
  129. data/tasks/updater/network.rb +9 -3
  130. data/tasks/updater/scss.rb +2 -2
  131. data/tasks/updater.rb +2 -2
  132. data/test/dummy_rails/app/assets/javascripts/application.js +4 -3
  133. data/test/dummy_rails/app/views/layouts/application.html.erb +3 -1
  134. data/test/dummy_rails/app/views/pages/root.html +89 -0
  135. data/test/dummy_rails/config/application.rb +0 -3
  136. data/test/gemfiles/rails_4_2.gemfile +1 -1
  137. data/test/gemfiles/rails_5_0.gemfile +1 -1
  138. data/test/gemfiles/rails_5_1.gemfile +1 -1
  139. data/test/gemfiles/rails_5_2.gemfile +8 -0
  140. data/test/gemfiles/rails_6_0.gemfile +1 -0
  141. data/test/gemfiles/rails_6_1.gemfile +8 -0
  142. data/test/gemfiles/rails_7_0_dartsass.gemfile +8 -0
  143. data/test/gemfiles/rails_7_0_sassc.gemfile +8 -0
  144. data/test/test_helper.rb +3 -2
  145. metadata +97 -85
  146. data/.travis.yml +0 -31
  147. data/assets/javascripts/bootstrap/util.js +0 -192
  148. data/assets/stylesheets/bootstrap/_code.scss +0 -48
  149. data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -526
  150. data/assets/stylesheets/bootstrap/_input-group.scss +0 -208
  151. data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
  152. data/assets/stylesheets/bootstrap/_media.scss +0 -8
  153. data/assets/stylesheets/bootstrap/_print.scss +0 -141
  154. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -23
  155. data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
  156. data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
  157. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -80
  158. data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
  159. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -11
  160. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +0 -34
  161. data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
  162. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
  163. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -17
  164. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
  165. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
  166. data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
  167. data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
  168. data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
  169. data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
  170. data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
  171. data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
  172. data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
  173. data/assets/stylesheets/bootstrap/utilities/_interactions.scss +0 -5
  174. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
  175. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
  176. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
  177. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
  178. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
  179. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
  180. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
  181. data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
  182. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
  183. data/test/dummy_rails/app/views/pages/root.html.slim +0 -58
  184. /data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
@@ -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,13 +42,13 @@
42
42
  display: block;
43
43
  }
44
44
 
45
- .carousel-item-next:not(.carousel-item-left),
46
- .active.carousel-item-right {
45
+ .carousel-item-next:not(.carousel-item-start),
46
+ .active.carousel-item-end {
47
47
  transform: translateX(100%);
48
48
  }
49
49
 
50
- .carousel-item-prev:not(.carousel-item-right),
51
- .active.carousel-item-left {
50
+ .carousel-item-prev:not(.carousel-item-end),
51
+ .active.carousel-item-start {
52
52
  transform: translateX(-100%);
53
53
  }
54
54
 
@@ -65,14 +65,14 @@
65
65
  }
66
66
 
67
67
  .carousel-item.active,
68
- .carousel-item-next.carousel-item-left,
69
- .carousel-item-prev.carousel-item-right {
68
+ .carousel-item-next.carousel-item-start,
69
+ .carousel-item-prev.carousel-item-end {
70
70
  z-index: 1;
71
71
  opacity: 1;
72
72
  }
73
73
 
74
- .active.carousel-item-left,
75
- .active.carousel-item-right {
74
+ .active.carousel-item-start,
75
+ .active.carousel-item-end {
76
76
  z-index: 0;
77
77
  opacity: 0;
78
78
  @include transition(opacity 0s $carousel-transition-duration);
@@ -95,13 +95,17 @@
95
95
  align-items: center; // 2. vertically center contents
96
96
  justify-content: center; // 3. horizontally center contents
97
97
  width: $carousel-control-width;
98
+ padding: 0;
98
99
  color: $carousel-control-color;
99
100
  text-align: center;
101
+ background: none;
102
+ border: 0;
100
103
  opacity: $carousel-control-opacity;
101
104
  @include transition($carousel-control-transition);
102
105
 
103
106
  // Hover/focus state
104
- @include hover-focus() {
107
+ &:hover,
108
+ &:focus {
105
109
  color: $carousel-control-color;
106
110
  text-decoration: none;
107
111
  outline: 0;
@@ -110,15 +114,11 @@
110
114
  }
111
115
  .carousel-control-prev {
112
116
  left: 0;
113
- @if $enable-gradients {
114
- background-image: linear-gradient(90deg, rgba($black, .25), rgba($black, .001));
115
- }
117
+ background-image: if($enable-gradients, linear-gradient(90deg, rgba($black, .25), rgba($black, .001)), null);
116
118
  }
117
119
  .carousel-control-next {
118
120
  right: 0;
119
- @if $enable-gradients {
120
- background-image: linear-gradient(270deg, rgba($black, .25), rgba($black, .001));
121
- }
121
+ background-image: if($enable-gradients, linear-gradient(270deg, rgba($black, .25), rgba($black, .001)), null);
122
122
  }
123
123
 
124
124
  // Icons for within
@@ -127,8 +127,19 @@
127
127
  display: inline-block;
128
128
  width: $carousel-control-icon-width;
129
129
  height: $carousel-control-icon-width;
130
- background: 50% / 100% 100% no-repeat;
131
- }
130
+ background-repeat: no-repeat;
131
+ background-position: 50%;
132
+ background-size: 100% 100%;
133
+ }
134
+
135
+ /* rtl:options: {
136
+ "autoRename": true,
137
+ "stringMap":[ {
138
+ "name" : "prev-next",
139
+ "search" : "prev",
140
+ "replace" : "next"
141
+ } ]
142
+ } */
132
143
  .carousel-control-prev-icon {
133
144
  background-image: escape-svg($carousel-control-prev-icon-bg);
134
145
  }
@@ -136,46 +147,47 @@
136
147
  background-image: escape-svg($carousel-control-next-icon-bg);
137
148
  }
138
149
 
139
-
140
- // Optional indicator pips
150
+ // Optional indicator pips/controls
141
151
  //
142
- // Add an ordered list with the following class and add a list item for each
143
- // slide your carousel holds.
152
+ // Add a container (such as a list) with the following class and add an item (ideally a focusable control,
153
+ // like a button) with data-bs-target for each slide your carousel holds.
144
154
 
145
155
  .carousel-indicators {
146
156
  position: absolute;
147
157
  right: 0;
148
158
  bottom: 0;
149
159
  left: 0;
150
- z-index: 15;
160
+ z-index: 2;
151
161
  display: flex;
152
162
  justify-content: center;
153
- padding-left: 0; // override <ol> default
163
+ padding: 0;
154
164
  // Use the .carousel-control's width as margin so we don't overlay those
155
165
  margin-right: $carousel-control-width;
166
+ margin-bottom: 1rem;
156
167
  margin-left: $carousel-control-width;
157
- list-style: none;
158
168
 
159
- li {
169
+ [data-bs-target] {
160
170
  box-sizing: content-box;
161
171
  flex: 0 1 auto;
162
172
  width: $carousel-indicator-width;
163
173
  height: $carousel-indicator-height;
174
+ padding: 0;
164
175
  margin-right: $carousel-indicator-spacer;
165
176
  margin-left: $carousel-indicator-spacer;
166
177
  text-indent: -999px;
167
178
  cursor: pointer;
168
179
  background-color: $carousel-indicator-active-bg;
169
180
  background-clip: padding-box;
181
+ border: 0;
170
182
  // Use transparent borders to increase the hit area by 10px on top and bottom.
171
183
  border-top: $carousel-indicator-hit-area-height solid transparent;
172
184
  border-bottom: $carousel-indicator-hit-area-height solid transparent;
173
- opacity: .5;
185
+ opacity: $carousel-indicator-opacity;
174
186
  @include transition($carousel-indicator-transition);
175
187
  }
176
188
 
177
189
  .active {
178
- opacity: 1;
190
+ opacity: $carousel-indicator-active-opacity;
179
191
  }
180
192
  }
181
193
 
@@ -186,12 +198,47 @@
186
198
 
187
199
  .carousel-caption {
188
200
  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;
201
+ right: (100% - $carousel-caption-width) * .5;
202
+ bottom: $carousel-caption-spacer;
203
+ left: (100% - $carousel-caption-width) * .5;
204
+ padding-top: $carousel-caption-padding-y;
205
+ padding-bottom: $carousel-caption-padding-y;
195
206
  color: $carousel-caption-color;
196
207
  text-align: center;
197
208
  }
209
+
210
+ // Dark mode carousel
211
+
212
+ @mixin carousel-dark() {
213
+ .carousel-control-prev-icon,
214
+ .carousel-control-next-icon {
215
+ filter: $carousel-dark-control-icon-filter;
216
+ }
217
+
218
+ .carousel-indicators [data-bs-target] {
219
+ background-color: $carousel-dark-indicator-active-bg;
220
+ }
221
+
222
+ .carousel-caption {
223
+ color: $carousel-dark-caption-color;
224
+ }
225
+ }
226
+
227
+ .carousel-dark {
228
+ @include carousel-dark();
229
+ }
230
+
231
+ @if $enable-dark-mode {
232
+ @include color-mode(dark) {
233
+ @if $color-mode-type == "media-query" {
234
+ .carousel {
235
+ @include carousel-dark();
236
+ }
237
+ } @else {
238
+ .carousel,
239
+ &.carousel {
240
+ @include carousel-dark();
241
+ }
242
+ }
243
+ }
244
+ }
@@ -1,40 +1,63 @@
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
+ // scss-docs-start close-css-vars
8
+ --#{$prefix}btn-close-color: #{$btn-close-color};
9
+ --#{$prefix}btn-close-bg: #{ escape-svg($btn-close-bg) };
10
+ --#{$prefix}btn-close-opacity: #{$btn-close-opacity};
11
+ --#{$prefix}btn-close-hover-opacity: #{$btn-close-hover-opacity};
12
+ --#{$prefix}btn-close-focus-shadow: #{$btn-close-focus-shadow};
13
+ --#{$prefix}btn-close-focus-opacity: #{$btn-close-focus-opacity};
14
+ --#{$prefix}btn-close-disabled-opacity: #{$btn-close-disabled-opacity};
15
+ --#{$prefix}btn-close-white-filter: #{$btn-close-white-filter};
16
+ // scss-docs-end close-css-vars
17
+
18
+ box-sizing: content-box;
19
+ width: $btn-close-width;
20
+ height: $btn-close-height;
21
+ padding: $btn-close-padding-y $btn-close-padding-x;
22
+ color: var(--#{$prefix}btn-close-color);
23
+ background: transparent var(--#{$prefix}btn-close-bg) center / $btn-close-width auto no-repeat; // include transparent for button elements
24
+ border: 0; // for button elements
25
+ @include border-radius();
26
+ opacity: var(--#{$prefix}btn-close-opacity);
9
27
 
10
28
  // Override <a>'s hover style
11
- @include hover() {
12
- color: $close-color;
29
+ &:hover {
30
+ color: var(--#{$prefix}btn-close-color);
13
31
  text-decoration: none;
32
+ opacity: var(--#{$prefix}btn-close-hover-opacity);
14
33
  }
15
34
 
16
- &:not(:disabled):not(.disabled) {
17
- @include hover-focus() {
18
- opacity: .75;
19
- }
35
+ &:focus {
36
+ outline: 0;
37
+ box-shadow: var(--#{$prefix}btn-close-focus-shadow);
38
+ opacity: var(--#{$prefix}btn-close-focus-opacity);
20
39
  }
21
- }
22
40
 
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
41
+ &:disabled,
42
+ &.disabled {
43
+ pointer-events: none;
44
+ user-select: none;
45
+ opacity: var(--#{$prefix}btn-close-disabled-opacity);
46
+ }
47
+ }
27
48
 
28
- // stylelint-disable-next-line selector-no-qualifying-type
29
- button.close {
30
- padding: 0;
31
- background-color: transparent;
32
- border: 0;
49
+ @mixin btn-close-white() {
50
+ filter: var(--#{$prefix}btn-close-white-filter);
33
51
  }
34
52
 
35
- // Future-proof disabling of clicks on `<a>` elements
53
+ .btn-close-white {
54
+ @include btn-close-white();
55
+ }
36
56
 
37
- // stylelint-disable-next-line selector-no-qualifying-type
38
- a.close.disabled {
39
- pointer-events: none;
57
+ @if $enable-dark-mode {
58
+ @include color-mode(dark) {
59
+ .btn-close {
60
+ @include btn-close-white();
61
+ }
62
+ }
40
63
  }
@@ -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-container-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,10 @@
1
1
  // The dropdown wrapper (`<div>`)
2
2
  .dropup,
3
- .dropright,
3
+ .dropend,
4
4
  .dropdown,
5
- .dropleft {
5
+ .dropstart,
6
+ .dropup-center,
7
+ .dropdown-center {
6
8
  position: relative;
7
9
  }
8
10
 
@@ -15,50 +17,107 @@
15
17
 
16
18
  // The dropdown menu
17
19
  .dropdown-menu {
20
+ // scss-docs-start dropdown-css-vars
21
+ --#{$prefix}dropdown-zindex: #{$zindex-dropdown};
22
+ --#{$prefix}dropdown-min-width: #{$dropdown-min-width};
23
+ --#{$prefix}dropdown-padding-x: #{$dropdown-padding-x};
24
+ --#{$prefix}dropdown-padding-y: #{$dropdown-padding-y};
25
+ --#{$prefix}dropdown-spacer: #{$dropdown-spacer};
26
+ @include rfs($dropdown-font-size, --#{$prefix}dropdown-font-size);
27
+ --#{$prefix}dropdown-color: #{$dropdown-color};
28
+ --#{$prefix}dropdown-bg: #{$dropdown-bg};
29
+ --#{$prefix}dropdown-border-color: #{$dropdown-border-color};
30
+ --#{$prefix}dropdown-border-radius: #{$dropdown-border-radius};
31
+ --#{$prefix}dropdown-border-width: #{$dropdown-border-width};
32
+ --#{$prefix}dropdown-inner-border-radius: #{$dropdown-inner-border-radius};
33
+ --#{$prefix}dropdown-divider-bg: #{$dropdown-divider-bg};
34
+ --#{$prefix}dropdown-divider-margin-y: #{$dropdown-divider-margin-y};
35
+ --#{$prefix}dropdown-box-shadow: #{$dropdown-box-shadow};
36
+ --#{$prefix}dropdown-link-color: #{$dropdown-link-color};
37
+ --#{$prefix}dropdown-link-hover-color: #{$dropdown-link-hover-color};
38
+ --#{$prefix}dropdown-link-hover-bg: #{$dropdown-link-hover-bg};
39
+ --#{$prefix}dropdown-link-active-color: #{$dropdown-link-active-color};
40
+ --#{$prefix}dropdown-link-active-bg: #{$dropdown-link-active-bg};
41
+ --#{$prefix}dropdown-link-disabled-color: #{$dropdown-link-disabled-color};
42
+ --#{$prefix}dropdown-item-padding-x: #{$dropdown-item-padding-x};
43
+ --#{$prefix}dropdown-item-padding-y: #{$dropdown-item-padding-y};
44
+ --#{$prefix}dropdown-header-color: #{$dropdown-header-color};
45
+ --#{$prefix}dropdown-header-padding-x: #{$dropdown-header-padding-x};
46
+ --#{$prefix}dropdown-header-padding-y: #{$dropdown-header-padding-y};
47
+ // scss-docs-end dropdown-css-vars
48
+
18
49
  position: absolute;
19
- top: 100%;
20
- left: 0;
21
- z-index: $zindex-dropdown;
50
+ z-index: var(--#{$prefix}dropdown-zindex);
22
51
  display: none; // none by default, but block on "open" of the menu
23
- float: left;
24
- min-width: $dropdown-min-width;
25
- padding: $dropdown-padding-y $dropdown-padding-x;
26
- margin: $dropdown-spacer 0 0; // override default ul
27
- @include font-size($dropdown-font-size);
28
- color: $dropdown-color;
52
+ min-width: var(--#{$prefix}dropdown-min-width);
53
+ padding: var(--#{$prefix}dropdown-padding-y) var(--#{$prefix}dropdown-padding-x);
54
+ margin: 0; // Override default margin of ul
55
+ @include font-size(var(--#{$prefix}dropdown-font-size));
56
+ color: var(--#{$prefix}dropdown-color);
29
57
  text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer)
30
58
  list-style: none;
31
- background-color: $dropdown-bg;
59
+ background-color: var(--#{$prefix}dropdown-bg);
32
60
  background-clip: padding-box;
33
- border: $dropdown-border-width solid $dropdown-border-color;
34
- @include border-radius($dropdown-border-radius);
35
- @include box-shadow($dropdown-box-shadow);
61
+ border: var(--#{$prefix}dropdown-border-width) solid var(--#{$prefix}dropdown-border-color);
62
+ @include border-radius(var(--#{$prefix}dropdown-border-radius));
63
+ @include box-shadow(var(--#{$prefix}dropdown-box-shadow));
64
+
65
+ &[data-bs-popper] {
66
+ top: 100%;
67
+ left: 0;
68
+ margin-top: var(--#{$prefix}dropdown-spacer);
69
+ }
70
+
71
+ @if $dropdown-padding-y == 0 {
72
+ > .dropdown-item:first-child,
73
+ > li:first-child .dropdown-item {
74
+ @include border-top-radius(var(--#{$prefix}dropdown-inner-border-radius));
75
+ }
76
+ > .dropdown-item:last-child,
77
+ > li:last-child .dropdown-item {
78
+ @include border-bottom-radius(var(--#{$prefix}dropdown-inner-border-radius));
79
+ }
80
+
81
+ }
36
82
  }
37
83
 
84
+ // scss-docs-start responsive-breakpoints
85
+ // We deliberately hardcode the `bs-` prefix because we check
86
+ // this custom property in JS to determine Popper's positioning
87
+
38
88
  @each $breakpoint in map-keys($grid-breakpoints) {
39
89
  @include media-breakpoint-up($breakpoint) {
40
90
  $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
41
91
 
42
- .dropdown-menu#{$infix}-left {
43
- right: auto;
44
- left: 0;
92
+ .dropdown-menu#{$infix}-start {
93
+ --bs-position: start;
94
+
95
+ &[data-bs-popper] {
96
+ right: auto;
97
+ left: 0;
98
+ }
45
99
  }
46
100
 
47
- .dropdown-menu#{$infix}-right {
48
- right: 0;
49
- left: auto;
101
+ .dropdown-menu#{$infix}-end {
102
+ --bs-position: end;
103
+
104
+ &[data-bs-popper] {
105
+ right: 0;
106
+ left: auto;
107
+ }
50
108
  }
51
109
  }
52
110
  }
111
+ // scss-docs-end responsive-breakpoints
53
112
 
54
113
  // Allow for dropdowns to go bottom up (aka, dropup-menu)
55
114
  // Just add .dropup after the standard .dropdown class and you're set.
56
115
  .dropup {
57
- .dropdown-menu {
116
+ .dropdown-menu[data-bs-popper] {
58
117
  top: auto;
59
118
  bottom: 100%;
60
119
  margin-top: 0;
61
- margin-bottom: $dropdown-spacer;
120
+ margin-bottom: var(--#{$prefix}dropdown-spacer);
62
121
  }
63
122
 
64
123
  .dropdown-toggle {
@@ -66,55 +125,48 @@
66
125
  }
67
126
  }
68
127
 
69
- .dropright {
70
- .dropdown-menu {
128
+ .dropend {
129
+ .dropdown-menu[data-bs-popper] {
71
130
  top: 0;
72
131
  right: auto;
73
132
  left: 100%;
74
133
  margin-top: 0;
75
- margin-left: $dropdown-spacer;
134
+ margin-left: var(--#{$prefix}dropdown-spacer);
76
135
  }
77
136
 
78
137
  .dropdown-toggle {
79
- @include caret(right);
138
+ @include caret(end);
80
139
  &::after {
81
140
  vertical-align: 0;
82
141
  }
83
142
  }
84
143
  }
85
144
 
86
- .dropleft {
87
- .dropdown-menu {
145
+ .dropstart {
146
+ .dropdown-menu[data-bs-popper] {
88
147
  top: 0;
89
148
  right: 100%;
90
149
  left: auto;
91
150
  margin-top: 0;
92
- margin-right: $dropdown-spacer;
151
+ margin-right: var(--#{$prefix}dropdown-spacer);
93
152
  }
94
153
 
95
154
  .dropdown-toggle {
96
- @include caret(left);
155
+ @include caret(start);
97
156
  &::before {
98
157
  vertical-align: 0;
99
158
  }
100
159
  }
101
160
  }
102
161
 
103
- // When Popper is enabled, reset the 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
162
 
115
163
  // Dividers (basically an `<hr>`) within the dropdown
116
164
  .dropdown-divider {
117
- @include nav-divider($dropdown-divider-bg, $dropdown-divider-margin-y, true);
165
+ height: 0;
166
+ margin: var(--#{$prefix}dropdown-divider-margin-y) 0;
167
+ overflow: hidden;
168
+ border-top: 1px solid var(--#{$prefix}dropdown-divider-bg);
169
+ opacity: 1; // Revisit in v6 to de-dupe styles that conflict with <hr> element
118
170
  }
119
171
 
120
172
  // Links, buttons, and more within the dropdown menu
@@ -123,50 +175,38 @@
123
175
  .dropdown-item {
124
176
  display: block;
125
177
  width: 100%; // For `<button>`s
126
- padding: $dropdown-item-padding-y $dropdown-item-padding-x;
178
+ padding: var(--#{$prefix}dropdown-item-padding-y) var(--#{$prefix}dropdown-item-padding-x);
127
179
  clear: both;
128
180
  font-weight: $font-weight-normal;
129
- color: $dropdown-link-color;
181
+ color: var(--#{$prefix}dropdown-link-color);
130
182
  text-align: inherit; // For `<button>`s
131
183
  text-decoration: if($link-decoration == none, null, none);
132
184
  white-space: nowrap; // prevent links from randomly breaking onto new lines
133
185
  background-color: transparent; // For `<button>`s
134
186
  border: 0; // For `<button>`s
187
+ @include border-radius(var(--#{$prefix}dropdown-item-border-radius, 0));
135
188
 
136
- // Prevent dropdown overflow if there's no padding
137
- // See https://github.com/twbs/bootstrap/pull/27703
138
- @if $dropdown-padding-y == 0 {
139
- &:first-child {
140
- @include border-top-radius($dropdown-inner-border-radius);
141
- }
142
-
143
- &:last-child {
144
- @include border-bottom-radius($dropdown-inner-border-radius);
145
- }
146
- }
147
-
148
- @include hover-focus() {
149
- color: $dropdown-link-hover-color;
150
- text-decoration: none;
151
- @include gradient-bg($dropdown-link-hover-bg);
189
+ &:hover,
190
+ &:focus {
191
+ color: var(--#{$prefix}dropdown-link-hover-color);
192
+ text-decoration: if($link-hover-decoration == underline, none, null);
193
+ @include gradient-bg(var(--#{$prefix}dropdown-link-hover-bg));
152
194
  }
153
195
 
154
196
  &.active,
155
197
  &:active {
156
- color: $dropdown-link-active-color;
198
+ color: var(--#{$prefix}dropdown-link-active-color);
157
199
  text-decoration: none;
158
- @include gradient-bg($dropdown-link-active-bg);
200
+ @include gradient-bg(var(--#{$prefix}dropdown-link-active-bg));
159
201
  }
160
202
 
161
203
  &.disabled,
162
204
  &:disabled {
163
- color: $dropdown-link-disabled-color;
205
+ color: var(--#{$prefix}dropdown-link-disabled-color);
164
206
  pointer-events: none;
165
207
  background-color: transparent;
166
208
  // Remove CSS gradients if they're enabled
167
- @if $enable-gradients {
168
- background-image: none;
169
- }
209
+ background-image: if($enable-gradients, none, null);
170
210
  }
171
211
  }
172
212
 
@@ -177,16 +217,34 @@
177
217
  // Dropdown section headers
178
218
  .dropdown-header {
179
219
  display: block;
180
- padding: $dropdown-header-padding;
220
+ padding: var(--#{$prefix}dropdown-header-padding-y) var(--#{$prefix}dropdown-header-padding-x);
181
221
  margin-bottom: 0; // for use with heading elements
182
222
  @include font-size($font-size-sm);
183
- color: $dropdown-header-color;
223
+ color: var(--#{$prefix}dropdown-header-color);
184
224
  white-space: nowrap; // as with > li > a
185
225
  }
186
226
 
187
227
  // Dropdown text
188
228
  .dropdown-item-text {
189
229
  display: block;
190
- padding: $dropdown-item-padding-y $dropdown-item-padding-x;
191
- color: $dropdown-link-color;
230
+ padding: var(--#{$prefix}dropdown-item-padding-y) var(--#{$prefix}dropdown-item-padding-x);
231
+ color: var(--#{$prefix}dropdown-link-color);
232
+ }
233
+
234
+ // Dark dropdowns
235
+ .dropdown-menu-dark {
236
+ // scss-docs-start dropdown-dark-css-vars
237
+ --#{$prefix}dropdown-color: #{$dropdown-dark-color};
238
+ --#{$prefix}dropdown-bg: #{$dropdown-dark-bg};
239
+ --#{$prefix}dropdown-border-color: #{$dropdown-dark-border-color};
240
+ --#{$prefix}dropdown-box-shadow: #{$dropdown-dark-box-shadow};
241
+ --#{$prefix}dropdown-link-color: #{$dropdown-dark-link-color};
242
+ --#{$prefix}dropdown-link-hover-color: #{$dropdown-dark-link-hover-color};
243
+ --#{$prefix}dropdown-divider-bg: #{$dropdown-dark-divider-bg};
244
+ --#{$prefix}dropdown-link-hover-bg: #{$dropdown-dark-link-hover-bg};
245
+ --#{$prefix}dropdown-link-active-color: #{$dropdown-dark-link-active-color};
246
+ --#{$prefix}dropdown-link-active-bg: #{$dropdown-dark-link-active-bg};
247
+ --#{$prefix}dropdown-link-disabled-color: #{$dropdown-dark-link-disabled-color};
248
+ --#{$prefix}dropdown-header-color: #{$dropdown-dark-header-color};
249
+ // scss-docs-end dropdown-dark-css-vars
192
250
  }