bootstrap 5.0.0.beta1 → 5.0.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -0
  3. data/README.md +3 -3
  4. data/assets/javascripts/bootstrap-global-this-define.js +6 -0
  5. data/assets/javascripts/bootstrap-global-this-undefine.js +2 -0
  6. data/assets/javascripts/bootstrap-sprockets.js +3 -0
  7. data/assets/javascripts/bootstrap.js +429 -486
  8. data/assets/javascripts/bootstrap.min.js +3 -3
  9. data/assets/javascripts/bootstrap/alert.js +81 -80
  10. data/assets/javascripts/bootstrap/base-component.js +75 -0
  11. data/assets/javascripts/bootstrap/button.js +60 -72
  12. data/assets/javascripts/bootstrap/carousel.js +131 -110
  13. data/assets/javascripts/bootstrap/collapse.js +94 -77
  14. data/assets/javascripts/bootstrap/dom/data.js +3 -3
  15. data/assets/javascripts/bootstrap/dom/event-handler.js +6 -5
  16. data/assets/javascripts/bootstrap/dom/manipulator.js +3 -3
  17. data/assets/javascripts/bootstrap/dom/selector-engine.js +6 -11
  18. data/assets/javascripts/bootstrap/dropdown.js +159 -90
  19. data/assets/javascripts/bootstrap/modal.js +132 -125
  20. data/assets/javascripts/bootstrap/popover.js +73 -25
  21. data/assets/javascripts/bootstrap/scrollspy.js +93 -76
  22. data/assets/javascripts/bootstrap/tab.js +78 -82
  23. data/assets/javascripts/bootstrap/toast.js +79 -75
  24. data/assets/javascripts/bootstrap/tooltip.js +207 -185
  25. data/assets/stylesheets/_bootstrap-grid.scss +3 -3
  26. data/assets/stylesheets/_bootstrap-reboot.scss +3 -3
  27. data/assets/stylesheets/_bootstrap.scss +3 -3
  28. data/assets/stylesheets/bootstrap/_accordion.scss +1 -0
  29. data/assets/stylesheets/bootstrap/_alert.scss +6 -6
  30. data/assets/stylesheets/bootstrap/_carousel.scss +12 -6
  31. data/assets/stylesheets/bootstrap/_close.scss +1 -1
  32. data/assets/stylesheets/bootstrap/_dropdown.scss +29 -15
  33. data/assets/stylesheets/bootstrap/_list-group.scss +5 -5
  34. data/assets/stylesheets/bootstrap/_nav.scss +5 -0
  35. data/assets/stylesheets/bootstrap/_navbar.scss +12 -1
  36. data/assets/stylesheets/bootstrap/_pagination.scss +2 -2
  37. data/assets/stylesheets/bootstrap/_popover.scss +0 -15
  38. data/assets/stylesheets/bootstrap/_reboot.scss +6 -6
  39. data/assets/stylesheets/bootstrap/_tables.scss +1 -1
  40. data/assets/stylesheets/bootstrap/_toasts.scss +1 -0
  41. data/assets/stylesheets/bootstrap/_utilities.scss +6 -0
  42. data/assets/stylesheets/bootstrap/_variables.scss +30 -7
  43. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +5 -5
  44. data/assets/stylesheets/bootstrap/forms/_form-check.scss +1 -0
  45. data/assets/stylesheets/bootstrap/forms/_form-range.scss +1 -1
  46. data/assets/stylesheets/bootstrap/forms/_form-select.scss +1 -2
  47. data/assets/stylesheets/bootstrap/forms/_validation.scss +1 -1
  48. data/assets/stylesheets/bootstrap/helpers/_ratio.scss +2 -2
  49. data/assets/stylesheets/bootstrap/helpers/_visually-hidden.scss +1 -1
  50. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +4 -4
  51. data/assets/stylesheets/bootstrap/mixins/_forms.scss +13 -6
  52. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +4 -0
  53. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +3 -2
  54. data/assets/stylesheets/bootstrap/utilities/_api.scss +1 -1
  55. data/bootstrap.gemspec +1 -3
  56. data/lib/bootstrap/version.rb +2 -2
  57. data/tasks/updater/js.rb +15 -2
  58. data/test/dummy_rails/app/assets/javascripts/application.js +4 -3
  59. data/test/dummy_rails/app/views/layouts/application.html.erb +3 -1
  60. data/test/dummy_rails/app/views/pages/root.html +89 -0
  61. data/test/dummy_rails/config/application.rb +0 -3
  62. data/test/gemfiles/rails_6_1.gemfile +7 -0
  63. metadata +13 -36
  64. data/test/dummy_rails/app/views/pages/root.html.slim +0 -58
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * Bootstrap Grid v5.0.0-beta1 (https://getbootstrap.com/)
3
- * Copyright 2011-2020 The Bootstrap Authors
4
- * Copyright 2011-2020 Twitter, Inc.
2
+ * Bootstrap Grid v5.0.0-beta2 (https://getbootstrap.com/)
3
+ * Copyright 2011-2021 The Bootstrap Authors
4
+ * Copyright 2011-2021 Twitter, Inc.
5
5
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * Bootstrap Reboot v5.0.0-beta1 (https://getbootstrap.com/)
3
- * Copyright 2011-2020 The Bootstrap Authors
4
- * Copyright 2011-2020 Twitter, Inc.
2
+ * Bootstrap Reboot v5.0.0-beta2 (https://getbootstrap.com/)
3
+ * Copyright 2011-2021 The Bootstrap Authors
4
+ * Copyright 2011-2021 Twitter, Inc.
5
5
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
6
6
  * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * Bootstrap v5.0.0-beta1 (https://getbootstrap.com/)
3
- * Copyright 2011-2020 The Bootstrap Authors
4
- * Copyright 2011-2020 Twitter, Inc.
2
+ * Bootstrap v5.0.0-beta2 (https://getbootstrap.com/)
3
+ * Copyright 2011-2021 The Bootstrap Authors
4
+ * Copyright 2011-2021 Twitter, Inc.
5
5
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
6
6
  */
7
7
 
@@ -10,6 +10,7 @@
10
10
  padding: $accordion-button-padding-y $accordion-button-padding-x;
11
11
  @include font-size($font-size-base);
12
12
  color: $accordion-button-color;
13
+ text-align: left; // Reset button style
13
14
  background-color: $accordion-button-bg;
14
15
  border: $accordion-border-width solid $accordion-border-color;
15
16
  @include border-radius(0);
@@ -44,14 +44,14 @@
44
44
  // Generate contextual modifier classes for colorizing the alert.
45
45
 
46
46
  @each $state, $value in $theme-colors {
47
- $background: shift-color($value, $alert-bg-scale);
48
- $border: shift-color($value, $alert-border-scale);
49
- $color: shift-color($value, $alert-color-scale);
50
- @if (contrast-ratio($background, $color) < $min-contrast-ratio) {
51
- $color: mix($value, color-contrast($background), abs($alert-color-scale));
47
+ $alert-background: shift-color($value, $alert-bg-scale);
48
+ $alert-border: shift-color($value, $alert-border-scale);
49
+ $alert-color: shift-color($value, $alert-color-scale);
50
+ @if (contrast-ratio($alert-background, $alert-color) < $min-contrast-ratio) {
51
+ $alert-color: mix($value, color-contrast($alert-background), abs($alert-color-scale));
52
52
  }
53
53
  .alert-#{$state} {
54
- @include alert-variant($background, $border, $color);
54
+ @include alert-variant($alert-background, $alert-border, $alert-color);
55
55
  }
56
56
  }
57
57
  // scss-docs-end alert-modifiers
@@ -98,8 +98,11 @@
98
98
  align-items: center; // 2. vertically center contents
99
99
  justify-content: center; // 3. horizontally center contents
100
100
  width: $carousel-control-width;
101
+ padding: 0;
101
102
  color: $carousel-control-color;
102
103
  text-align: center;
104
+ background: none;
105
+ border: 0;
103
106
  opacity: $carousel-control-opacity;
104
107
  @include transition($carousel-control-transition);
105
108
 
@@ -147,10 +150,10 @@
147
150
  background-image: escape-svg($carousel-control-next-icon-bg);
148
151
  }
149
152
 
150
- // Optional indicator pips
153
+ // Optional indicator pips/controls
151
154
  //
152
- // Add an ordered list with the following class and add a list item for each
153
- // slide your carousel holds.
155
+ // Add a container (such as a list) with the following class and add an item (ideally a focusable control,
156
+ // like a button) with data-bs-target for each slide your carousel holds.
154
157
 
155
158
  .carousel-indicators {
156
159
  position: absolute;
@@ -160,23 +163,26 @@
160
163
  z-index: 2;
161
164
  display: flex;
162
165
  justify-content: center;
163
- padding-left: 0; // override <ol> default
166
+ padding: 0;
164
167
  // Use the .carousel-control's width as margin so we don't overlay those
165
168
  margin-right: $carousel-control-width;
169
+ margin-bottom: 1rem;
166
170
  margin-left: $carousel-control-width;
167
171
  list-style: none;
168
172
 
169
- li {
173
+ [data-bs-target] {
170
174
  box-sizing: content-box;
171
175
  flex: 0 1 auto;
172
176
  width: $carousel-indicator-width;
173
177
  height: $carousel-indicator-height;
178
+ padding: 0;
174
179
  margin-right: $carousel-indicator-spacer;
175
180
  margin-left: $carousel-indicator-spacer;
176
181
  text-indent: -999px;
177
182
  cursor: pointer;
178
183
  background-color: $carousel-indicator-active-bg;
179
184
  background-clip: padding-box;
185
+ border: 0;
180
186
  // Use transparent borders to increase the hit area by 10px on top and bottom.
181
187
  border-top: $carousel-indicator-hit-area-height solid transparent;
182
188
  border-bottom: $carousel-indicator-hit-area-height solid transparent;
@@ -213,7 +219,7 @@
213
219
  filter: $carousel-dark-control-icon-filter;
214
220
  }
215
221
 
216
- .carousel-indicators li {
222
+ .carousel-indicators [data-bs-target] {
217
223
  background-color: $carousel-dark-indicator-active-bg;
218
224
  }
219
225
 
@@ -22,7 +22,7 @@
22
22
  }
23
23
 
24
24
  &:focus {
25
- outline: none;
25
+ outline: 0;
26
26
  box-shadow: $btn-close-focus-shadow;
27
27
  opacity: $btn-close-focus-opacity;
28
28
  }
@@ -17,12 +17,11 @@
17
17
  .dropdown-menu {
18
18
  position: absolute;
19
19
  top: 100%;
20
- left: 0;
21
20
  z-index: $zindex-dropdown;
22
21
  display: none; // none by default, but block on "open" of the menu
23
22
  min-width: $dropdown-min-width;
24
23
  padding: $dropdown-padding-y $dropdown-padding-x;
25
- margin: $dropdown-spacer 0 0; // override default ul
24
+ margin: 0; // Override default margin of ul
26
25
  @include font-size($dropdown-font-size);
27
26
  color: $dropdown-color;
28
27
  text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer)
@@ -33,9 +32,9 @@
33
32
  @include border-radius($dropdown-border-radius);
34
33
  @include box-shadow($dropdown-box-shadow);
35
34
 
36
- // Reset positioning when positioned with Popper
37
- &[style] {
38
- right: auto !important; // stylelint-disable-line declaration-no-important
35
+ &[data-bs-popper] {
36
+ left: 0;
37
+ margin-top: $dropdown-spacer;
39
38
  }
40
39
  }
41
40
 
@@ -49,14 +48,20 @@
49
48
 
50
49
  .dropdown-menu#{$infix}-start {
51
50
  --bs-position: start;
52
- right: auto #{"/* rtl:ignore */"};
53
- left: 0 #{"/* rtl:ignore */"};
51
+
52
+ &[data-bs-popper] {
53
+ right: auto #{"/* rtl:ignore */"};
54
+ left: 0 #{"/* rtl:ignore */"};
55
+ }
54
56
  }
55
57
 
56
58
  .dropdown-menu#{$infix}-end {
57
59
  --bs-position: end;
58
- right: 0 #{"/* rtl:ignore */"};
59
- left: auto #{"/* rtl:ignore */"};
60
+
61
+ &[data-bs-popper] {
62
+ right: 0 #{"/* rtl:ignore */"};
63
+ left: auto #{"/* rtl:ignore */"};
64
+ }
60
65
  }
61
66
  }
62
67
  }
@@ -68,8 +73,11 @@
68
73
  .dropdown-menu {
69
74
  top: auto;
70
75
  bottom: 100%;
71
- margin-top: 0;
72
- margin-bottom: $dropdown-spacer;
76
+
77
+ &[data-bs-popper] {
78
+ margin-top: 0;
79
+ margin-bottom: $dropdown-spacer;
80
+ }
73
81
  }
74
82
 
75
83
  .dropdown-toggle {
@@ -82,8 +90,11 @@
82
90
  top: 0;
83
91
  right: auto;
84
92
  left: 100%;
85
- margin-top: 0;
86
- margin-left: $dropdown-spacer;
93
+
94
+ &[data-bs-popper] {
95
+ margin-top: 0;
96
+ margin-left: $dropdown-spacer;
97
+ }
87
98
  }
88
99
 
89
100
  .dropdown-toggle {
@@ -99,8 +110,11 @@
99
110
  top: 0;
100
111
  right: 100%;
101
112
  left: auto;
102
- margin-top: 0;
103
- margin-right: $dropdown-spacer;
113
+
114
+ &[data-bs-popper] {
115
+ margin-top: 0;
116
+ margin-right: $dropdown-spacer;
117
+ }
104
118
  }
105
119
 
106
120
  .dropdown-toggle {
@@ -152,12 +152,12 @@
152
152
  // Organizationally, this must come after the `:hover` states.
153
153
 
154
154
  @each $state, $value in $theme-colors {
155
- $background: shift-color($value, $list-group-item-bg-scale);
156
- $color: shift-color($value, $list-group-item-color-scale);
157
- @if (contrast-ratio($background, $color) < $min-contrast-ratio) {
158
- $color: mix($value, color-contrast($background), abs($alert-color-scale));
155
+ $list-group-background: shift-color($value, $list-group-item-bg-scale);
156
+ $list-group-color: shift-color($value, $list-group-item-color-scale);
157
+ @if (contrast-ratio($list-group-background, $list-group-color) < $min-contrast-ratio) {
158
+ $list-group-color: mix($value, color-contrast($list-group-background), abs($alert-color-scale));
159
159
  }
160
160
 
161
- @include list-group-item-variant($state, $background, $color);
161
+ @include list-group-item-variant($state, $list-group-background, $list-group-color);
162
162
  }
163
163
  // scss-docs-end list-group-modifiers
@@ -43,12 +43,15 @@
43
43
 
44
44
  .nav-link {
45
45
  margin-bottom: -$nav-tabs-border-width;
46
+ background: none;
46
47
  border: $nav-tabs-border-width solid transparent;
47
48
  @include border-top-radius($nav-tabs-border-radius);
48
49
 
49
50
  &:hover,
50
51
  &:focus {
51
52
  border-color: $nav-tabs-link-hover-border-color;
53
+ // Prevents active .nav-link tab overlapping focus outline of previous/next .nav-link
54
+ isolation: isolate;
52
55
  }
53
56
 
54
57
  &.disabled {
@@ -80,6 +83,8 @@
80
83
 
81
84
  .nav-pills {
82
85
  .nav-link {
86
+ background: none;
87
+ border: 0;
83
88
  @include border-radius($nav-pills-border-radius);
84
89
  }
85
90
 
@@ -109,10 +109,11 @@
109
109
  // the default flexbox row orientation. Requires the use of `flex-wrap: wrap`
110
110
  // on the `.navbar` parent.
111
111
  .navbar-collapse {
112
+ flex-basis: 100%;
113
+ flex-grow: 1;
112
114
  // For always expanded or extra full navbars, ensure content aligns itself
113
115
  // properly vertically. Can be easily overridden with flex utilities.
114
116
  align-items: center;
115
- width: 100%;
116
117
  }
117
118
 
118
119
  // Button for toggling the navbar when in its collapsed state
@@ -148,6 +149,11 @@
148
149
  background-size: 100%;
149
150
  }
150
151
 
152
+ .navbar-nav-scroll {
153
+ max-height: var(--#{$variable-prefix}scroll-height, 75vh);
154
+ overflow-y: auto;
155
+ }
156
+
151
157
  // Generate series of `.navbar-expand-*` responsive classes for configuring
152
158
  // where your navbar collapses.
153
159
  .navbar-expand {
@@ -174,8 +180,13 @@
174
180
  }
175
181
  }
176
182
 
183
+ .navbar-nav-scroll {
184
+ overflow: visible;
185
+ }
186
+
177
187
  .navbar-collapse {
178
188
  display: flex !important; // stylelint-disable-line declaration-no-important
189
+ flex-basis: auto;
179
190
  }
180
191
 
181
192
  .navbar-toggler {
@@ -56,9 +56,9 @@
56
56
  @include pagination-size($pagination-padding-y, $pagination-padding-x, null, $pagination-border-radius);
57
57
 
58
58
  .pagination-lg {
59
- @include pagination-size($pagination-padding-y-lg, $pagination-padding-x-lg, $font-size-lg, $border-radius-lg);
59
+ @include pagination-size($pagination-padding-y-lg, $pagination-padding-x-lg, $font-size-lg, $pagination-border-radius-lg);
60
60
  }
61
61
 
62
62
  .pagination-sm {
63
- @include pagination-size($pagination-padding-y-sm, $pagination-padding-x-sm, $font-size-sm, $border-radius-sm);
63
+ @include pagination-size($pagination-padding-y-sm, $pagination-padding-x-sm, $font-size-sm, $pagination-border-radius-sm);
64
64
  }
@@ -22,7 +22,6 @@
22
22
  display: block;
23
23
  width: $popover-arrow-width;
24
24
  height: $popover-arrow-height;
25
- margin: 0 $popover-border-radius;
26
25
 
27
26
  &::before,
28
27
  &::after {
@@ -36,9 +35,6 @@
36
35
  }
37
36
 
38
37
  .bs-popover-top {
39
- // Overrule margin set by popper.js
40
- margin-bottom: $popover-arrow-height !important; // stylelint-disable-line declaration-no-important
41
-
42
38
  > .popover-arrow {
43
39
  bottom: subtract(-$popover-arrow-height, $popover-border-width);
44
40
 
@@ -57,14 +53,10 @@
57
53
  }
58
54
 
59
55
  .bs-popover-end {
60
- // Overrule margin set by popper.js
61
- margin-left: $popover-arrow-height !important; // stylelint-disable-line declaration-no-important
62
-
63
56
  > .popover-arrow {
64
57
  left: subtract(-$popover-arrow-height, $popover-border-width);
65
58
  width: $popover-arrow-height;
66
59
  height: $popover-arrow-width;
67
- margin: $popover-border-radius 0; // make sure the arrow does not touch the popover's rounded corners
68
60
 
69
61
  &::before {
70
62
  left: 0;
@@ -81,9 +73,6 @@
81
73
  }
82
74
 
83
75
  .bs-popover-bottom {
84
- // Overrule margin set by popper.js
85
- margin-top: $popover-arrow-height !important; // stylelint-disable-line declaration-no-important
86
-
87
76
  > .popover-arrow {
88
77
  top: subtract(-$popover-arrow-height, $popover-border-width);
89
78
 
@@ -114,14 +103,10 @@
114
103
  }
115
104
 
116
105
  .bs-popover-start {
117
- // Overrule margin set by popper.js
118
- margin-right: $popover-arrow-height !important; // stylelint-disable-line declaration-no-important
119
-
120
106
  > .popover-arrow {
121
107
  right: subtract(-$popover-arrow-height, $popover-border-width);
122
108
  width: $popover-arrow-height;
123
109
  height: $popover-arrow-width;
124
- margin: $popover-border-radius 0; // make sure the arrow does not touch the popover's rounded corners
125
110
 
126
111
  &::before {
127
112
  right: 0;
@@ -411,13 +411,13 @@ button {
411
411
  border-radius: 0;
412
412
  }
413
413
 
414
- // Work around a Firefox bug where the transparent `button` background
415
- // results in a loss of the default `button` focus styles.
416
- // Credit https://github.com/suitcss/base/
414
+ // Explicitly remove focus outline in Chromium when it shouldn't be
415
+ // visible (e.g. as result of mouse click or touch tap). It already
416
+ // should be doing this automatically, but seems to currently be
417
+ // confused and applies its very visible two-tone outline anyway.
417
418
 
418
- button:focus {
419
- outline: dotted 1px;
420
- outline: -webkit-focus-ring-color auto 5px;
419
+ button:focus:not(:focus-visible) {
420
+ outline: 0;
421
421
  }
422
422
 
423
423
  // 1. Remove the margin in Firefox and Safari
@@ -25,8 +25,8 @@
25
25
  > :not(caption) > * > * {
26
26
  padding: $table-cell-padding-y $table-cell-padding-x;
27
27
  background-color: var(--#{$variable-prefix}table-bg);
28
- background-image: linear-gradient(var(--#{$variable-prefix}table-accent-bg), var(--#{$variable-prefix}table-accent-bg));
29
28
  border-bottom-width: $table-border-width;
29
+ box-shadow: inset 0 0 0 9999px var(--#{$variable-prefix}table-accent-bg);
30
30
  }
31
31
 
32
32
  > tbody {
@@ -47,4 +47,5 @@
47
47
 
48
48
  .toast-body {
49
49
  padding: $toast-padding-x; // apply to both vertical and horizontal
50
+ word-wrap: break-word;
50
51
  }
@@ -22,6 +22,7 @@ $utilities: map-merge(
22
22
  property: overflow,
23
23
  values: auto hidden visible scroll,
24
24
  ),
25
+ // scss-docs-start utils-display
25
26
  "display": (
26
27
  responsive: true,
27
28
  print: true,
@@ -29,6 +30,7 @@ $utilities: map-merge(
29
30
  class: d,
30
31
  values: inline inline-block block grid table table-row table-cell flex inline-flex none
31
32
  ),
33
+ // scss-docs-end utils-display
32
34
  "shadow": (
33
35
  property: box-shadow,
34
36
  class: shadow,
@@ -440,6 +442,7 @@ $utilities: map-merge(
440
442
  center: center,
441
443
  )
442
444
  ),
445
+ // scss-docs-start utils-color
443
446
  "color": (
444
447
  property: color,
445
448
  class: text,
@@ -455,6 +458,7 @@ $utilities: map-merge(
455
458
  )
456
459
  )
457
460
  ),
461
+ // scss-docs-end utils-color
458
462
  "line-height": (
459
463
  property: line-height,
460
464
  class: lh,
@@ -465,6 +469,7 @@ $utilities: map-merge(
465
469
  lg: $line-height-lg,
466
470
  )
467
471
  ),
472
+ // scss-docs-start utils-bg-color
468
473
  "background-color": (
469
474
  property: background-color,
470
475
  class: bg,
@@ -477,6 +482,7 @@ $utilities: map-merge(
477
482
  )
478
483
  )
479
484
  ),
485
+ // scss-docs-end utils-bg-color
480
486
  "gradient": (
481
487
  property: background-image,
482
488
  class: bg,