bootstrap 4.6.0 → 5.3.2

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -1,347 +1,9 @@
1
- // stylelint-disable selector-no-qualifying-type
2
-
3
- //
4
- // Textual form controls
5
- //
6
-
7
- .form-control {
8
- display: block;
9
- width: 100%;
10
- height: $input-height;
11
- padding: $input-padding-y $input-padding-x;
12
- font-family: $input-font-family;
13
- @include font-size($input-font-size);
14
- font-weight: $input-font-weight;
15
- line-height: $input-line-height;
16
- color: $input-color;
17
- background-color: $input-bg;
18
- background-clip: padding-box;
19
- border: $input-border-width solid $input-border-color;
20
-
21
- // Note: This has no effect on <select>s in some browsers, due to the limited stylability of `<select>`s in CSS.
22
- @include border-radius($input-border-radius, 0);
23
-
24
- @include box-shadow($input-box-shadow);
25
- @include transition($input-transition);
26
-
27
- // Unstyle the caret on `<select>`s in IE10+.
28
- &::-ms-expand {
29
- background-color: transparent;
30
- border: 0;
31
- }
32
-
33
- // Remove select outline from select box in FF
34
- &:-moz-focusring {
35
- color: transparent;
36
- text-shadow: 0 0 0 $input-color;
37
- }
38
-
39
- // Customize the `:focus` state to imitate native WebKit styles.
40
- @include form-control-focus($ignore-warning: true);
41
-
42
- // Placeholder
43
- &::placeholder {
44
- color: $input-placeholder-color;
45
- // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526.
46
- opacity: 1;
47
- }
48
-
49
- // Disabled and read-only inputs
50
- //
51
- // HTML5 says that controls under a fieldset > legend:first-child won't be
52
- // disabled if the fieldset is disabled. Due to implementation difficulty, we
53
- // don't honor that edge case; we style them as disabled anyway.
54
- &:disabled,
55
- &[readonly] {
56
- background-color: $input-disabled-bg;
57
- // iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655.
58
- opacity: 1;
59
- }
60
- }
61
-
62
- input[type="date"],
63
- input[type="time"],
64
- input[type="datetime-local"],
65
- input[type="month"] {
66
- &.form-control {
67
- appearance: none; // Fix appearance for date inputs in Safari
68
- }
69
- }
70
-
71
- select.form-control {
72
- &:focus::-ms-value {
73
- // Suppress the nested default white text on blue background highlight given to
74
- // the selected option text when the (still closed) <select> receives focus
75
- // in IE and (under certain conditions) Edge, as it looks bad and cannot be made to
76
- // match the appearance of the native widget.
77
- // See https://github.com/twbs/bootstrap/issues/19398.
78
- color: $input-color;
79
- background-color: $input-bg;
80
- }
81
- }
82
-
83
- // Make file inputs better match text inputs by forcing them to new lines.
84
- .form-control-file,
85
- .form-control-range {
86
- display: block;
87
- width: 100%;
88
- }
89
-
90
-
91
- //
92
- // Labels
93
- //
94
-
95
- // For use with horizontal and inline forms, when you need the label (or legend)
96
- // text to align with the form controls.
97
- .col-form-label {
98
- padding-top: add($input-padding-y, $input-border-width);
99
- padding-bottom: add($input-padding-y, $input-border-width);
100
- margin-bottom: 0; // Override the `<label>/<legend>` default
101
- @include font-size(inherit); // Override the `<legend>` default
102
- line-height: $input-line-height;
103
- }
104
-
105
- .col-form-label-lg {
106
- padding-top: add($input-padding-y-lg, $input-border-width);
107
- padding-bottom: add($input-padding-y-lg, $input-border-width);
108
- @include font-size($input-font-size-lg);
109
- line-height: $input-line-height-lg;
110
- }
111
-
112
- .col-form-label-sm {
113
- padding-top: add($input-padding-y-sm, $input-border-width);
114
- padding-bottom: add($input-padding-y-sm, $input-border-width);
115
- @include font-size($input-font-size-sm);
116
- line-height: $input-line-height-sm;
117
- }
118
-
119
-
120
- // Readonly controls as plain text
121
- //
122
- // Apply class to a readonly input to make it appear like regular plain
123
- // text (without any border, background color, focus indicator)
124
-
125
- .form-control-plaintext {
126
- display: block;
127
- width: 100%;
128
- padding: $input-padding-y 0;
129
- margin-bottom: 0; // match inputs if this class comes on inputs with default margins
130
- @include font-size($input-font-size);
131
- line-height: $input-line-height;
132
- color: $input-plaintext-color;
133
- background-color: transparent;
134
- border: solid transparent;
135
- border-width: $input-border-width 0;
136
-
137
- &.form-control-sm,
138
- &.form-control-lg {
139
- padding-right: 0;
140
- padding-left: 0;
141
- }
142
- }
143
-
144
-
145
- // Form control sizing
146
- //
147
- // Build on `.form-control` with modifier classes to decrease or increase the
148
- // height and font-size of form controls.
149
- //
150
- // Repeated in `_input_group.scss` to avoid Sass extend issues.
151
-
152
- .form-control-sm {
153
- height: $input-height-sm;
154
- padding: $input-padding-y-sm $input-padding-x-sm;
155
- @include font-size($input-font-size-sm);
156
- line-height: $input-line-height-sm;
157
- @include border-radius($input-border-radius-sm);
158
- }
159
-
160
- .form-control-lg {
161
- height: $input-height-lg;
162
- padding: $input-padding-y-lg $input-padding-x-lg;
163
- @include font-size($input-font-size-lg);
164
- line-height: $input-line-height-lg;
165
- @include border-radius($input-border-radius-lg);
166
- }
167
-
168
- // stylelint-disable-next-line no-duplicate-selectors
169
- select.form-control {
170
- &[size],
171
- &[multiple] {
172
- height: auto;
173
- }
174
- }
175
-
176
- textarea.form-control {
177
- height: auto;
178
- }
179
-
180
- // Form groups
181
- //
182
- // Designed to help with the organization and spacing of vertical forms. For
183
- // horizontal forms, use the predefined grid classes.
184
-
185
- .form-group {
186
- margin-bottom: $form-group-margin-bottom;
187
- }
188
-
189
- .form-text {
190
- display: block;
191
- margin-top: $form-text-margin-top;
192
- }
193
-
194
-
195
- // Form grid
196
- //
197
- // Special replacement for our grid system's `.row` for tighter form layouts.
198
-
199
- .form-row {
200
- display: flex;
201
- flex-wrap: wrap;
202
- margin-right: -$form-grid-gutter-width / 2;
203
- margin-left: -$form-grid-gutter-width / 2;
204
-
205
- > .col,
206
- > [class*="col-"] {
207
- padding-right: $form-grid-gutter-width / 2;
208
- padding-left: $form-grid-gutter-width / 2;
209
- }
210
- }
211
-
212
-
213
- // Checkboxes and radios
214
- //
215
- // Indent the labels to position radios/checkboxes as hanging controls.
216
-
217
- .form-check {
218
- position: relative;
219
- display: block;
220
- padding-left: $form-check-input-gutter;
221
- }
222
-
223
- .form-check-input {
224
- position: absolute;
225
- margin-top: $form-check-input-margin-y;
226
- margin-left: -$form-check-input-gutter;
227
-
228
- // Use [disabled] and :disabled for workaround https://github.com/twbs/bootstrap/issues/28247
229
- &[disabled] ~ .form-check-label,
230
- &:disabled ~ .form-check-label {
231
- color: $text-muted;
232
- }
233
- }
234
-
235
- .form-check-label {
236
- margin-bottom: 0; // Override default `<label>` bottom margin
237
- }
238
-
239
- .form-check-inline {
240
- display: inline-flex;
241
- align-items: center;
242
- padding-left: 0; // Override base .form-check
243
- margin-right: $form-check-inline-margin-x;
244
-
245
- // Undo .form-check-input defaults and add some `margin-right`.
246
- .form-check-input {
247
- position: static;
248
- margin-top: 0;
249
- margin-right: $form-check-inline-input-margin-x;
250
- margin-left: 0;
251
- }
252
- }
253
-
254
-
255
- // Form validation
256
- //
257
- // Provide feedback to users when form field values are valid or invalid. Works
258
- // primarily for client-side validation via scoped `:invalid` and `:valid`
259
- // pseudo-classes but also includes `.is-invalid` and `.is-valid` classes for
260
- // server side validation.
261
-
262
- @each $state, $data in $form-validation-states {
263
- @include form-validation-state($state, map-get($data, color), map-get($data, icon));
264
- }
265
-
266
- // Inline forms
267
- //
268
- // Make forms appear inline(-block) by adding the `.form-inline` class. Inline
269
- // forms begin stacked on extra small (mobile) devices and then go inline when
270
- // viewports reach <768px.
271
- //
272
- // Requires wrapping inputs and labels with `.form-group` for proper display of
273
- // default HTML form controls and our custom form controls (e.g., input groups).
274
-
275
- .form-inline {
276
- display: flex;
277
- flex-flow: row wrap;
278
- align-items: center; // Prevent shorter elements from growing to same height as others (e.g., small buttons growing to normal sized button height)
279
-
280
- // Because we use flex, the initial sizing of checkboxes is collapsed and
281
- // doesn't occupy the full-width (which is what we want for xs grid tier),
282
- // so we force that here.
283
- .form-check {
284
- width: 100%;
285
- }
286
-
287
- // Kick in the inline
288
- @include media-breakpoint-up(sm) {
289
- label {
290
- display: flex;
291
- align-items: center;
292
- justify-content: center;
293
- margin-bottom: 0;
294
- }
295
-
296
- // Inline-block all the things for "inline"
297
- .form-group {
298
- display: flex;
299
- flex: 0 0 auto;
300
- flex-flow: row wrap;
301
- align-items: center;
302
- margin-bottom: 0;
303
- }
304
-
305
- // Allow folks to *not* use `.form-group`
306
- .form-control {
307
- display: inline-block;
308
- width: auto; // Prevent labels from stacking above inputs in `.form-group`
309
- vertical-align: middle;
310
- }
311
-
312
- // Make static controls behave like regular ones
313
- .form-control-plaintext {
314
- display: inline-block;
315
- }
316
-
317
- .input-group,
318
- .custom-select {
319
- width: auto;
320
- }
321
-
322
- // Remove default margin on radios/checkboxes that were used for stacking, and
323
- // then undo the floating of radios and checkboxes to match.
324
- .form-check {
325
- display: flex;
326
- align-items: center;
327
- justify-content: center;
328
- width: auto;
329
- padding-left: 0;
330
- }
331
- .form-check-input {
332
- position: relative;
333
- flex-shrink: 0;
334
- margin-top: 0;
335
- margin-right: $form-check-input-margin-x;
336
- margin-left: 0;
337
- }
338
-
339
- .custom-control {
340
- align-items: center;
341
- justify-content: center;
342
- }
343
- .custom-control-label {
344
- margin-bottom: 0;
345
- }
346
- }
347
- }
1
+ @import "forms/labels";
2
+ @import "forms/form-text";
3
+ @import "forms/form-control";
4
+ @import "forms/form-select";
5
+ @import "forms/form-check";
6
+ @import "forms/form-range";
7
+ @import "forms/floating-labels";
8
+ @import "forms/input-group";
9
+ @import "forms/validation";
@@ -32,10 +32,84 @@
32
32
  }
