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