bootstrap 4.1.3 → 4.2.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bootstrap might be problematic. Click here for more details.

Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -1
  3. data/README.md +1 -1
  4. data/Rakefile +2 -2
  5. data/assets/javascripts/bootstrap-sprockets.js +6 -5
  6. data/assets/javascripts/bootstrap.js +3290 -2985
  7. data/assets/javascripts/bootstrap.min.js +2 -2
  8. data/assets/javascripts/bootstrap/alert.js +127 -132
  9. data/assets/javascripts/bootstrap/button.js +119 -124
  10. data/assets/javascripts/bootstrap/carousel.js +492 -393
  11. data/assets/javascripts/bootstrap/collapse.js +276 -279
  12. data/assets/javascripts/bootstrap/dropdown.js +413 -374
  13. data/assets/javascripts/bootstrap/modal.js +455 -445
  14. data/assets/javascripts/bootstrap/popover.js +155 -160
  15. data/assets/javascripts/bootstrap/scrollspy.js +246 -250
  16. data/assets/javascripts/bootstrap/tab.js +180 -192
  17. data/assets/javascripts/bootstrap/toast.js +277 -0
  18. data/assets/javascripts/bootstrap/tooltip.js +533 -522
  19. data/assets/javascripts/bootstrap/util.js +140 -116
  20. data/assets/stylesheets/_bootstrap-grid.scss +2 -5
  21. data/assets/stylesheets/_bootstrap-reboot.scss +1 -1
  22. data/assets/stylesheets/_bootstrap.scss +3 -1
  23. data/assets/stylesheets/bootstrap/_alert.scss +1 -1
  24. data/assets/stylesheets/bootstrap/_badge.scss +6 -0
  25. data/assets/stylesheets/bootstrap/_button-group.scss +9 -18
  26. data/assets/stylesheets/bootstrap/_buttons.scss +7 -10
  27. data/assets/stylesheets/bootstrap/_card.scss +30 -21
  28. data/assets/stylesheets/bootstrap/_carousel.scss +36 -74
  29. data/assets/stylesheets/bootstrap/_close.scss +15 -6
  30. data/assets/stylesheets/bootstrap/_custom-forms.scss +103 -29
  31. data/assets/stylesheets/bootstrap/_dropdown.scss +30 -5
  32. data/assets/stylesheets/bootstrap/_forms.scss +12 -11
  33. data/assets/stylesheets/bootstrap/_functions.scss +4 -4
  34. data/assets/stylesheets/bootstrap/_images.scss +1 -1
  35. data/assets/stylesheets/bootstrap/_input-group.scss +24 -4
  36. data/assets/stylesheets/bootstrap/_list-group.scss +6 -0
  37. data/assets/stylesheets/bootstrap/_modal.scss +16 -10
  38. data/assets/stylesheets/bootstrap/_nav.scss +2 -0
  39. data/assets/stylesheets/bootstrap/_navbar.scss +4 -4
  40. data/assets/stylesheets/bootstrap/_popover.scss +1 -1
  41. data/assets/stylesheets/bootstrap/_reboot.scss +14 -35
  42. data/assets/stylesheets/bootstrap/_spinners.scss +53 -0
  43. data/assets/stylesheets/bootstrap/_tables.scss +2 -2
  44. data/assets/stylesheets/bootstrap/_toasts.scss +43 -0
  45. data/assets/stylesheets/bootstrap/_type.scss +2 -2
  46. data/assets/stylesheets/bootstrap/_utilities.scss +1 -0
  47. data/assets/stylesheets/bootstrap/_variables.scss +220 -81
  48. data/assets/stylesheets/bootstrap/mixins/_badge.scss +1 -2
  49. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +2 -2
  50. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +9 -7
  51. data/assets/stylesheets/bootstrap/mixins/_caret.scss +0 -4
  52. data/assets/stylesheets/bootstrap/mixins/_forms.scss +61 -10
  53. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +3 -4
  54. data/assets/stylesheets/bootstrap/mixins/_grid.scss +9 -10
  55. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +10 -1
  56. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +1 -1
  57. data/assets/stylesheets/bootstrap/mixins/_transition.scss +5 -2
  58. data/assets/stylesheets/bootstrap/utilities/_borders.scss +4 -0
  59. data/assets/stylesheets/bootstrap/utilities/_embed.scss +7 -20
  60. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +5 -0
  61. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -5
  62. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +8 -0
  63. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +23 -1
  64. data/assets/stylesheets/bootstrap/utilities/_text.scss +13 -4
  65. data/bootstrap.gemspec +6 -3
  66. data/lib/bootstrap.rb +10 -7
  67. data/lib/bootstrap/engine.rb +3 -0
  68. data/lib/bootstrap/version.rb +4 -2
  69. metadata +15 -11
