bootstrap 4.3.1 → 4.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +15 -1
  3. data/CHANGELOG.md +2 -14
  4. data/README.md +1 -1
  5. data/assets/javascripts/bootstrap-sprockets.js +7 -7
  6. data/assets/javascripts/bootstrap.js +1073 -1076
  7. data/assets/javascripts/bootstrap.min.js +4 -4
  8. data/assets/javascripts/bootstrap/alert.js +42 -49
  9. data/assets/javascripts/bootstrap/button.js +111 -64
  10. data/assets/javascripts/bootstrap/carousel.js +162 -177
  11. data/assets/javascripts/bootstrap/collapse.js +97 -122
  12. data/assets/javascripts/bootstrap/dropdown.js +163 -189
  13. data/assets/javascripts/bootstrap/modal.js +213 -194
  14. data/assets/javascripts/bootstrap/popover.js +51 -72
  15. data/assets/javascripts/bootstrap/scrollspy.js +80 -109
  16. data/assets/javascripts/bootstrap/tab.js +72 -79
  17. data/assets/javascripts/bootstrap/toast.js +96 -107
  18. data/assets/javascripts/bootstrap/tooltip.js +186 -201
  19. data/assets/javascripts/bootstrap/util.js +41 -20
  20. data/assets/stylesheets/_bootstrap-grid.scss +5 -4
  21. data/assets/stylesheets/_bootstrap-reboot.scss +4 -4
  22. data/assets/stylesheets/_bootstrap.scss +4 -4
  23. data/assets/stylesheets/bootstrap/_alert.scss +1 -0
  24. data/assets/stylesheets/bootstrap/_badge.scss +1 -1
  25. data/assets/stylesheets/bootstrap/_breadcrumb.scss +3 -2
  26. data/assets/stylesheets/bootstrap/_button-group.scss +1 -1
  27. data/assets/stylesheets/bootstrap/_buttons.scss +13 -8
  28. data/assets/stylesheets/bootstrap/_card.scss +42 -45
  29. data/assets/stylesheets/bootstrap/_carousel.scss +7 -7
  30. data/assets/stylesheets/bootstrap/_close.scss +2 -3
  31. data/assets/stylesheets/bootstrap/_code.scss +1 -1
  32. data/assets/stylesheets/bootstrap/_custom-forms.scss +38 -19
  33. data/assets/stylesheets/bootstrap/_dropdown.scss +7 -6
  34. data/assets/stylesheets/bootstrap/_forms.scss +26 -9
  35. data/assets/stylesheets/bootstrap/_functions.scss +63 -5
  36. data/assets/stylesheets/bootstrap/_grid.scss +32 -11
  37. data/assets/stylesheets/bootstrap/_images.scss +2 -2
  38. data/assets/stylesheets/bootstrap/_input-group.scss +21 -6
  39. data/assets/stylesheets/bootstrap/_list-group.scss +36 -31
  40. data/assets/stylesheets/bootstrap/_mixins.scss +3 -3
  41. data/assets/stylesheets/bootstrap/_modal.scss +26 -15
  42. data/assets/stylesheets/bootstrap/_nav.scss +7 -7
  43. data/assets/stylesheets/bootstrap/_navbar.scss +55 -17
  44. data/assets/stylesheets/bootstrap/_pagination.scss +5 -4
  45. data/assets/stylesheets/bootstrap/_popover.scss +8 -9
  46. data/assets/stylesheets/bootstrap/_print.scss +2 -2
  47. data/assets/stylesheets/bootstrap/_progress.scss +7 -3
  48. data/assets/stylesheets/bootstrap/_reboot.scss +39 -38
  49. data/assets/stylesheets/bootstrap/_spinners.scss +14 -4
  50. data/assets/stylesheets/bootstrap/_tables.scss +3 -3
  51. data/assets/stylesheets/bootstrap/_toasts.scss +4 -2
  52. data/assets/stylesheets/bootstrap/_type.scss +3 -3
  53. data/assets/stylesheets/bootstrap/_utilities.scss +2 -1
  54. data/assets/stylesheets/bootstrap/_variables.scss +58 -35
  55. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +5 -3
  56. data/assets/stylesheets/bootstrap/mixins/_badge.scss +1 -1
  57. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +27 -14
  58. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +11 -8
  59. data/assets/stylesheets/bootstrap/mixins/_caret.scss +8 -8
  60. data/assets/stylesheets/bootstrap/mixins/_float.scss +3 -3
  61. data/assets/stylesheets/bootstrap/mixins/_forms.scss +42 -49
  62. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +29 -15
  63. data/assets/stylesheets/bootstrap/mixins/_grid.scss +25 -7
  64. data/assets/stylesheets/bootstrap/mixins/_hover.scss +4 -4
  65. data/assets/stylesheets/bootstrap/mixins/_image.scss +2 -2
  66. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +1 -1
  67. data/assets/stylesheets/bootstrap/mixins/_lists.scss +1 -1
  68. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +2 -1
  69. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +1 -1
  70. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +4 -3
  71. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +1 -1
  72. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +3 -2
  73. data/assets/stylesheets/bootstrap/mixins/_transition.scss +18 -8
  74. data/assets/stylesheets/bootstrap/utilities/_background.scss +2 -2
  75. data/assets/stylesheets/bootstrap/utilities/_borders.scss +1 -1
  76. data/assets/stylesheets/bootstrap/utilities/_interactions.scss +5 -0
  77. data/assets/stylesheets/bootstrap/utilities/_text.scss +4 -4
  78. data/bootstrap.gemspec +1 -1
  79. data/lib/bootstrap/version.rb +2 -2
  80. data/tasks/updater/network.rb +2 -2
  81. data/test/dummy_rails/app/assets/config/manifest.js +3 -0
  82. data/test/dummy_rails/app/assets/stylesheets/.browserslistrc +1 -0
  83. data/test/gemfiles/rails_6_0.gemfile +7 -0
  84. data/test/support/dummy_rails_integration.rb +3 -1
  85. data/test/test_helper.rb +18 -13
  86. metadata +11 -5
