bootstrap 4.1.3 → 5.0.0

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