bootstrap 4.5.3 → 5.2.3

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