bootstrap 4.5.0 → 5.0.0.alpha3

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 (135) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -1
  3. data/README.md +5 -2
  4. data/assets/javascripts/bootstrap-sprockets.js +12 -9
  5. data/assets/javascripts/bootstrap.js +1852 -1266
  6. data/assets/javascripts/bootstrap.min.js +3 -3
  7. data/assets/javascripts/bootstrap/alert.js +149 -69
  8. data/assets/javascripts/bootstrap/button.js +71 -141
  9. data/assets/javascripts/bootstrap/carousel.js +291 -192
  10. data/assets/javascripts/bootstrap/collapse.js +285 -161
  11. data/assets/javascripts/bootstrap/dom/data.js +81 -0
  12. data/assets/javascripts/bootstrap/dom/event-handler.js +307 -0
  13. data/assets/javascripts/bootstrap/dom/manipulator.js +85 -0
  14. data/assets/javascripts/bootstrap/dom/selector-engine.js +98 -0
  15. data/assets/javascripts/bootstrap/dropdown.js +240 -218
  16. data/assets/javascripts/bootstrap/modal.js +342 -234
  17. data/assets/javascripts/bootstrap/popover.js +82 -106
  18. data/assets/javascripts/bootstrap/scrollspy.js +154 -114
  19. data/assets/javascripts/bootstrap/tab.js +166 -80
  20. data/assets/javascripts/bootstrap/toast.js +171 -113
  21. data/assets/javascripts/bootstrap/tooltip.js +351 -219
  22. data/assets/stylesheets/_bootstrap-grid.scss +52 -16
  23. data/assets/stylesheets/_bootstrap-reboot.scss +5 -2
  24. data/assets/stylesheets/_bootstrap.scss +16 -9
  25. data/assets/stylesheets/bootstrap/_accordion.scss +125 -0
  26. data/assets/stylesheets/bootstrap/_alert.scss +15 -9
  27. data/assets/stylesheets/bootstrap/_badge.scss +2 -27
  28. data/assets/stylesheets/bootstrap/_breadcrumb.scss +3 -19
  29. data/assets/stylesheets/bootstrap/_button-group.scss +16 -40
  30. data/assets/stylesheets/bootstrap/_buttons.scss +27 -60
  31. data/assets/stylesheets/bootstrap/_card.scss +30 -97
  32. data/assets/stylesheets/bootstrap/_carousel.scss +30 -15
  33. data/assets/stylesheets/bootstrap/_close.scss +30 -30
  34. data/assets/stylesheets/bootstrap/_containers.scss +41 -0
  35. data/assets/stylesheets/bootstrap/_dropdown.scss +52 -8
  36. data/assets/stylesheets/bootstrap/_forms.scss +9 -347
  37. data/assets/stylesheets/bootstrap/_functions.scss +88 -23
  38. data/assets/stylesheets/bootstrap/_grid.scss +3 -58
  39. data/assets/stylesheets/bootstrap/_helpers.scss +7 -0
  40. data/assets/stylesheets/bootstrap/_list-group.scss +14 -5
  41. data/assets/stylesheets/bootstrap/_mixins.scss +7 -13
  42. data/assets/stylesheets/bootstrap/_modal.scss +41 -47
  43. data/assets/stylesheets/bootstrap/_nav.scss +14 -8
  44. data/assets/stylesheets/bootstrap/_navbar.scss +43 -74
  45. data/assets/stylesheets/bootstrap/_pagination.scss +10 -20
  46. data/assets/stylesheets/bootstrap/_popover.scss +6 -6
  47. data/assets/stylesheets/bootstrap/_progress.scss +3 -5
  48. data/assets/stylesheets/bootstrap/_reboot.scss +310 -171
  49. data/assets/stylesheets/bootstrap/_root.scss +5 -9
  50. data/assets/stylesheets/bootstrap/_spinners.scss +13 -4
  51. data/assets/stylesheets/bootstrap/_tables.scss +80 -114
  52. data/assets/stylesheets/bootstrap/_toasts.scss +6 -2
  53. data/assets/stylesheets/bootstrap/_tooltip.scss +5 -5
  54. data/assets/stylesheets/bootstrap/_transitions.scss +0 -1
  55. data/assets/stylesheets/bootstrap/_type.scss +38 -59
  56. data/assets/stylesheets/bootstrap/_utilities.scss +545 -18
  57. data/assets/stylesheets/bootstrap/_variables.scss +653 -469
  58. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +18 -0
  59. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +61 -0
  60. data/assets/stylesheets/bootstrap/forms/_form-check.scss +151 -0
  61. data/assets/stylesheets/bootstrap/forms/_form-control.scss +223 -0
  62. data/assets/stylesheets/bootstrap/forms/_form-range.scss +91 -0
  63. data/assets/stylesheets/bootstrap/forms/_form-select.scss +68 -0
  64. data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
  65. data/assets/stylesheets/bootstrap/forms/_input-group.scss +121 -0
  66. data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
  67. data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
  68. data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
  69. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +12 -0
  70. data/assets/stylesheets/bootstrap/helpers/_position.scss +30 -0
  71. data/assets/stylesheets/bootstrap/helpers/_ratio.scss +26 -0
  72. data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
  73. data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
  74. data/assets/stylesheets/bootstrap/helpers/_visually-hidden.scss +8 -0
  75. data/assets/stylesheets/bootstrap/mixins/_alert.scss +1 -5
  76. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +9 -9
  77. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +7 -9
  78. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +14 -10
  79. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +65 -47
  80. data/assets/stylesheets/bootstrap/mixins/_caret.scss +4 -4
  81. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
  82. data/assets/stylesheets/bootstrap/mixins/_container.scss +11 -0
  83. data/assets/stylesheets/bootstrap/mixins/_forms.scss +17 -77
  84. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +9 -11
  85. data/assets/stylesheets/bootstrap/mixins/_grid.scss +84 -33
  86. data/assets/stylesheets/bootstrap/mixins/_image.scss +1 -21
  87. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +3 -2
  88. data/assets/stylesheets/bootstrap/mixins/_lists.scss +1 -1
  89. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +15 -8
  90. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +2 -2
  91. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +21 -0
  92. data/assets/stylesheets/bootstrap/mixins/_transition.scss +2 -2
  93. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +49 -0
  94. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +28 -0
  95. data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
  96. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +234 -126
  97. data/lib/bootstrap/version.rb +2 -2
  98. data/tasks/updater/js.rb +3 -3
  99. metadata +33 -41
  100. data/assets/javascripts/bootstrap/util.js +0 -192
  101. data/assets/stylesheets/bootstrap/_code.scss +0 -48
  102. data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -522
  103. data/assets/stylesheets/bootstrap/_input-group.scss +0 -192
  104. data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
  105. data/assets/stylesheets/bootstrap/_media.scss +0 -8
  106. data/assets/stylesheets/bootstrap/_print.scss +0 -141
  107. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -23
  108. data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
  109. data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
  110. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -81
  111. data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
  112. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -11
  113. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +0 -34
  114. data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
  115. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
  116. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -17
  117. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
  118. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
  119. data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
  120. data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
  121. data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
  122. data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
  123. data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
  124. data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
  125. data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
  126. data/assets/stylesheets/bootstrap/utilities/_interactions.scss +0 -5
  127. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
  128. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
  129. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
  130. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
  131. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
  132. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
  133. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
  134. data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -71
  135. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