@@ -2,10 +2,9 @@
2
2
  color: color-yiq($bg);
3
3
  background-color: $bg;
4
4
 
5
- &[href] {
5
+ @at-root a#{&} {
6
6
  @include hover-focus {
7
7
  color: color-yiq($bg);
8
- text-decoration: none;
9
8
  background-color: darken($bg, 10%);
10
9
  }
11
10
  }
@@ -16,7 +16,7 @@
16
16
  // md
17
17
  @function breakpoint-next($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map-keys($breakpoints)) {
18
18
  $n: index($breakpoint-names, $name);
19
- @return if($n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null);
19
+ @return if($n != null and $n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null);
20
20
  }
21
21
 
22
22
  // Minimum breakpoint width. Null for the smallest (first) breakpoint.
@@ -39,7 +39,7 @@
39
39
  // 767.98px
40
40
  @function breakpoint-max($name, $breakpoints: $grid-breakpoints) {
41
41
  $next: breakpoint-next($name, $breakpoints);
42
- @return if($next, breakpoint-min($next, $breakpoints) - .02px, null);
42
+ @return if($next, breakpoint-min($next, $breakpoints) - .02, null);
43
43
  }
44
44
 
45
45
  // Returns a blank string if smallest breakpoint, otherwise returns the name with a dash in front.
@@ -19,9 +19,9 @@
19
19
  &.focus {
20
20
  // Avoid using mixin so we can pass custom focus shadow properly
21
21
  @if $enable-shadows {
22
- box-shadow: $btn-box-shadow, 0 0 0 $btn-focus-width rgba($border, .5);
22
+ box-shadow: $btn-box-shadow, 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
23
23
  } @else {
24
- box-shadow: 0 0 0 $btn-focus-width rgba($border, .5);
24
+ box-shadow: 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
25
25
  }
26
26
  }
27
27
 
@@ -31,6 +31,10 @@
31
31
  color: color-yiq($background);
32
32
  background-color: $background;
33
33
  border-color: $border;
34
+ // Remove CSS gradients if they're enabled
35
+ @if $enable-gradients {
36
+ background-image: none;
37
+ }
34
38
  }
35
39
 
36
40
  &:not(:disabled):not(.disabled):active,
@@ -46,9 +50,9 @@
46
50
  &:focus {
47
51
  // Avoid using mixin so we can pass custom focus shadow properly
48
52
  @if $enable-shadows {
49
- box-shadow: $btn-active-box-shadow, 0 0 0 $btn-focus-width rgba($border, .5);
53
+ box-shadow: $btn-active-box-shadow, 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
50
54
  } @else {
51
- box-shadow: 0 0 0 $btn-focus-width rgba($border, .5);
55
+ box-shadow: 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
52
56
  }
53
57
  }
54
58
  }
@@ -56,11 +60,9 @@
56
60
 