@@ -75,7 +75,7 @@
75
75
  .active.carousel-item-right {
76
76
  z-index: 0;
77
77
  opacity: 0;
78
- @include transition(0s $carousel-transition-duration opacity);
78
+ @include transition(opacity 0s $carousel-transition-duration);
79
79
  }
80
80
  }
81
81
 
@@ -101,7 +101,7 @@
101
101
  @include transition($carousel-control-transition);
102
102
 
103
103
  // Hover/focus state
104
- @include hover-focus {
104
+ @include hover-focus() {
105
105
  color: $carousel-control-color;
106
106
  text-decoration: none;
107
107
  outline: 0;
@@ -111,13 +111,13 @@
111
111
  .carousel-control-prev {
112
112
  left: 0;
113
113
  @if $enable-gradients {
114
- background: linear-gradient(90deg, rgba($black, .25), rgba($black, .001));
114
+ background-image: linear-gradient(90deg, rgba($black, .25), rgba($black, .001));
115
115
  }
116
116
  }
117
117
  .carousel-control-next {
118
118
  right: 0;
119
119
  @if $enable-gradients {
120
- background: linear-gradient(270deg, rgba($black, .25), rgba($black, .001));
120
+ background-image: linear-gradient(270deg, rgba($black, .25), rgba($black, .001));
121
121
  }
122
122
  }
123
123
 
@@ -127,13 +127,13 @@
127
127
  display: inline-block;
128
128
  width: $carousel-control-icon-width;
129
129
  height: $carousel-control-icon-width;
130
- background: no-repeat 50% / 100% 100%;
130
+ background: 50% / 100% 100% no-repeat;
131
131
  }
132
132
  .carousel-control-prev-icon {
133
- background-image: $carousel-control-prev-icon-bg;
133
+ background-image: escape-svg($carousel-control-prev-icon-bg);
134
134
  }
135
135
  .carousel-control-next-icon {
136
- background-image: $carousel-control-next-icon-bg;
136
+ background-image: escape-svg($carousel-control-next-icon-bg);
137
137
  }
138
138
 
139
139
 
@@ -8,13 +8,13 @@
8
8
  opacity: .5;
9
9
 
10
10
  // Override <a>'s hover style
11
- @include hover {
11
+ @include hover() {
12
12
  color: $close-color;
13
13
  text-decoration: none;
14
14
  }
15
15
 
16
16
  &:not(:disabled):not(.disabled) {
17
- @include hover-focus {
17
+ @include hover-focus() {
18
18
  opacity: .75;
19
19
  }
20
20
  }
@@ -30,7 +30,6 @@ button.close {
30
30
  padding: 0;
31
31
  background-color: transparent;
32
32
  border: 0;
33
- appearance: none;
34
33
  }
35
34
 
36
35
  // Future-proof disabling of clicks on `<a>` elements
@@ -2,7 +2,7 @@
2
2
  code {
3
3
  @include font-size($code-font-size);
4
4
  color: $code-color;
5
- word-break: break-word;
5
+ word-wrap: break-word;
6
6
 
7
7
  // Streamline the style when inside anchors to avoid broken underline and more
8
8
  a > & {
@@ -9,9 +9,11 @@
9
9
 
10
10
  .custom-control {
11
11
  position: relative;
12
+ z-index: 1;
12
13
  display: block;
13
14
  min-height: $font-size-base * $line-height-base;
14
15
  padding-left: $custom-control-gutter + $custom-control-indicator-size;
16
+ color-adjust: exact; // Keep themed appearance for print
15
17
  }
16
18
 
17
19
  .custom-control-inline {
@@ -21,7 +23,10 @@
21
23
 
22
24
  .custom-control-input {
23
25
  position: absolute;
26
+ left: 0;
24
27
  z-index: -1; // Put the input behind the label so it doesn't overlay text
28
+ width: $custom-control-indicator-size;
29
+ height: ($font-size-base * $line-height-base + $custom-control-indicator-size) / 2;
25
30
  opacity: 0;
26
31
 
27
32
  &:checked ~ .custom-control-label::before {
@@ -34,7 +39,7 @@
34
39
  &:focus ~ .custom-control-label::before {
35
40
  // the mixin is not used here to make sure there is feedback
36
41
  @if $enable-shadows {
37
- box-shadow: $input-box-shadow, $input-focus-box-shadow;
42
+ box-shadow: $input-box-shadow, $custom-control-indicator-focus-box-shadow;
38
43
  } @else {
39
44
  box-shadow: $custom-control-indicator-focus-box-shadow;
40
45
  }
@@ -51,6 +56,8 @@
51
56
  @include box-shadow($custom-control-indicator-active-box-shadow);
52
57
  }
53
58
 
59
+ // Use [disabled] and :disabled to work around https://github.com/twbs/bootstrap/issues/28247
60
+ &[disabled],
54
61
  &:disabled {
55
62
  ~ .custom-control-label {
56
63
  color: $custom-control-label-disabled-color;
@@ -69,7 +76,9 @@
69
76
  .custom-control-label {
70
77
  position: relative;
71
78
  margin-bottom: 0;
79
+ color: $custom-control-label-color;
72
80
  vertical-align: top;
81
+ cursor: $custom-control-cursor;
73
82
 
74
83
  // Background-color and (when enabled) gradient
75
84
  &::before {
@@ -95,7 +104,7 @@
95
104
  width: $custom-control-indicator-size;
96
105
  height: $custom-control-indicator-size;
97
106
  content: "";
98
- background: no-repeat 50% / #{$custom-control-indicator-bg-size};
107
+ background: 50% / #{$custom-control-indicator-bg-size} no-repeat;
99
108
  }
100
109
  }
101
110
 
@@ -111,7 +120,7 @@
111
120
 
112
121
  .custom-control-input:checked ~ .custom-control-label {
113
122
  &::after {
114
- background-image: $custom-checkbox-indicator-icon-checked;
123
+ background-image: escape-svg($custom-checkbox-indicator-icon-checked);
115
124
  }
116
125
  }
117
126
 
@@ -122,16 +131,16 @@
122
131
  @include box-shadow($custom-checkbox-indicator-indeterminate-box-shadow);
123
132
  }
124
133
  &::after {
125
- background-image: $custom-checkbox-indicator-icon-indeterminate;
134
+ background-image: escape-svg($custom-checkbox-indicator-icon-indeterminate);
126
135
  }
127
136
  }
128
137
 
129
138
  .custom-control-input:disabled {
130
139
  &:checked ~ .custom-control-label::before {
131
- background-color: $custom-control-indicator-checked-disabled-bg;
140
+ @include gradient-bg($custom-control-indicator-checked-disabled-bg);
132
141
  }
133
142
  &:indeterminate ~ .custom-control-label::before {
134
- background-color: $custom-control-indicator-checked-disabled-bg;
143
+ @include gradient-bg($custom-control-indicator-checked-disabled-bg);
135
144
  }
136
145
  }
137
146
  }
@@ -142,19 +151,19 @@
142
151
 
143
152
  .custom-radio {
144
153
  .custom-control-label::before {
145
- // stylelint-disable-next-line property-blacklist
154
+ // stylelint-disable-next-line property-disallowed-list
146
155
  border-radius: $custom-radio-indicator-border-radius;
147
156
  }
148
157
 
149
158
  .custom-control-input:checked ~ .custom-control-label {
150
159
  &::after {
151
- background-image: $custom-radio-indicator-icon-checked;
160
+ background-image: escape-svg($custom-radio-indicator-icon-checked);
152
161
  }
153
162
  }
154
163
 
155
164
  .custom-control-input:disabled {
156
165
  &:checked ~ .custom-control-label::before {
157
- background-color: $custom-control-indicator-checked-disabled-bg;
166
+ @include gradient-bg($custom-control-indicator-checked-disabled-bg);
158
167
  }
159
168
  }
160
169
  }
@@ -172,17 +181,17 @@
172
181
  left: -($custom-switch-width + $custom-control-gutter);
173
182
  width: $custom-switch-width;
174
183
  pointer-events: all;
175
- // stylelint-disable-next-line property-blacklist
184
+ // stylelint-disable-next-line property-disallowed-list
176
185
  border-radius: $custom-switch-indicator-border-radius;
177
186
  }
178
187
 
179
188
  &::after {
180
- top: calc(#{(($font-size-base * $line-height-base - $custom-control-indicator-size) / 2)} + #{$custom-control-indicator-border-width * 2});
181
- left: calc(#{-($custom-switch-width + $custom-control-gutter)} + #{$custom-control-indicator-border-width * 2});
189
+ top: add(($font-size-base * $line-height-base - $custom-control-indicator-size) / 2, $custom-control-indicator-border-width * 2);
190
+ left: add(-($custom-switch-width + $custom-control-gutter), $custom-control-indicator-border-width * 2);
182
191
  width: $custom-switch-indicator-size;
183
192
  height: $custom-switch-indicator-size;
184
193
  background-color: $custom-control-indicator-border-color;
185
- // stylelint-disable-next-line property-blacklist
194
+ // stylelint-disable-next-line property-disallowed-list
186
195
  border-radius: $custom-switch-indicator-border-radius;
187
196
  @include transition(transform .15s ease-in-out, $custom-forms-transition);
188
197
  }
@@ -197,7 +206,7 @@
197
206
 
198
207
  .custom-control-input:disabled {
199
208
  &:checked ~ .custom-control-label::before {
200
- background-color: $custom-control-indicator-checked-disabled-bg;
209
+ @include gradient-bg($custom-control-indicator-checked-disabled-bg);
201
210
  }
202
211
  }
203
212
  }
@@ -220,8 +229,7 @@
220
229
  line-height: $custom-select-line-height;
221
230
  color: $custom-select-color;
222
231
  vertical-align: middle;
223
- background: $custom-select-background;
224
- background-color: $custom-select-bg;
232
+ background: $custom-select-bg $custom-select-background;
225
233
  border: $custom-select-border-width solid $custom-select-border-color;
226
234
  @include border-radius($custom-select-border-radius, 0);
227
235
  @include box-shadow($custom-select-box-shadow);
@@ -231,8 +239,9 @@
231
239
  border-color: $custom-select-focus-border-color;
232
240
  outline: 0;
233
241
  @if $enable-shadows {
234
- box-shadow: $custom-select-box-shadow, $custom-select-focus-box-shadow;
242
+ @include box-shadow($custom-select-box-shadow, $custom-select-focus-box-shadow);
235
243
  } @else {
244
+ // Avoid using mixin so we can pass custom focus shadow properly
236
245
  box-shadow: $custom-select-focus-box-shadow;
237
246
  }
238
247
 
@@ -263,6 +272,12 @@
263
272
  &::-ms-expand {
264
273
  display: none;
265
274
  }
275
+
276
+ // Remove outline from select box in FF
277
+ &:-moz-focusring {
278
+ color: transparent;
279
+ text-shadow: 0 0 0 $custom-select-color;
280
+ }
266
281
  }
267
282
 
268
283
  .custom-select-sm {
@@ -300,6 +315,7 @@
300
315
  width: 100%;
301
316
  height: $custom-file-height;
302
317
  margin: 0;
318
+ overflow: hidden;
303
319
  opacity: 0;
304
320
 
305
321
  &:focus ~ .custom-file-label {
@@ -307,6 +323,8 @@
307
323
  box-shadow: $custom-file-focus-box-shadow;
308
324
  }
309
325
 
326
+ // Use [disabled] and :disabled to work around https://github.com/twbs/bootstrap/issues/28247
327
+ &[disabled] ~ .custom-file-label,
310
328
  &:disabled ~ .custom-file-label {
311
329
  background-color: $custom-file-disabled-bg;
312
330
  }
@@ -330,6 +348,7 @@
330
348
  z-index: 1;
331
349
  height: $custom-file-height;
332
350
  padding: $custom-file-padding-y $custom-file-padding-x;
351
+ overflow: hidden;
333
352
  font-family: $custom-file-font-family;
334
353
  font-weight: $custom-file-font-weight;
335
354
  line-height: $custom-file-line-height;
@@ -365,13 +384,13 @@
365
384
 
366
385
  .custom-range {
367
386
  width: 100%;
368
- height: calc(#{$custom-range-thumb-height} + #{$custom-range-thumb-focus-box-shadow-width * 2});
387
+ height: add($custom-range-thumb-height, $custom-range-thumb-focus-box-shadow-width * 2);
369
388
  padding: 0; // Need to reset padding
370
389
  background-color: transparent;
371
390
  appearance: none;
372
391
 
373
392
  &:focus {
374
- outline: none;
393
+ outline: 0;
375
394
 
376
395
  // Pseudo-elements must be split across multiple rulesets to have an effect.
377
396
  // No box-shadow() mixin for focus accessibility.
@@ -10,7 +10,7 @@
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
@@ -22,7 +22,7 @@
22
22
  display: none; // none by default, but block on "open" of the menu
23
23
  float: left;
24
24
  min-width: $dropdown-min-width;
25
- padding: $dropdown-padding-y 0;
25
+ padding: $dropdown-padding-y $dropdown-padding-x;
26
26
  margin: $dropdown-spacer 0 0; // override default ul
27
27
  @include font-size($dropdown-font-size);
28
28
  color: $dropdown-color;
@@ -100,7 +100,7 @@
100
100
  }
101
101
  }
102
102
 
103
- // When enabled Popper.js, reset basic dropdown position
103
+ // When Popper is enabled, reset the basic dropdown position
104
104
  // stylelint-disable-next-line no-duplicate-selectors
105
105
  .dropdown-menu {
106
106
  &[x-placement^="top"],
@@ -114,7 +114,7 @@
114
114
 
115
115
  // Dividers (basically an `<hr>`) within the dropdown
116
116
  .dropdown-divider {
117
- @include nav-divider($dropdown-divider-bg, $dropdown-divider-margin-y);
117
+ @include nav-divider($dropdown-divider-bg, $dropdown-divider-margin-y, true);
118
118
  }
119
119
 
120
120
  // Links, buttons, and more within the dropdown menu
@@ -128,6 +128,7 @@
128
128
  font-weight: $font-weight-normal;
129
129
  color: $dropdown-link-color;
130
130
  text-align: inherit; // For `<button>`s
131
+ text-decoration: if($link-decoration == none, null, none);
131
132
  white-space: nowrap; // prevent links from randomly breaking onto new lines
132
133
  background-color: transparent; // For `<button>`s
133
134
  border: 0; // For `<button>`s
@@ -144,7 +145,7 @@
144
145
  }
145
146
  }
146
147
 
147
- @include hover-focus {
148
+ @include hover-focus() {
148
149
  color: $dropdown-link-hover-color;
149
150
  text-decoration: none;
150
151
  @include gradient-bg($dropdown-link-hover-bg);
@@ -176,7 +177,7 @@
176
177
  // Dropdown section headers
177
178
  .dropdown-header {
178
179
  display: block;
179
- padding: $dropdown-padding-y $dropdown-item-padding-x;
180
+ padding: $dropdown-header-padding;
180
181
  margin-bottom: 0; // for use with heading elements
181
182
  @include font-size($font-size-sm);
182
183
  color: $dropdown-header-color;
@@ -30,8 +30,14 @@
30
30
  border: 0;
31
31
  }
32
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
+
33
39
  // Customize the `:focus` state to imitate native WebKit styles.
34
- @include form-control-focus();
40
+ @include form-control-focus($ignore-warning: true);
35
41
 
36
42
  // Placeholder
37
43
  &::placeholder {
@@ -53,6 +59,15 @@
53
59
  }
54
60
  }
55
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
+
56
71
  select.form-control {
57
72
  &:focus::-ms-value {
58
73
  // Suppress the nested default white text on blue background highlight given to
@@ -80,23 +95,23 @@ select.form-control {
80
95
  // For use with horizontal and inline forms, when you need the label (or legend)
81
96
  // text to align with the form controls.
82
97
  .col-form-label {
83
- padding-top: calc(#{$input-padding-y} + #{$input-border-width});
84
- padding-bottom: calc(#{$input-padding-y} + #{$input-border-width});
98
+ padding-top: add($input-padding-y, $input-border-width);
99
+ padding-bottom: add($input-padding-y, $input-border-width);
85
100
  margin-bottom: 0; // Override the `<label>/<legend>` default
86
101
  @include font-size(inherit); // Override the `<legend>` default
87
102
  line-height: $input-line-height;
88
103
  }
89
104
 
90
105
  .col-form-label-lg {
91
- padding-top: calc(#{$input-padding-y-lg} + #{$input-border-width});
92
- padding-bottom: calc(#{$input-padding-y-lg} + #{$input-border-width});
106
+ padding-top: add($input-padding-y-lg, $input-border-width);
107
+ padding-bottom: add($input-padding-y-lg, $input-border-width);
93
108
  @include font-size($input-font-size-lg);
94
109
  line-height: $input-line-height-lg;
95
110
  }
96
111
 
97
112
  .col-form-label-sm {
98
- padding-top: calc(#{$input-padding-y-sm} + #{$input-border-width});
99
- padding-bottom: calc(#{$input-padding-y-sm} + #{$input-border-width});
113
+ padding-top: add($input-padding-y-sm, $input-border-width);
114
+ padding-bottom: add($input-padding-y-sm, $input-border-width);
100
115
  @include font-size($input-font-size-sm);
101
116
  line-height: $input-line-height-sm;
102
117
  }
@@ -110,9 +125,9 @@ select.form-control {
110
125
  .form-control-plaintext {
111
126
  display: block;
112
127
  width: 100%;
113
- padding-top: $input-padding-y;
114
- padding-bottom: $input-padding-y;
128
+ padding: $input-padding-y 0;
115
129
  margin-bottom: 0; // match inputs if this class comes on inputs with default margins
130
+ @include font-size($input-font-size);
116
131
  line-height: $input-line-height;
117
132
  color: $input-plaintext-color;
118
133
  background-color: transparent;
@@ -210,6 +225,8 @@ textarea.form-control {
210
225
  margin-top: $form-check-input-margin-y;
211
226
  margin-left: -$form-check-input-gutter;
212
227
 
228
+ // Use [disabled] and :disabled for workaround https://github.com/twbs/bootstrap/issues/28247
229
+ &[disabled] ~ .form-check-label,
213
230
  &:disabled ~ .form-check-label {
214
231
  color: $text-muted;
215
232
  }
@@ -8,7 +8,7 @@
8
8
  $prev-key: null;
9
9
  $prev-num: null;
10
10
  @each $key, $num in $map {
11
- @if $prev-num == null or unit($num) == "%" {
11
+ @if $prev-num == null or unit($num) == "%" or unit($prev-num) == "%" {
12
12
  // Do nothing
13
13
  } @else if not comparable($prev-num, $num) {
14
14
  @warn "Potentially invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} whose unit makes it incomparable to #{$prev-num}, the value of the previous key '#{$prev-key}' !";
@@ -23,10 +23,12 @@
23
23
  // Starts at zero
24
24
  // Used to ensure the min-width of the lowest breakpoint starts at 0.
25
25
  @mixin _assert-starts-at-zero($map, $map-name: "$grid-breakpoints") {
26
- $values: map-values($map);
27
- $first-value: nth($values, 1);
28
- @if $first-value != 0 {
29
- @warn "First breakpoint in #{$map-name} must start at 0, but starts at #{$first-value}.";
26
+ @if length($map) > 0 {
27
+ $values: map-values($map);
28
+ $first-value: nth($values, 1);
29
+ @if $first-value != 0 {
30
+ @warn "First breakpoint in #{$map-name} must start at 0, but starts at #{$first-value}.";
31
+ }
30
32
  }
31
33
  }
32
34
 
@@ -48,6 +50,25 @@
48
50
  @return $string;
49
51
  }
50
52
 
53
+ // See https://codepen.io/kevinweber/pen/dXWoRw
54
+ //
55
+ // Requires the use of quotes around data URIs.
56
+
57
+ @function escape-svg($string) {
58
+ @if str-index($string, "data:image/svg+xml") {
59
+ @each $char, $encoded in $escaped-characters {
60
+ // Do not escape the url brackets
61
+ @if str-index($string, "url(") == 1 {
62
+ $string: url("#{str-replace(str-slice($string, 6, -3), $char, $encoded)}");
63
+ } @else {
64
+ $string: str-replace($string, $char, $encoded);
65
+ }
66
+ }
67
+ }
68
+
69
+ @return $string;
70
+ }
71
+
51
72
  // Color contrast
52
73
  @function color-yiq($color, $dark: $yiq-text-dark, $light: $yiq-text-light) {
53
74
  $r: red($color);
@@ -84,3 +105,40 @@
84
105
 
85
106
  @return mix($color-base, $color, $level * $theme-color-interval);
86
107
  }
108
+
109
+ // Return valid calc
110
+ @function add($value1, $value2, $return-calc: true) {
111
+ @if $value1 == null {
112
+ @return $value2;
113
+ }
114
+
115
+ @if $value2 == null {
116
+ @return $value1;
117
+ }
118
+
119
+ @if type-of($value1) == number and type-of($value2) == number and comparable($value1, $value2) {
120
+ @return $value1 + $value2;
121
+ }
122
+
123
+ @return if($return-calc == true, calc(#{$value1} + #{$value2}), $value1 + unquote(" + ") + $value2);
124
+ }
125
+
126
+ @function subtract($value1, $value2, $return-calc: true) {
127
+ @if $value1 == null and $value2 == null {
128
+ @return null;
129
+ }
130
+
131
+ @if $value1 == null {
132
+ @return -$value2;
133
+ }
134
+
135
+ @if $value2 == null {
136
+ @return $value1;
137
+ }
138
+
139
+ @if type-of($value1) == number and type-of($value2) == number and comparable($value1, $value2) {
140
+ @return $value1 - $value2;
141
+ }
142
+
143
+ @return if($return-calc == true, calc(#{$value1} - #{$value2}), $value1 + unquote(" - ") + $value2);
144
+ }