33
33
  }
34
34
 
35
+ // Colors
36
+ @function to-rgb($value) {
37
+ @return red($value), green($value), blue($value);
38
+ }
39
+
40
+ // stylelint-disable scss/dollar-variable-pattern
41
+ @function rgba-css-var($identifier, $target) {
42
+ @if $identifier == "body" and $target == "bg" {
43
+ @return rgba(var(--#{$prefix}#{$identifier}-bg-rgb), var(--#{$prefix}#{$target}-opacity));
44
+ } @if $identifier == "body" and $target == "text" {
45
+ @return rgba(var(--#{$prefix}#{$identifier}-color-rgb), var(--#{$prefix}#{$target}-opacity));
46
+ } @else {
47
+ @return rgba(var(--#{$prefix}#{$identifier}-rgb), var(--#{$prefix}#{$target}-opacity));
48
+ }
49
+ }
50
+
51
+ @function map-loop($map, $func, $args...) {
52
+ $_map: ();
53
+
54
+ @each $key, $value in $map {
55
+ // allow to pass the $key and $value of the map as an function argument
56
+ $_args: ();
57
+ @each $arg in $args {
58
+ $_args: append($_args, if($arg == "$key", $key, if($arg == "$value", $value, $arg)));
59
+ }
60
+
61
+ $_map: map-merge($_map, ($key: call(get-function($func), $_args...)));
62
+ }
63
+
64
+ @return $_map;
65
+ }
66
+ // stylelint-enable scss/dollar-variable-pattern
67
+
68
+ @function varify($list) {
69
+ $result: null;
70
+ @each $entry in $list {
71
+ $result: append($result, var(--#{$prefix}#{$entry}), space);
72
+ }
73
+ @return $result;
74
+ }
75
+
76
+ // Internal Bootstrap function to turn maps into its negative variant.
77
+ // It prefixes the keys with `n` and makes the value negative.
78
+ @function negativify-map($map) {
79
+ $result: ();
80
+ @each $key, $value in $map {
81
+ @if $key != 0 {
82
+ $result: map-merge($result, ("n" + $key: (-$value)));
83
+ }
84
+ }
85
+ @return $result;
86
+ }
87
+
88
+ // Get multiple keys from a sass map
89
+ @function map-get-multiple($map, $values) {
90
+ $result: ();
91
+ @each $key, $value in $map {
92
+ @if (index($values, $key) != null) {
93
+ $result: map-merge($result, ($key: $value));
94
+ }
95
+ }
96
+ @return $result;
97
+ }
98
+
99
+ // Merge multiple maps
100
+ @function map-merge-multiple($maps...) {
101
+ $merged-maps: ();
102
+
103
+ @each $map in $maps {
104
+ $merged-maps: map-merge($merged-maps, $map);
105
+ }
106
+ @return $merged-maps;
107
+ }
108
+
35
109
  // Replace `$search` with `$replace` in `$string`
36
110
  // Used on our SVG icon backgrounds for custom forms.
37
111
  //
38
- // @author Hugo Giraudel
112
+ // @author Kitty Giraudel
39
113
  // @param {String} $string - Initial string
40
114
  // @param {String} $search - Substring to replace
41
115
  // @param {String} $replace ('') - New value
@@ -70,42 +144,80 @@
70
144
  }
71
145
 
72
146
  // Color contrast
73
- @function color-yiq($color, $dark: $yiq-text-dark, $light: $yiq-text-light) {
74
- $r: red($color);
75
- $g: green($color);
76
- $b: blue($color);
147
+ // See https://github.com/twbs/bootstrap/pull/30168
77
148
 
78
- $yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000;
149
+ // A list of pre-calculated numbers of pow(divide((divide($value, 255) + .055), 1.055), 2.4). (from 0 to 255)
150
+ // stylelint-disable-next-line scss/dollar-variable-default, scss/dollar-variable-pattern
151
+ $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003 .0033 .0037 .004 .0044 .0048 .0052 .0056 .006 .0065 .007 .0075 .008 .0086 .0091 .0097 .0103 .011 .0116 .0123 .013 .0137 .0144 .0152 .016 .0168 .0176 .0185 .0194 .0203 .0212 .0222 .0232 .0242 .0252 .0262 .0273 .0284 .0296 .0307 .0319 .0331 .0343 .0356 .0369 .0382 .0395 .0409 .0423 .0437 .0452 .0467 .0482 .0497 .0513 .0529 .0545 .0561 .0578 .0595 .0612 .063 .0648 .0666 .0685 .0704 .0723 .0742 .0762 .0782 .0802 .0823 .0844 .0865 .0887 .0908 .0931 .0953 .0976 .0999 .1022 .1046 .107 .1095 .1119 .1144 .117 .1195 .1221 .1248 .1274 .1301 .1329 .1356 .1384 .1413 .1441 .147 .15 .1529 .1559 .159 .162 .1651 .1683 .1714 .1746 .1779 .1812 .1845 .1878 .1912 .1946 .1981 .2016 .2051 .2086 .2122 .2159 .2195 .2232 .227 .2307 .2346 .2384 .2423 .2462 .2502 .2542 .2582 .2623 .2664 .2705 .2747 .2789 .2831 .2874 .2918 .2961 .3005 .305 .3095 .314 .3185 .3231 .3278 .3325 .3372 .3419 .3467 .3515 .3564 .3613 .3663 .3712 .3763 .3813 .3864 .3916 .3968 .402 .4072 .4125 .4179 .4233 .4287 .4342 .4397 .4452 .4508 .4564 .4621 .4678 .4735 .4793 .4851 .491 .4969 .5029 .5089 .5149 .521 .5271 .5333 .5395 .5457 .552 .5583 .5647 .5711 .5776 .5841 .5906 .5972 .6038 .6105 .6172 .624 .6308 .6376 .6445 .6514 .6584 .6654 .6724 .6795 .6867 .6939 .7011 .7084 .7157 .7231 .7305 .7379 .7454 .7529 .7605 .7682 .7758 .7835 .7913 .7991 .807 .8148 .8228 .8308 .8388 .8469 .855 .8632 .8714 .8796 .8879 .8963 .9047 .9131 .9216 .9301 .9387 .9473 .956 .9647 .9734 .9823 .9911 1;
79
152
 
80
- @if ($yiq >= $yiq-contrasted-threshold) {
81
- @return $dark;
82
- } @else {
83
- @return $light;
153
+ @function color-contrast($background, $color-contrast-dark: $color-contrast-dark, $color-contrast-light: $color-contrast-light, $min-contrast-ratio: $min-contrast-ratio) {
154
+ $foregrounds: $color-contrast-light, $color-contrast-dark, $white, $black;
155
+ $max-ratio: 0;
156
+ $max-ratio-color: null;
157
+
158
+ @each $color in $foregrounds {
159
+ $contrast-ratio: contrast-ratio($background, $color);
160
+ @if $contrast-ratio > $min-contrast-ratio {
161
+ @return $color;
162
+ } @else if $contrast-ratio > $max-ratio {
163
+ $max-ratio: $contrast-ratio;
164
+ $max-ratio-color: $color;
165
+ }
84
166
  }
167
+
168
+ @warn "Found no color leading to #{$min-contrast-ratio}:1 contrast ratio against #{$background}...";
169
+
170
+ @return $max-ratio-color;
85
171
  }
86
172
 
87
- // Retrieve color Sass maps
88
- @function color($key: "blue") {
89
- @return map-get($colors, $key);
173
+ @function contrast-ratio($background, $foreground: $color-contrast-light) {
174
+ $l1: luminance($background);
175
+ $l2: luminance(opaque($background, $foreground));
176
+
177
+ @return if($l1 > $l2, divide($l1 + .05, $l2 + .05), divide($l2 + .05, $l1 + .05));
90
178
  }
91
179
 
92
- @function theme-color($key: "primary") {
93
- @return map-get($theme-colors, $key);
180
+ // Return WCAG2.1 relative luminance
181
+ // See https://www.w3.org/TR/WCAG/#dfn-relative-luminance
182
+ // See https://www.w3.org/TR/WCAG/#dfn-contrast-ratio
183
+ @function luminance($color) {
184
+ $rgb: (
185
+ "r": red($color),
186
+ "g": green($color),
187
+ "b": blue($color)
188
+ );
189
+
190
+ @each $name, $value in $rgb {
191
+ $value: if(divide($value, 255) < .04045, divide(divide($value, 255), 12.92), nth($_luminance-list, $value + 1));
192
+ $rgb: map-merge($rgb, ($name: $value));
193
+ }
194
+
195
+ @return (map-get($rgb, "r") * .2126) + (map-get($rgb, "g") * .7152) + (map-get($rgb, "b") * .0722);
94
196
  }
95
197
 
96
- @function gray($key: "100") {
97
- @return map-get($grays, $key);
198
+ // Return opaque color
199
+ // opaque(#fff, rgba(0, 0, 0, .5)) => #808080
200
+ @function opaque($background, $foreground) {
201
+ @return mix(rgba($foreground, 1), $background, opacity($foreground) * 100%);
98
202
  }
99
203
 
100
- // Request a theme color level
101
- @function theme-color-level($color-name: "primary", $level: 0) {
102
- $color: theme-color($color-name);
103
- $color-base: if($level > 0, $black, $white);
104
- $level: abs($level);
204
+ // scss-docs-start color-functions
205
+ // Tint a color: mix a color with white
206
+ @function tint-color($color, $weight) {
207
+ @return mix(white, $color, $weight);
208
+ }
105
209
 
106
- @return mix($color-base, $color, $level * $theme-color-interval);
210
+ // Shade a color: mix a color with black
211
+ @function shade-color($color, $weight) {
212
+ @return mix(black, $color, $weight);
107
213
  }
108
214
 
215
+ // Shade the color if the weight is positive, else tint it
216
+ @function shift-color($color, $weight) {
217
+ @return if($weight > 0, shade-color($color, $weight), tint-color($color, -$weight));
218
+ }
219
+ // scss-docs-end color-functions
220
+
109
221
  // Return valid calc
110
222
  @function add($value1, $value2, $return-calc: true) {
111
223
  @if $value1 == null {
@@ -140,5 +252,51 @@
140
252
  @return $value1 - $value2;
141
253
  }
142
254
 
255
+ @if type-of($value2) != number {
256
+ $value2: unquote("(") + $value2 + unquote(")");
257
+ }
258
+
143
259
  @return if($return-calc == true, calc(#{$value1} - #{$value2}), $value1 + unquote(" - ") + $value2);
144
260
  }
261
+
262
+ @function divide($dividend, $divisor, $precision: 10) {
263
+ $sign: if($dividend > 0 and $divisor > 0 or $dividend < 0 and $divisor < 0, 1, -1);
264
+ $dividend: abs($dividend);
265
+ $divisor: abs($divisor);
266
+ @if $dividend == 0 {
267
+ @return 0;
268
+ }
269
+ @if $divisor == 0 {
270
+ @error "Cannot divide by 0";
271
+ }
272
+ $remainder: $dividend;
273
+ $result: 0;
274
+ $factor: 10;
275
+ @while ($remainder > 0 and $precision >= 0) {
276
+ $quotient: 0;
277
+ @while ($remainder >= $divisor) {
278
+ $remainder: $remainder - $divisor;
279
+ $quotient: $quotient + 1;
280
+ }
281
+ $result: $result * 10 + $quotient;
282
+ $factor: $factor * .1;
283
+ $remainder: $remainder * 10;
284
+ $precision: $precision - 1;
285
+ @if ($precision < 0 and $remainder >= $divisor * 5) {
286
+ $result: $result + 1;
287
+ }
288
+ }
289
+ $result: $result * $factor * $sign;
290
+ $dividend-unit: unit($dividend);
291
+ $divisor-unit: unit($divisor);
292
+ $unit-map: (
293
+ "px": 1px,
294
+ "rem": 1rem,
295
+ "em": 1em,
296
+ "%": 1%
297
+ );
298
+ @if ($dividend-unit != $divisor-unit and map-has-key($unit-map, $dividend-unit)) {
299
+ $result: $result * map-get($unit-map, $dividend-unit);
300
+ }
301
+ @return $result;
302
+ }
@@ -1,69 +1,35 @@
1
- // Container widths
1
+ // Row
2
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
- }
3
+ // Rows contain your columns.
32
4
 
33
- // Once the current breakpoint is reached, stop extending
34
- @if ($breakpoint == $name) {
35
- $extend-breakpoint: false;
36
- }
37
- }
38
- }
39
- }
5
+ :root {
6
+ @each $name, $value in $grid-breakpoints {
7
+ --#{$prefix}breakpoint-#{$name}: #{$value};
40
8
  }
41
9
  }
42
10
 
43
-
44
- // Row
45
- //
46
- // Rows contain your columns.
47
-
48
11
  @if $enable-grid-classes {
49
12
  .row {
50
13
  @include make-row();
14
+
15
+ > * {
16
+ @include make-col-ready();
17
+ }
51
18
  }
19
+ }
52
20
 
53
- // Remove the negative margin from default .row, then the horizontal padding
54
- // from all immediate children columns (to prevent runaway style inheritance).
55
- .no-gutters {
56
- margin-right: 0;
57
- margin-left: 0;
21
+ @if $enable-cssgrid {
22
+ .grid {
23
+ display: grid;
24
+ grid-template-rows: repeat(var(--#{$prefix}rows, 1), 1fr);
25
+ grid-template-columns: repeat(var(--#{$prefix}columns, #{$grid-columns}), 1fr);
26
+ gap: var(--#{$prefix}gap, #{$grid-gutter-width});
58
27
 
59
- > .col,
60
- > [class*="col-"] {
61
- padding-right: 0;
62
- padding-left: 0;
63
- }
28
+ @include make-cssgrid();
64
29
  }
65
30
  }
66
31
 
32
+
67
33
  // Columns
68
34
  //
69
35
  // Common styles for small and large grid columns
@@ -0,0 +1,12 @@
1
+ @import "helpers/clearfix";
2
+ @import "helpers/color-bg";
3
+ @import "helpers/colored-links";
4
+ @import "helpers/focus-ring";
5
+ @import "helpers/icon-link";
6
+ @import "helpers/ratio";
7
+ @import "helpers/position";
8
+ @import "helpers/stacks";
9
+ @import "helpers/visually-hidden";
10
+ @import "helpers/stretched-link";
11
+ @import "helpers/text-truncation";
12
+ @import "helpers/vr";