57
61
  @mixin button-outline-variant($color, $color-hover: color-yiq($color), $active-background: $color, $active-border: $color) {
58
62
  color: $color;
59
- background-color: transparent;
60
- background-image: none;
61
63
  border-color: $color;
62
64
 
63
- &:hover {
65
+ @include hover {
64
66
  color: $color-hover;
65
67
  background-color: $active-background;
66
68
  border-color: $active-border;
@@ -29,8 +29,6 @@
29
29
  @if $enable-caret {
30
30
  &::after {
31
31
  display: inline-block;
32
- width: 0;
33
- height: 0;
34
32
  margin-left: $caret-width * .85;
35
33
  vertical-align: $caret-width * .85;
36
34
  content: "";
@@ -50,8 +48,6 @@
50
48
 
51
49
  &::before {
52
50
  display: inline-block;
53
- width: 0;
54
- height: 0;
55
51
  margin-right: $caret-width * .85;
56
52
  vertical-align: $caret-width * .85;
57
53
  content: "";
@@ -41,21 +41,67 @@
41
41
  z-index: 5;
42
42
  display: none;
43
43
  max-width: 100%; // Contain to parent when possible
44
- padding: $tooltip-padding-y $tooltip-padding-x;
44
+ padding: $form-feedback-tooltip-padding-y $form-feedback-tooltip-padding-x;
45
45
  margin-top: .1rem;
46
- font-size: $tooltip-font-size;
47
- line-height: $line-height-base;
46
+ font-size: $form-feedback-tooltip-font-size;
47
+ line-height: $form-feedback-tooltip-line-height;
48
48
  color: color-yiq($color);
49
- background-color: rgba($color, $tooltip-opacity);
50
- @include border-radius($tooltip-border-radius);
49
+ background-color: rgba($color, $form-feedback-tooltip-opacity);
50
+ @include border-radius($form-feedback-tooltip-border-radius);
51
+ }
52
+
53
+ .form-control {
54
+ .was-validated &:#{$state},
55
+ &.is-#{$state} {
56
+ border-color: $color;
57
+
58
+ @if $enable-validation-icons {
59
+ padding-right: $input-height-inner;
60
+ background-repeat: no-repeat;
61
+ background-position: center right calc(#{$input-height-inner} / 4);
62
+ background-size: calc(#{$input-height-inner} / 2) calc(#{$input-height-inner} / 2);
63
+
64
+ @if $state == "valid" {
65
+ background-image: $form-feedback-icon-valid;
66
+ } @else {
67
+ background-image: $form-feedback-icon-invalid;
68
+ }
69
+ }
70
+
71
+ &:focus {
72
+ border-color: $color;
73
+ box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
74
+ }
75
+
76
+ ~ .#{$state}-feedback,
77
+ ~ .#{$state}-tooltip {
78
+ display: block;
79
+ }
80
+ }
81
+ }
82
+
83
+ // stylelint-disable-next-line selector-no-qualifying-type
84
+ textarea.form-control {
85
+ .was-validated &:#{$state},
86
+ &.is-#{$state} {
87
+ @if $enable-validation-icons {
88
+ padding-right: $input-height-inner;
89
+ background-position: top calc(#{$input-height-inner} / 4) right calc(#{$input-height-inner} / 4);
90
+ }
91
+ }
51
92
  }
52
93
 
53
- .form-control,
54
94
  .custom-select {
55
95
  .was-validated &:#{$state},
56
96
  &.is-#{$state} {
57
97
  border-color: $color;
58
98
 
99
+ @if $enable-validation-icons {
100
+ $form-feedback-icon: if($state == "valid", $form-feedback-icon-valid, $form-feedback-icon-invalid);
101
+ padding-right: $custom-select-feedback-icon-padding-right;
102
+ background: $custom-select-background, $form-feedback-icon no-repeat $custom-select-feedback-icon-position / $custom-select-feedback-icon-size;
103
+ }
104
+
59
105
  &:focus {
60
106
  border-color: $color;
61
107
  box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
@@ -68,6 +114,7 @@
68
114
  }
69
115
  }
70
116
 
117
+
71
118
  .form-control-file {
72
119
  .was-validated &:#{$state},
73
120
  &.is-#{$state} {
@@ -99,7 +146,7 @@
99
146
  color: $color;
100
147
 
101
148
  &::before {
102
- background-color: lighten($color, 25%);
149
+ border-color: $color;
103
150
  }
104
151
  }
105
152
 
@@ -110,13 +157,18 @@
110
157
 
111
158
  &:checked {
112
159
  ~ .custom-control-label::before {
160
+ border-color: lighten($color, 10%);
113
161
  @include gradient-bg(lighten($color, 10%));
114
162
  }
115
163
  }
116
164
 
117
165
  &:focus {
118
166
  ~ .custom-control-label::before {
119
- box-shadow: 0 0 0 1px $body-bg, 0 0 0 $input-focus-width rgba($color, .25);
167
+ box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
168
+ }
169
+
170
+ &:not(:checked) ~ .custom-control-label::before {
171
+ border-color: $color;
120
172
  }
121
173
  }
122
174
  }
@@ -128,8 +180,6 @@
128
180
  &.is-#{$state} {
129
181
  ~ .custom-file-label {
130
182
  border-color: $color;
131
-
132
- &::after { border-color: inherit; }
133
183
  }
134
184
 
135
185
  ~ .#{$state}-feedback,
@@ -139,6 +189,7 @@
139
189
 
140
190
  &:focus {
141
191
  ~ .custom-file-label {
192
+ border-color: $color;
142
193
  box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
143
194
  }
144
195
  }
@@ -8,9 +8,8 @@
8
8
  %grid-column {
9
9
  position: relative;
10
10
  width: 100%;
11
- min-height: 1px; // Prevent columns from collapsing when empty
12
- padding-right: ($gutter / 2);
13
- padding-left: ($gutter / 2);
11
+ padding-right: $gutter / 2;
12
+ padding-left: $gutter / 2;
14
13
  }
15
14
 
16
15
  @each $breakpoint in map-keys($breakpoints) {
@@ -37,7 +36,7 @@
37
36
  .col#{$infix}-auto {
38
37
  flex: 0 0 auto;
39
38
  width: auto;
40
- max-width: none; // Reset earlier grid tiers
39
+ max-width: 100%; // Reset earlier grid tiers
41
40
  }
42
41
 
43
42
  @for $i from 1 through $columns {
@@ -2,10 +2,10 @@
2
2
  //
3
3
  // Generate semantic grid columns with these mixins.
4
4
 
5
- @mixin make-container() {
5
+ @mixin make-container($gutter: $grid-gutter-width) {
6
6
  width: 100%;
7
- padding-right: ($grid-gutter-width / 2);
8
- padding-left: ($grid-gutter-width / 2);
7
+ padding-right: $gutter / 2;
8
+ padding-left: $gutter / 2;
9
9
  margin-right: auto;
10
10
  margin-left: auto;
11
11
  }
@@ -20,22 +20,21 @@
20
20
  }
21
21
  }
22
22
 
23
- @mixin make-row() {
23
+ @mixin make-row($gutter: $grid-gutter-width) {
24
24
  display: flex;
25
25
  flex-wrap: wrap;
26
- margin-right: ($grid-gutter-width / -2);
27
- margin-left: ($grid-gutter-width / -2);
26
+ margin-right: -$gutter / 2;
27
+ margin-left: -$gutter / 2;
28
28
  }
29
29
 
30
- @mixin make-col-ready() {
30
+ @mixin make-col-ready($gutter: $grid-gutter-width) {
31
31
  position: relative;
32
32
  // Prevent columns from becoming too narrow when at smaller grid tiers by
33
33
  // always setting `width: 100%;`. This works because we use `flex` values
34
34
  // later on to override this initial width.
35
35
  width: 100%;
36
- min-height: 1px; // Prevent collapsing
37
- padding-right: ($grid-gutter-width / 2);
38
- padding-left: ($grid-gutter-width / 2);
36
+ padding-right: $gutter / 2;
37
+ padding-left: $gutter / 2;
39
38
  }
40
39
 
41
40
  @mixin make-col($size, $columns: $grid-columns) {
@@ -1,6 +1,6 @@
1
1
  // Tables
2
2
 
3
- @mixin table-row-variant($state, $background) {
3
+ @mixin table-row-variant($state, $background, $border: null) {
4
4
  // Exact selectors below required to override `.table-striped` and prevent
5
5
  // inheritance to nested tables.
6
6
  .table-#{$state} {
@@ -9,6 +9,15 @@
9
9
  > td {
10
10
  background-color: $background;
11
11
  }
12
+
13
+ @if $border != null {
14
+ th,
15
+ td,
16
+ thead th,
17
+ tbody + tbody {
18
+ border-color: $border;
19
+ }
20
+ }
12
21
  }
13
22
 
14
23
  // Hover states for `.table-hover`
@@ -8,7 +8,7 @@
8
8
  }
9
9
  a#{$parent} {
10
10
  @include hover-focus {
11
- color: darken($color, 10%) !important;
11
+ color: darken($color, $emphasized-link-hover-darken-percentage) !important;
12
12
  }
13
13
  }
14
14
  }
@@ -1,3 +1,4 @@
1
+ // stylelint-disable property-blacklist
1
2
  @mixin transition($transition...) {
2
3
  @if $enable-transitions {
3
4
  @if length($transition) == 0 {
@@ -7,7 +8,9 @@
7
8
  }
8
9
  }
9
10
 
10
- @media screen and (prefers-reduced-motion: reduce) {
11
- transition: none;
11
+ @if $enable-prefers-reduced-motion-media-query {
12
+ @media screen and (prefers-reduced-motion: reduce) {
13
+ transition: none;
14
+ }
12
15
  }
13
16
  }
@@ -54,6 +54,10 @@
54
54
  border-radius: 50% !important;
55
55
  }
56
56
 
57
+ .rounded-pill {
58
+ border-radius: $rounded-pill !important;
59
+ }
60
+
57
61
  .rounded-0 {
58
62
  border-radius: 0 !important;
59
63
  }
@@ -27,26 +27,13 @@
27
27
  }
28
28
  }
29
29
 
30
- .embed-responsive-21by9 {
31
- &::before {
32
- padding-top: percentage(9 / 21);
33
- }
34
- }
35
-
36
- .embed-responsive-16by9 {
37
- &::before {
38
- padding-top: percentage(9 / 16);
39
- }
40
- }
41
-
42
- .embed-responsive-4by3 {
43
- &::before {
44
- padding-top: percentage(3 / 4);
45
- }
46
- }
30
+ @each $embed-responsive-aspect-ratio in $embed-responsive-aspect-ratios {
31
+ $embed-responsive-aspect-ratio-x: nth($embed-responsive-aspect-ratio, 1);
32
+ $embed-responsive-aspect-ratio-y: nth($embed-responsive-aspect-ratio, 2);
47
33
 
48
- .embed-responsive-1by1 {
49
- &::before {
50
- padding-top: percentage(1 / 1);
34
+ .embed-responsive-#{$embed-responsive-aspect-ratio-x}by#{$embed-responsive-aspect-ratio-y} {
35
+ &::before {
36
+ padding-top: percentage($embed-responsive-aspect-ratio-y / $embed-responsive-aspect-ratio-x);
37
+ }
51
38
  }
52
39
  }
@@ -0,0 +1,5 @@
1
+ // stylelint-disable declaration-no-important
2
+
3
+ @each $value in $overflows {
4
+ .overflow-#{$value} { overflow: $value !important; }
5
+ }
@@ -1,11 +1,6 @@
1
1
  // stylelint-disable declaration-no-important
2
2
 
3
3
  // Common values
4
-
5
- // Sass list not in variables since it's not intended for customization.
6
- // stylelint-disable-next-line scss/dollar-variable-default
7
- $positions: static, relative, absolute, fixed, sticky;
8
-
9
4
  @each $position in $positions {
10
5
  .position-#{$position} { position: $position !important; }
11
6
  }
@@ -10,3 +10,11 @@
10
10
 
11
11
  .mw-100 { max-width: 100% !important; }
12
12
  .mh-100 { max-height: 100% !important; }
13
+
14
+ // Viewport additional helpers
15
+
16
+ .min-vw-100 { min-width: 100vw !important; }
17
+ .min-vh-100 { min-height: 100vh !important; }
18
+
19
+ .vw-100 { width: 100vw !important; }
20
+ .vh-100 { height: 100vh !important; }
@@ -8,7 +8,6 @@
8
8
 
9
9
  @each $prop, $abbrev in (margin: m, padding: p) {
10
10
  @each $size, $length in $spacers {
11
-
12
11
  .#{$abbrev}#{$infix}-#{$size} { #{$prop}: $length !important; }
13
12
  .#{$abbrev}t#{$infix}-#{$size},
14
13
  .#{$abbrev}y#{$infix}-#{$size} {
@@ -29,6 +28,29 @@
29
28
  }
30
29
  }
31
30
 
31
+ // Negative margins (e.g., where `.mb-n1` is negative version of `.mb-1`)
32
+ @each $size, $length in $spacers {
33
+ @if $size != 0 {
34
+ .m#{$infix}-n#{$size} { margin: -$length !important; }
35
+ .mt#{$infix}-n#{$size},
36
+ .my#{$infix}-n#{$size} {
37
+ margin-top: -$length !important;
38
+ }
39
+ .mr#{$infix}-n#{$size},
40
+ .mx#{$infix}-n#{$size} {
41
+ margin-right: -$length !important;
42
+ }
43
+ .mb#{$infix}-n#{$size},
44
+ .my#{$infix}-n#{$size} {
45
+ margin-bottom: -$length !important;
46
+ }
47
+ .ml#{$infix}-n#{$size},
48
+ .mx#{$infix}-n#{$size} {
49
+ margin-left: -$length !important;
50
+ }
51
+ }
52
+ }
53
+
32
54
  // Some special margin utils
33
55
  .m#{$infix}-auto { margin: auto !important; }
34
56
  .mt#{$infix}-auto,