@@ -1,8 +1,7 @@
1
1
  // Disable animation if transitions are disabled
2
2
  @if $enable-transitions {
3
3
  @keyframes progress-bar-stripes {
4
- from { background-position: $progress-height 0; }
5
- to { background-position: 0 0; }
4
+ 0% { background-position-x: $progress-height; }
6
5
  }
7
6
  }
8
7
 
@@ -10,7 +9,6 @@
10
9
  display: flex;
11
10
  height: $progress-height;
12
11
  overflow: hidden; // force rounded corners by cropping it
13
- line-height: 0;
14
12
  @include font-size($progress-font-size);
15
13
  background-color: $progress-bg;
16
14
  @include border-radius($progress-border-radius);
@@ -36,9 +34,9 @@
36
34
 
37
35
  @if $enable-transitions {
38
36
  .progress-bar-animated {
39
- animation: progress-bar-stripes $progress-bar-animation-timing;
37
+ animation: $progress-bar-animation-timing progress-bar-stripes;
40
38
 
41
- @if $enable-prefers-reduced-motion-media-query {
39
+ @if $enable-reduced-motion {
42
40
  @media (prefers-reduced-motion: reduce) {
43
41
  animation: none;
44
42
  }
@@ -1,5 +1,6 @@
1
1
  // stylelint-disable at-rule-no-vendor-prefix, declaration-no-important, selector-no-qualifying-type, property-no-vendor-prefix
2
2
 
3
+
3
4
  // Reboot
4
5
  //
5
6
  // Normalization of HTML elements, manually forked from Normalize.css to remove
@@ -10,38 +11,37 @@
10
11
 
11
12
  // Document
12
13
  //
13
- // 1. Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`.
14
- // 2. Change the default font family in all browsers.
15
- // 3. Correct the line height in all browsers.
16
- // 4. Prevent adjustments of font size after orientation changes in IE on Windows Phone and in iOS.
17
- // 5. Change the default tap highlight to be completely transparent in iOS.
14
+ // Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`.
18
15
 
19
16
  *,
20
17
  *::before,
21
18
  *::after {
22
- box-sizing: border-box; // 1
19
+ box-sizing: border-box;
23
20
  }
24
21
 
25
- html {
26
- font-family: sans-serif; // 2
27
- line-height: 1.15; // 3
28
- -webkit-text-size-adjust: 100%; // 4
29
- -webkit-tap-highlight-color: rgba($black, 0); // 5
30
- }
31
22
 
32
- // Shim for "new" HTML5 structural elements to display correctly (IE10, older browsers)
33
- // TODO: remove in v5
34
- // stylelint-disable-next-line selector-list-comma-newline-after
35
- article, aside, figcaption, figure, footer, header, hgroup, main, nav, section {
36
- display: block;
23
+ // Root
24
+ //
25
+ // Ability to the value of the root font sizes, affecting the value of `rem`.
26
+ // null by default, thus nothing is generated.
27
+
28
+ :root {
29
+ font-size: $font-size-root;
30
+
31
+ @if $enable-smooth-scroll {
32
+ @media (prefers-reduced-motion: no-preference) {
33
+ scroll-behavior: smooth;
34
+ }
35
+ }
37
36
  }
38
37
 
38
+
39
39
  // Body
40
40
  //
41
41
  // 1. Remove the margin in all browsers.
42
42
  // 2. As a best practice, apply a default `background-color`.
43
- // 3. Set an explicit initial text-align value so that we can later use
44
- // the `inherit` value on things like `<th>` elements.
43
+ // 3. Prevent adjustments of font size after orientation changes in iOS.
44
+ // 4. Change the default tap highlight to be completely transparent in iOS.
45
45
 
46
46
  body {
47
47
  margin: 0; // 1
@@ -50,19 +50,22 @@ body {
50
50
  font-weight: $font-weight-base;
51
51
  line-height: $line-height-base;
52
52
  color: $body-color;
53
- text-align: left; // 3
53
+ text-align: $body-text-align;
54
54
  background-color: $body-bg; // 2
55
+ -webkit-text-size-adjust: 100%; // 3
56
+ -webkit-tap-highlight-color: rgba($black, 0); // 4
55
57
  }
56
58
 
59
+
57
60
  // Future-proof rule: in browsers that support :focus-visible, suppress the focus outline
58
61
  // on elements that programmatically receive focus but wouldn't normally show a visible
59
62
  // focus outline. In general, this would mean that the outline is only applied if the
60
63
  // interaction that led to the element receiving programmatic focus was a keyboard interaction,
61
64
  // or the browser has somehow determined that the user is primarily a keyboard user and/or
62
65
  // wants focus outlines to always be presented.
63
- //
64
66
  // See https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible
65
67
  // and https://developer.paciellogroup.com/blog/2018/03/focus-visible-and-backwards-compatibility/
68
+
66
69
  [tabindex="-1"]:focus:not(:focus-visible) {
67
70
  outline: 0 !important;
68
71
  }
@@ -70,62 +73,112 @@ body {
70
73
 
71
74
  // Content grouping
72
75
  //
73
- // 1. Add the correct box sizing in Firefox.
74
- // 2. Show the overflow in Edge and IE.
76
+ // 1. Reset Firefox's gray color
77
+ // 2. Set correct height and prevent the `size` attribute to make the `hr` look like an input field
75
78
 
76
79
  hr {
77
- box-sizing: content-box; // 1
78
- height: 0; // 1
79
- overflow: visible; // 2
80
+ margin: $hr-margin-y 0;
81
+ color: $hr-color; // 1
82
+ background-color: currentColor;
83
+ border: 0;
84
+ opacity: $hr-opacity;
85
+ }
86
+
87
+ hr:not([size]) {
88
+ height: $hr-height; // 2
80
89
  }
81
90
 
82
91
 
83
- //
84
92
  // Typography
85
93
  //
94
+ // 1. Remove top margins from headings
95
+ // By default, `<h1>`-`<h6>` all receive top and bottom margins. We nuke the top
96
+ // margin for easier control within type scales as it avoids margin collapsing.
86
97
 
87
- // Remove top margins from headings
88
- //
89
- // By default, `<h1>`-`<h6>` all receive top and bottom margins. We nuke the top
90
- // margin for easier control within type scales as it avoids margin collapsing.
91
- // stylelint-disable-next-line selector-list-comma-newline-after
92
- h1, h2, h3, h4, h5, h6 {
93
- margin-top: 0;
98
+ %heading {
99
+ margin-top: 0; // 1
94
100
  margin-bottom: $headings-margin-bottom;
101
+ font-family: $headings-font-family;
102
+ font-style: $headings-font-style;
103
+ font-weight: $headings-font-weight;
104
+ line-height: $headings-line-height;
105
+ color: $headings-color;
106
+ }
107
+
108
+ h1 {
109
+ @extend %heading;
110
+ @include font-size($h1-font-size);
111
+ }
112
+
113
+ h2 {
114
+ @extend %heading;
115
+ @include font-size($h2-font-size);
116
+ }
117
+
118
+ h3 {
119
+ @extend %heading;
120
+ @include font-size($h3-font-size);
95
121
  }
96
122
 
123
+ h4 {
124
+ @extend %heading;
125
+ @include font-size($h4-font-size);
126
+ }
127
+
128
+ h5 {
129
+ @extend %heading;
130
+ @include font-size($h5-font-size);
131
+ }
132
+
133
+ h6 {
134
+ @extend %heading;
135
+ @include font-size($h6-font-size);
136
+ }
137
+
138
+
97
139
  // Reset margins on paragraphs
98
140
  //
99
141
  // Similarly, the top margin on `<p>`s get reset. However, we also reset the
100
142
  // bottom margin to use `rem` units instead of `em`.
143
+
101
144
  p {
102
145
  margin-top: 0;
103
146
  margin-bottom: $paragraph-margin-bottom;
104
147
  }
105
148
 
149
+
106
150
  // Abbreviations
107
151
  //
108
152
  // 1. Duplicate behavior to the data-* attribute for our tooltip plugin
109
- // 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
153
+ // 2. Add the correct text decoration in Chrome, Edge, Opera, and Safari.
110
154
  // 3. Add explicit cursor to indicate changed behavior.
111
- // 4. Remove the bottom border in Firefox 39-.
112
- // 5. Prevent the text-decoration to be skipped.
155
+ // 4. Prevent the text-decoration to be skipped.
113
156
 
114
157
  abbr[title],
115
158
  abbr[data-original-title] { // 1
116
159
  text-decoration: underline; // 2
117
160
  text-decoration: underline dotted; // 2
118
161
  cursor: help; // 3
119
- border-bottom: 0; // 4
120
- text-decoration-skip-ink: none; // 5
162
+ text-decoration-skip-ink: none; // 4
121
163
  }
122
164
 
165
+
166
+ // Address
167
+
123
168
  address {
124
169
  margin-bottom: 1rem;
125
170
  font-style: normal;
126
171
  line-height: inherit;
127
172
  }
128
173
 
174
+
175
+ // Lists
176
+
177
+ ol,
178
+ ul {
179
+ padding-left: 2rem;
180
+ }
181
+
129
182
  ol,
130
183
  ul,
131
184
  dl {
@@ -144,33 +197,57 @@ dt {
144
197
  font-weight: $dt-font-weight;
145
198
  }
146
199
 
200
+ // 1. Undo browser default
201
+
147
202
  dd {
148
203
  margin-bottom: .5rem;
149
- margin-left: 0; // Undo browser default
204
+ margin-left: 0; // 1
150
205
  }
151
206
 
207
+
208
+ // Blockquote
209
+
152
210
  blockquote {
153
211
  margin: 0 0 1rem;
154
212
  }
155
213
 
214
+
215
+ // Strong
216
+ //
217
+ // Add the correct font weight in Chrome, Edge, and Safari
218
+
156
219
  b,
157
220
  strong {
158
- font-weight: $font-weight-bolder; // Add the correct font weight in Chrome, Edge, and Safari
221
+ font-weight: $font-weight-bolder;
159
222
  }
160
223
 
224
+
225
+ // Small
226
+ //
227
+ // Add the correct font size in all browsers
228
+
161
229
  small {
162
- @include font-size(80%); // Add the correct font size in all browsers
230
+ @include font-size($small-font-size);
231
+ }
232
+
233
+
234
+ // Mark
235
+
236
+ mark {
237
+ padding: $mark-padding;
238
+ background-color: $mark-bg;
163
239
  }
164
240
 
241
+
242
+ // Sub and Sup
165
243
  //
166
244
  // Prevent `sub` and `sup` elements from affecting the line height in
167
245
  // all browsers.
168
- //
169
246
 
170
247
  sub,
171
248
  sup {
172
249
  position: relative;
173
- @include font-size(75%);
250
+ @include font-size($sub-sup-font-size);
174
251
  line-height: 0;
175
252
  vertical-align: baseline;
176
253
  }
@@ -179,16 +256,13 @@ sub { bottom: -.25em; }
179
256
  sup { top: -.5em; }
180
257
 
181
258
 
182
- //
183
259
  // Links
184
- //
185
260
 
186
261
  a {
187
262
  color: $link-color;
188
263
  text-decoration: $link-decoration;
189
- background-color: transparent; // Remove the gray background on active links in IE 10.
190
264
 
191
- @include hover() {
265
+ &:hover {
192
266
  color: $link-hover-color;
193
267
  text-decoration: $link-hover-decoration;
194
268
  }
@@ -199,138 +273,169 @@ a {
199
273
  // causes specificity issues in many other styles that are too complex to fix.
200
274
  // See https://github.com/twbs/bootstrap/issues/19402
201
275
 
202
- a:not([href]) {
203
- color: inherit;
204
- text-decoration: none;
205
-
206
- @include hover() {
276
+ a:not([href]):not([class]) {
277
+ &,
278
+ &:hover {
207
279
  color: inherit;
208
280
  text-decoration: none;
209
281
  }
210
282
  }
211
283
 
212
284
 
213
- //
214
285
  // Code
215
- //
216
286
 
217
287
  pre,
218
288
  code,
219
289
  kbd,
220
290
  samp {
221
- font-family: $font-family-monospace;
291
+ font-family: $font-family-code;
222
292
  @include font-size(1em); // Correct the odd `em` font sizing in all browsers.
223
293
  }
224
294
 
295
+ // 1. Remove browser default top margin
296
+ // 2. Reset browser default of `1em` to use `rem`s
297
+ // 3. Don't allow content to break outside
298
+
225
299
  pre {
226
- // Remove browser default top margin
227
- margin-top: 0;
228
- // Reset browser default of `1em` to use `rem`s
229
- margin-bottom: 1rem;
230
- // Don't allow content to break outside
231
- overflow: auto;
232
- // Disable auto-hiding scrollbar in IE & legacy Edge to avoid overlap,
233
- // making it impossible to interact with the content
234
- -ms-overflow-style: scrollbar;
300
+ display: block;
301
+ margin-top: 0; // 1
302
+ margin-bottom: 1rem; // 2
303
+ overflow: auto; // 3
304
+ @include font-size($code-font-size);
305
+ color: $pre-color;
306
+
307
+ // Account for some code outputs that place code tags in pre tags
308
+ code {
309
+ @include font-size(inherit);
310
+ color: inherit;
311
+ word-break: normal;
312
+ }
313
+ }
314
+
315
+ code {
316
+ @include font-size($code-font-size);
317
+ color: $code-color;
318
+ word-wrap: break-word;
319
+
320
+ // Streamline the style when inside anchors to avoid broken underline and more
321
+ a > & {
322
+ color: inherit;
323
+ }
324
+ }
325
+
326
+ kbd {
327
+ padding: $kbd-padding-y $kbd-padding-x;
328
+ @include font-size($kbd-font-size);
329
+ color: $kbd-color;
330
+ background-color: $kbd-bg;
331
+ @include border-radius($border-radius-sm);
332
+
333
+ kbd {
334
+ padding: 0;
335
+ @include font-size(1em);
336
+ font-weight: $nested-kbd-font-weight;
337
+ }
235
338
  }
236
339
 
237
340
 
238
- //
239
341
  // Figures
240
342
  //
343
+ // Apply a consistent margin strategy (matches our type styles).
241
344
 
242
345
  figure {
243
- // Apply a consistent margin strategy (matches our type styles).
244
346
  margin: 0 0 1rem;
245
347
  }
246
348
 
247
349
 
248
- //
249
350
  // Images and content
250
- //
251
-
252
- img {
253
- vertical-align: middle;
254
- border-style: none; // Remove the border on images inside links in IE 10-.
255
- }
256
351
 
352
+ img,
257
353
  svg {
258
- // Workaround for the SVG overflow bug in IE10/11 is still required.
259
- // See https://github.com/twbs/bootstrap/issues/26878
260
- overflow: hidden;
261
354
  vertical-align: middle;
262
355
  }
263
356
 
264
357
 
265
- //
266
358
  // Tables
267
359
  //
360
+ // Prevent double borders
268
361
 
269
362
  table {
270
- border-collapse: collapse; // Prevent double borders
363
+ caption-side: bottom;
364
+ border-collapse: collapse;
271
365
  }
272
366
 
273
367
  caption {
274
- padding-top: $table-cell-padding;
275
- padding-bottom: $table-cell-padding;
368
+ padding-top: $table-cell-padding-y;
369
+ padding-bottom: $table-cell-padding-y;
276
370
  color: $table-caption-color;
277
371
  text-align: left;
278
- caption-side: bottom;
279
372
  }
280
373
 
374
+ // 1. Removes font-weight bold by inheriting
375
+ // 2. Matches default `<td>` alignment by inheriting `text-align`.
376
+ // 3. Fix alignment for Safari
377
+
281
378
  th {
282
- // Matches default `<td>` alignment by inheriting from the `<body>`, or the
283
- // closest parent with a set `text-align`.
284
- text-align: inherit;
379
+ font-weight: $table-th-font-weight; // 1
380
+ text-align: inherit; // 2
381
+ text-align: -webkit-match-parent; // 3
382
+ }
383
+
384
+ thead,
385
+ tbody,
386
+ tfoot,
387
+ tr,
388
+ td,
389
+ th {
390
+ border-color: inherit;
391
+ border-style: solid;
392
+ border-width: 0;
285
393
  }
286
394
 
287
395
 
288
- //
289
396
  // Forms
290
397
  //
398
+ // 1. Allow labels to use `margin` for spacing.
291
399
 
292
400
  label {
293
- // Allow labels to use `margin` for spacing.
294
- display: inline-block;
295
- margin-bottom: $label-margin-bottom;
401
+ display: inline-block; // 1
296
402
  }
297
403
 
298
404
  // Remove the default `border-radius` that macOS Chrome adds.
299
- //
300
- // Details at https://github.com/twbs/bootstrap/issues/24093
405
+ // See https://github.com/twbs/bootstrap/issues/24093
406
+
301
407
  button {
302
- // stylelint-disable-next-line property-blacklist
408
+ // stylelint-disable-next-line property-disallowed-list
303
409
  border-radius: 0;
304
410
  }
305
411
 
306
- // Work around a Firefox/IE bug where the transparent `button` background
412
+ // Work around a Firefox bug where the transparent `button` background
307
413
  // results in a loss of the default `button` focus styles.
308
- //
309
- // Credit: https://github.com/suitcss/base/
414
+ // Credit https://github.com/suitcss/base/
415
+
310
416
  button:focus {
311
- outline: 1px dotted;
312
- outline: 5px auto -webkit-focus-ring-color;
417
+ outline: dotted 1px;
418
+ outline: -webkit-focus-ring-color auto 5px;
313
419
  }
314
420
 
421
+ // 1. Remove the margin in Firefox and Safari
422
+
315
423
  input,
316
424
  button,
317
425
  select,
318
426
  optgroup,
319
427
  textarea {
320
- margin: 0; // Remove the margin in Firefox and Safari
428
+ margin: 0; // 1
321
429
  font-family: inherit;
322
430
  @include font-size(inherit);
323
431
  line-height: inherit;
324
432
  }
325
433
 
326
- button,
327
- input {
328
- overflow: visible; // Show the overflow in Edge
329
- }
434
+ // Remove the inheritance of text transform in Firefox
330
435
 
331
436
  button,
332
437
  select {
333
- text-transform: none; // Remove the inheritance of text transform in Firefox
438
+ text-transform: none;
334
439
  }
335
440
 
336
441
  // Set the cursor for non-`<button>` buttons
@@ -341,140 +446,174 @@ select {
341
446
  }
342
447
 
343
448
  // Remove the inheritance of word-wrap in Safari.
344
- //
345
- // Details at https://github.com/twbs/bootstrap/issues/24990
449
+ // See https://github.com/twbs/bootstrap/issues/24990
450
+
346
451
  select {
347
452
  word-wrap: normal;
348
453
  }
349
454
 
455
+ // Remove the dropdown arrow in Chrome from inputs built with datalists.
456
+ // See https://stackoverflow.com/a/54997118
457
+
458
+ [list]::-webkit-calendar-picker-indicator {
459
+ display: none;
460
+ }
350
461
 
351
462
  // 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
352
463
  // controls in Android 4.
353
464
  // 2. Correct the inability to style clickable types in iOS and Safari.
465
+ // 3. Opinionated: add "hand" cursor to non-disabled button elements.
466
+
354
467
  button,
355
468
  [type="button"], // 1
356
469
  [type="reset"],
357
470
  [type="submit"] {
358
471
  -webkit-appearance: button; // 2
359
- }
360
472
 
361
- // Opinionated: add "hand" cursor to non-disabled button elements.
362
- @if $enable-pointer-cursor-for-buttons {
363
- button,
364
- [type="button"],
365
- [type="reset"],
366
- [type="submit"] {
473
+ @if $enable-button-pointers {
367
474
  &:not(:disabled) {
368
- cursor: pointer;
475
+ cursor: pointer; // 3
369
476
  }
370
477
  }
371
478
  }
372
479
 
373
480
  // Remove inner border and padding from Firefox, but don't restore the outline like Normalize.
374
- button::-moz-focus-inner,
375
- [type="button"]::-moz-focus-inner,
376
- [type="reset"]::-moz-focus-inner,
377
- [type="submit"]::-moz-focus-inner {
481
+
482
+ ::-moz-focus-inner {
378
483
  padding: 0;
379
484
  border-style: none;
380
485
  }
381
486
 
382
- input[type="radio"],
383
- input[type="checkbox"] {
384
- box-sizing: border-box; // 1. Add the correct box sizing in IE 10-
385
- padding: 0; // 2. Remove the padding in IE 10-
386
- }
387
-
487
+ // 1. Textareas should really only resize vertically so they don't break their (horizontal) containers.
388
488
 
389
489
  textarea {
390
- overflow: auto; // Remove the default vertical scrollbar in IE.
391
- // Textareas should really only resize vertically so they don't break their (horizontal) containers.
392
- resize: vertical;
490
+ resize: vertical; // 1
393
491
  }
394
492
 
493
+ // 1. Browsers set a default `min-width: min-content;` on fieldsets,
494
+ // unlike e.g. `<div>`s, which have `min-width: 0;` by default.
495
+ // So we reset that to ensure fieldsets behave more like a standard block element.
496
+ // See https://github.com/twbs/bootstrap/issues/12359
497
+ // and https://html.spec.whatwg.org/multipage/#the-fieldset-and-legend-elements
498
+ // 2. Reset the default outline behavior of fieldsets so they don't affect page layout.
499
+
395
500
  fieldset {
396
- // Browsers set a default `min-width: min-content;` on fieldsets,
397
- // unlike e.g. `<div>`s, which have `min-width: 0;` by default.
398
- // So we reset that to ensure fieldsets behave more like a standard block element.
399
- // See https://github.com/twbs/bootstrap/issues/12359
400
- // and https://html.spec.whatwg.org/multipage/#the-fieldset-and-legend-elements
401
- min-width: 0;
402
- // Reset the default outline behavior of fieldsets so they don't affect page layout.
403
- padding: 0;
404
- margin: 0;
405
- border: 0;
501
+ min-width: 0; // 1
502
+ padding: 0; // 2
503
+ margin: 0; // 2
504
+ border: 0; // 2
406
505
  }
407
506
 
408
- // 1. Correct the text wrapping in Edge and IE.
409
- // 2. Correct the color inheritance from `fieldset` elements in IE.
507
+ // 1. By using `float: left`, the legend will behave like a block element.
508
+ // This way the border of a fieldset wraps around the legend if present.
509
+ // 2. Fix wrapping bug.
510
+ // See https://github.com/twbs/bootstrap/issues/29712
511
+
410
512
  legend {
411
- display: block;
513
+ float: left; // 1
412
514
  width: 100%;
413
- max-width: 100%; // 1
414
515
  padding: 0;
415
- margin-bottom: .5rem;
416
- @include font-size(1.5rem);
516
+ margin-bottom: $legend-margin-bottom;
517
+ @include font-size($legend-font-size);
518
+ font-weight: $legend-font-weight;
417
519
  line-height: inherit;
418
- color: inherit; // 2
419
- white-space: normal; // 1
520
+
521
+ + * {
522
+ clear: left; // 2
523
+ }
420
524
  }
421
525
 
422
- progress {
423
- vertical-align: baseline; // Add the correct vertical alignment in Chrome, Firefox, and Opera.
526
+ // Fix height of inputs with a type of datetime-local, date, month, week, or time
527
+ // See https://github.com/twbs/bootstrap/issues/18842
528
+
529
+ ::-webkit-datetime-edit-fields-wrapper,
530
+ ::-webkit-datetime-edit-text,
531
+ ::-webkit-datetime-edit-minute,
532
+ ::-webkit-datetime-edit-hour-field,
533
+ ::-webkit-datetime-edit-day-field,
534
+ ::-webkit-datetime-edit-month-field,
535
+ ::-webkit-datetime-edit-year-field {
536
+ padding: 0;
424
537
  }
425
538
 
426
- // Correct the cursor style of increment and decrement buttons in Chrome.
427
- [type="number"]::-webkit-inner-spin-button,
428
- [type="number"]::-webkit-outer-spin-button {
539
+ ::-webkit-inner-spin-button {
429
540
  height: auto;
430
541
  }
431
542
 
543
+ // 1. Correct the outline style in Safari.
544
+ // 2. This overrides the extra rounded corners on search inputs in iOS so that our
545
+ // `.form-control` class can properly style them. Note that this cannot simply
546
+ // be added to `.form-control` as it's not specific enough. For details, see
547
+ // https://github.com/twbs/bootstrap/issues/11586.
548
+
432
549
  [type="search"] {
433
- // This overrides the extra rounded corners on search inputs in iOS so that our
434
- // `.form-control` class can properly style them. Note that this cannot simply
435
- // be added to `.form-control` as it's not specific enough. For details, see
436
- // https://github.com/twbs/bootstrap/issues/11586.
437
- outline-offset: -2px; // 2. Correct the outline style in Safari.
438
- -webkit-appearance: none;
550
+ outline-offset: -2px; // 1
551
+ -webkit-appearance: textfield; // 2
439
552
  }
440
553
 
441
- //
442
554
  // Remove the inner padding in Chrome and Safari on macOS.
443
- //
444
555
 
445
- [type="search"]::-webkit-search-decoration {
556
+ ::-webkit-search-decoration {
446
557
  -webkit-appearance: none;
447
558
  }
448
559
 
449
- //
450
- // 1. Correct the inability to style clickable types in iOS and Safari.
451
- // 2. Change font properties to `inherit` in Safari.
452
- //
560
+ // Remove padding around color pickers in webkit browsers
561
+
562
+ ::-webkit-color-swatch-wrapper {
563
+ padding: 0;
564
+ }
565
+
566
+
567
+ // Inherit font family and line height for file input buttons
568
+
569
+ // stylelint-disable-next-line selector-pseudo-element-no-unknown
570
+ ::file-selector-button {
571
+ font: inherit;
572
+ }
573
+
574
+ // 1. Change font properties to `inherit`
575
+ // 2. Correct the inability to style clickable types in iOS and Safari.
453
576
 
454
577
  ::-webkit-file-upload-button {
455
- font: inherit; // 2
456
- -webkit-appearance: button; // 1
578
+ font: inherit; // 1
579
+ -webkit-appearance: button; // 2
457
580
  }
458
581
 
459
- //
460
582
  // Correct element displays
461
- //
462
583
 
463
584
  output {
464
585
  display: inline-block;
465
586
  }
466
587
 
588
+ // Remove border from iframe
589
+
590
+ iframe {
591
+ border: 0;
592
+ }
593
+
594
+ // Summary
595
+ //
596
+ // 1. Add the correct display in all browsers
597
+
467
598
  summary {
468
- display: list-item; // Add the correct display in all browsers
599
+ display: list-item; // 1
469
600
  cursor: pointer;
470
601
  }
471
602
 
472
- template {
473
- display: none; // Add the correct display in IE
603
+
604
+ // Progress
605
+ //
606
+ // Add the correct vertical alignment in Chrome, Firefox, and Opera.
607
+
608
+ progress {
609
+ vertical-align: baseline;
474
610
  }
475
611
 
476
- // Always hide an element with the `hidden` HTML attribute (from PureCSS).
477
- // Needed for proper display in IE 10-.
612
+
613
+ // Hidden attribute
614
+ //
615
+ // Always hide an element with the `hidden` HTML attribute.
616
+
478
617
  [hidden] {
479
618
  display: none !important;
480
619
  }