bootstrap 4.2.1 → 4.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +15 -1
  3. data/CHANGELOG.md +2 -14
  4. data/README.md +1 -1
  5. data/assets/javascripts/bootstrap-sprockets.js +7 -7
  6. data/assets/javascripts/bootstrap.js +1054 -893
  7. data/assets/javascripts/bootstrap.min.js +4 -4
  8. data/assets/javascripts/bootstrap/alert.js +35 -57
  9. data/assets/javascripts/bootstrap/button.js +95 -69
  10. data/assets/javascripts/bootstrap/carousel.js +109 -165
  11. data/assets/javascripts/bootstrap/collapse.js +58 -114
  12. data/assets/javascripts/bootstrap/dropdown.js +138 -191
  13. data/assets/javascripts/bootstrap/modal.js +170 -176
  14. data/assets/javascripts/bootstrap/popover.js +31 -87
  15. data/assets/javascripts/bootstrap/scrollspy.js +54 -114
  16. data/assets/javascripts/bootstrap/tab.js +62 -81
  17. data/assets/javascripts/bootstrap/toast.js +80 -117
  18. data/assets/javascripts/bootstrap/tooltip.js +269 -157
  19. data/assets/javascripts/bootstrap/util.js +34 -9
  20. data/assets/stylesheets/_bootstrap-grid.scss +4 -4
  21. data/assets/stylesheets/_bootstrap-reboot.scss +4 -4
  22. data/assets/stylesheets/_bootstrap.scss +4 -4
  23. data/assets/stylesheets/bootstrap/_badge.scss +3 -2
  24. data/assets/stylesheets/bootstrap/_breadcrumb.scss +4 -1
  25. data/assets/stylesheets/bootstrap/_button-group.scss +1 -1
  26. data/assets/stylesheets/bootstrap/_buttons.scss +13 -11
  27. data/assets/stylesheets/bootstrap/_card.scss +49 -73
  28. data/assets/stylesheets/bootstrap/_carousel.scss +7 -8
  29. data/assets/stylesheets/bootstrap/_close.scss +3 -7
  30. data/assets/stylesheets/bootstrap/_code.scss +6 -6
  31. data/assets/stylesheets/bootstrap/_custom-forms.scss +40 -24
  32. data/assets/stylesheets/bootstrap/_dropdown.scss +24 -23
  33. data/assets/stylesheets/bootstrap/_forms.scss +38 -25
  34. data/assets/stylesheets/bootstrap/_functions.scss +62 -7
  35. data/assets/stylesheets/bootstrap/_grid.scss +32 -11
  36. data/assets/stylesheets/bootstrap/_images.scss +3 -3
  37. data/assets/stylesheets/bootstrap/_input-group.scss +4 -5
  38. data/assets/stylesheets/bootstrap/_jumbotron.scss +1 -0
  39. data/assets/stylesheets/bootstrap/_list-group.scss +62 -29
  40. data/assets/stylesheets/bootstrap/_mixins.scss +9 -3
  41. data/assets/stylesheets/bootstrap/_modal.scss +65 -11
  42. data/assets/stylesheets/bootstrap/_nav.scss +6 -3
  43. data/assets/stylesheets/bootstrap/_navbar.scss +48 -23
  44. data/assets/stylesheets/bootstrap/_pagination.scss +3 -7
  45. data/assets/stylesheets/bootstrap/_popover.scss +54 -67
  46. data/assets/stylesheets/bootstrap/_print.scss +3 -3
  47. data/assets/stylesheets/bootstrap/_progress.scss +19 -6
  48. data/assets/stylesheets/bootstrap/_reboot.scss +51 -33
  49. data/assets/stylesheets/bootstrap/_root.scss +1 -0
  50. data/assets/stylesheets/bootstrap/_spinners.scss +3 -0
  51. data/assets/stylesheets/bootstrap/_tables.scss +6 -8
  52. data/assets/stylesheets/bootstrap/_toasts.scss +7 -4
  53. data/assets/stylesheets/bootstrap/_tooltip.scss +1 -1
  54. data/assets/stylesheets/bootstrap/_transitions.scss +0 -2
  55. data/assets/stylesheets/bootstrap/_type.scss +17 -17
  56. data/assets/stylesheets/bootstrap/_utilities.scss +2 -0
  57. data/assets/stylesheets/bootstrap/_variables.scss +168 -119
  58. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +5 -3
  59. data/assets/stylesheets/bootstrap/mixins/_badge.scss +7 -1
  60. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +51 -10
  61. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +16 -1
  62. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +14 -15
  63. data/assets/stylesheets/bootstrap/mixins/_caret.scss +12 -12
  64. data/assets/stylesheets/bootstrap/mixins/_deprecate.scss +10 -0
  65. data/assets/stylesheets/bootstrap/mixins/_float.scss +6 -3
  66. data/assets/stylesheets/bootstrap/mixins/_forms.scss +40 -60
  67. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +29 -15
  68. data/assets/stylesheets/bootstrap/mixins/_grid.scss +25 -7
  69. data/assets/stylesheets/bootstrap/mixins/_hover.scss +4 -4
  70. data/assets/stylesheets/bootstrap/mixins/_image.scss +3 -3
  71. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +1 -1
  72. data/assets/stylesheets/bootstrap/mixins/_lists.scss +1 -1
  73. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +2 -1
  74. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +1 -1
  75. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +2 -2
  76. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +3 -2
  77. data/assets/stylesheets/bootstrap/mixins/_size.scss +1 -0
  78. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +1 -1
  79. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +7 -4
  80. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +1 -3
  81. data/assets/stylesheets/bootstrap/mixins/_transition.scss +17 -7
  82. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +1 -0
  83. data/assets/stylesheets/bootstrap/utilities/_background.scss +2 -2
  84. data/assets/stylesheets/bootstrap/utilities/_borders.scss +13 -1
  85. data/assets/stylesheets/bootstrap/utilities/_display.scss +6 -18
  86. data/assets/stylesheets/bootstrap/utilities/_float.scss +5 -3
  87. data/assets/stylesheets/bootstrap/utilities/_interactions.scss +5 -0
  88. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +19 -0
  89. data/assets/stylesheets/bootstrap/utilities/_text.scss +8 -3
  90. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +4 -2
  91. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +204 -0
  92. data/bootstrap.gemspec +1 -1
  93. data/lib/bootstrap/version.rb +2 -2
  94. data/tasks/updater/js.rb +1 -1
  95. data/tasks/updater/network.rb +2 -2
  96. data/test/dummy_rails/app/assets/config/manifest.js +3 -0
  97. data/test/dummy_rails/app/assets/stylesheets/.browserslistrc +1 -0
  98. data/test/gemfiles/rails_6_0.gemfile +7 -0
  99. data/test/support/dummy_rails_integration.rb +3 -1
  100. data/test/test_helper.rb +18 -13
  101. metadata +14 -5
@@ -8,7 +8,7 @@
8
8
  $prev-key: null;
9
9
  $prev-num: null;
10
10
  @each $key, $num in $map {
11
- @if $prev-num == null or unit($num) == "%" {
11
+ @if $prev-num == null or unit($num) == "%" or unit($prev-num) == "%" {
12
12
  // Do nothing
13
13
  } @else if not comparable($prev-num, $num) {
14
14
  @warn "Potentially invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} whose unit makes it incomparable to #{$prev-num}, the value of the previous key '#{$prev-key}' !";
@@ -21,12 +21,14 @@
21
21
  }
22
22
 
23
23
  // Starts at zero
24
- // Another grid mixin that ensures the min-width of the lowest breakpoint starts at 0.
25
- @mixin _assert-starts-at-zero($map) {
26
- $values: map-values($map);
27
- $first-value: nth($values, 1);
28
- @if $first-value != 0 {
29
- @warn "First breakpoint in `$grid-breakpoints` must start at 0, but starts at #{$first-value}.";
24
+ // Used to ensure the min-width of the lowest breakpoint starts at 0.
25
+ @mixin _assert-starts-at-zero($map, $map-name: "$grid-breakpoints") {
26
+ @if length($map) > 0 {
27
+ $values: map-values($map);
28
+ $first-value: nth($values, 1);
29
+ @if $first-value != 0 {
30
+ @warn "First breakpoint in #{$map-name} must start at 0, but starts at #{$first-value}.";
31
+ }
30
32
  }
31
33
  }
32
34
 
@@ -48,6 +50,22 @@
48
50
  @return $string;
49
51
  }
50
52
 
53
+ // See https://codepen.io/kevinweber/pen/dXWoRw
54
+ @function escape-svg($string) {
55
+ @if str-index($string, "data:image/svg+xml") {
56
+ @each $char, $encoded in $escaped-characters {
57
+ // Do not escape the url brackets
58
+ @if str-index($string, "url(") == 1 {
59
+ $string: url("#{str-replace(str-slice($string, 6, -3), $char, $encoded)}");
60
+ } @else {
61
+ $string: str-replace($string, $char, $encoded);
62
+ }
63
+ }
64
+ }
65
+
66
+ @return $string;
67
+ }
68
+
51
69
  // Color contrast
52
70
  @function color-yiq($color, $dark: $yiq-text-dark, $light: $yiq-text-light) {
53
71
  $r: red($color);
@@ -84,3 +102,40 @@
84
102
 
85
103
  @return mix($color-base, $color, $level * $theme-color-interval);
86
104
  }
105
+
106
+ // Return valid calc
107
+ @function add($value1, $value2, $return-calc: true) {
108
+ @if $value1 == null {
109
+ @return $value2;
110
+ }
111
+
112
+ @if $value2 == null {
113
+ @return $value1;
114
+ }
115
+
116
+ @if type-of($value1) == number and type-of($value2) == number and comparable($value1, $value2) {
117
+ @return $value1 + $value2;
118
+ }
119
+
120
+ @return if($return-calc == true, calc(#{$value1} + #{$value2}), $value1 + unquote(" + ") + $value2);
121
+ }
122
+
123
+ @function subtract($value1, $value2, $return-calc: true) {
124
+ @if $value1 == null and $value2 == null {
125
+ @return null;
126
+ }
127
+
128
+ @if $value1 == null {
129
+ @return -$value2;
130
+ }
131
+
132
+ @if $value2 == null {
133
+ @return $value1;
134
+ }
135
+
136
+ @if type-of($value1) == number and type-of($value2) == number and comparable($value1, $value2) {
137
+ @return $value1 - $value2;
138
+ }
139
+
140
+ @return if($return-calc == true, calc(#{$value1} - #{$value2}), $value1 + unquote(" - ") + $value2);
141
+ }
@@ -3,26 +3,47 @@
3
3
  // Set the container width, and override it for fixed navbars in media queries.
4
4
 
5
5
  @if $enable-grid-classes {
6
- .container {
6
+ // Single container class with breakpoint max-widths
7
+ .container,
8
+ // 100% wide container at all breakpoints
9
+ .container-fluid {
7
10
  @include make-container();
8
- @include make-container-max-widths();
9
11
  }
10
- }
11
12
 
12
- // Fluid container
13
- //
14
- // Utilizes the mixin meant for fixed width containers, but with 100% width for
15
- // fluid, full width layouts.
13
+ // Responsive containers that are 100% wide until a breakpoint
14
+ @each $breakpoint, $container-max-width in $container-max-widths {
15
+ .container-#{$breakpoint} {
16
+ @extend .container-fluid;
17
+ }
16
18
 
17
- @if $enable-grid-classes {
18
- .container-fluid {
19
- @include make-container();
19
+ @include media-breakpoint-up($breakpoint, $grid-breakpoints) {
20
+ %responsive-container-#{$breakpoint} {
21
+ max-width: $container-max-width;
22
+ }
23
+
24
+ // Extend each breakpoint which is smaller or equal to the current breakpoint
25
+ $extend-breakpoint: true;
26
+
27
+ @each $name, $width in $grid-breakpoints {
28
+ @if ($extend-breakpoint) {
29
+ .container#{breakpoint-infix($name, $grid-breakpoints)} {
30
+ @extend %responsive-container-#{$breakpoint};
31
+ }
32
+
33
+ // Once the current breakpoint is reached, stop extending
34
+ @if ($breakpoint == $name) {
35
+ $extend-breakpoint: false;
36
+ }
37
+ }
38
+ }
39
+ }
20
40
  }
21
41
  }
22
42
 
43
+
23
44
  // Row
24
45
  //
25
- // Rows contain and clear the floats of your columns.
46
+ // Rows contain your columns.
26
47
 
27
48
  @if $enable-grid-classes {
28
49
  .row {
@@ -6,7 +6,7 @@
6
6
  // which weren't expecting the images within themselves to be involuntarily resized.
7
7
  // See also https://github.com/twbs/bootstrap/issues/18178
8
8
  .img-fluid {
9
- @include img-fluid;
9
+ @include img-fluid();
10
10
  }
11
11
 
12
12
 
@@ -19,7 +19,7 @@
19
19
  @include box-shadow($thumbnail-box-shadow);
20
20
 
21
21
  // Keep them at most 100% wide
22
- @include img-fluid;
22
+ @include img-fluid();
23
23
  }
24
24
 
25
25
  //
@@ -37,6 +37,6 @@
37
37
  }
38
38
 
39
39
  .figure-caption {
40
- font-size: $figure-caption-font-size;
40
+ @include font-size($figure-caption-font-size);
41
41
  color: $figure-caption-color;
42
42
  }
@@ -17,9 +17,8 @@
17
17
  > .custom-file {
18
18
  position: relative; // For focus state's z-index
19
19
  flex: 1 1 auto;
20
- // Add width 1% and flex-basis auto to ensure that button will not wrap out
21
- // the column. Applies to IE Edge+ and Firefox. Chrome does not require this.
22
20
  width: 1%;
21
+ min-width: 0; // https://stackoverflow.com/questions/36247140/why-dont-flex-items-shrink-past-content-size
23
22
  margin-bottom: 0;
24
23
 
25
24
  + .form-control,
@@ -104,7 +103,7 @@
104
103
  align-items: center;
105
104
  padding: $input-padding-y $input-padding-x;
106
105
  margin-bottom: 0; // Allow use of <label> elements by overriding our default margin-bottom
107
- font-size: $font-size-base; // Match inputs
106
+ @include font-size($input-font-size); // Match inputs
108
107
  font-weight: $font-weight-normal;
109
108
  line-height: $input-line-height;
110
109
  color: $input-group-addon-color;
@@ -139,7 +138,7 @@
139
138
  .input-group-lg > .input-group-prepend > .btn,
140
139
  .input-group-lg > .input-group-append > .btn {
141
140
  padding: $input-padding-y-lg $input-padding-x-lg;
142
- font-size: $input-font-size-lg;
141
+ @include font-size($input-font-size-lg);
143
142
  line-height: $input-line-height-lg;
144
143
  @include border-radius($input-border-radius-lg);
145
144
  }
@@ -156,7 +155,7 @@
156
155
  .input-group-sm > .input-group-prepend > .btn,
157
156
  .input-group-sm > .input-group-append > .btn {
158
157
  padding: $input-padding-y-sm $input-padding-x-sm;
159
- font-size: $input-font-size-sm;
158
+ @include font-size($input-font-size-sm);
160
159
  line-height: $input-line-height-sm;
161
160
  @include border-radius($input-border-radius-sm);
162
161
  }
@@ -1,6 +1,7 @@
1
1
  .jumbotron {
2
2
  padding: $jumbotron-padding ($jumbotron-padding / 2);
3
3
  margin-bottom: $jumbotron-padding;
4
+ color: $jumbotron-color;
4
5
  background-color: $jumbotron-bg;
5
6
  @include border-radius($border-radius-lg);
6
7
 
@@ -9,6 +9,7 @@
9
9
  // No need to set list-style: none; since .list-group-item is block level
10
10
  padding-left: 0; // reset padding because ul and ol
11
11
  margin-bottom: 0;
12
+ @include border-radius($list-group-border-radius);
12
13
  }
13
14
 
14
15
 
@@ -23,7 +24,8 @@
23
24
  text-align: inherit; // For `<button>`s (anchors inherit)
24
25
 
25
26
  // Hover state
26
- @include hover-focus {
27
+ @include hover-focus() {
28
+ z-index: 1; // Place hover/focus items above their siblings for proper border styling
27
29
  color: $list-group-action-hover-color;
28
30
  text-decoration: none;
29
31
  background-color: $list-group-hover-bg;
@@ -44,23 +46,17 @@
44
46
  position: relative;
45
47
  display: block;
46
48
  padding: $list-group-item-padding-y $list-group-item-padding-x;
47
- // Place the border on the list items and negative margin up for better styling
48
- margin-bottom: -$list-group-border-width;
49
+ color: $list-group-color;
50
+ text-decoration: if($link-decoration == none, null, none);
49
51
  background-color: $list-group-bg;
50
52
  border: $list-group-border-width solid $list-group-border-color;
51
53
 
52
54
  &:first-child {
53
- @include border-top-radius($list-group-border-radius);
55
+ @include border-top-radius(inherit);
54
56
  }
55
57
 
56
58
  &:last-child {
57
- margin-bottom: 0;
58
- @include border-bottom-radius($list-group-border-radius);
59
- }
60
-
61
- @include hover-focus {
62
- z-index: 1; // Place hover/active items above their siblings for proper border styling
63
- text-decoration: none;
59
+ @include border-bottom-radius(inherit);
64
60
  }
65
61
 
66
62
  &.disabled,
@@ -77,6 +73,56 @@
77
73
  background-color: $list-group-active-bg;
78
74
  border-color: $list-group-active-border-color;
79
75
  }
76
+
77
+ & + & {
78
+ border-top-width: 0;
79
+
80
+ &.active {
81
+ margin-top: -$list-group-border-width;
82
+ border-top-width: $list-group-border-width;
83
+ }
84
+ }
85
+ }
86
+
87
+
88
+ // Horizontal
89
+ //
90
+ // Change the layout of list group items from vertical (default) to horizontal.
91
+
92
+ @each $breakpoint in map-keys($grid-breakpoints) {
93
+ @include media-breakpoint-up($breakpoint) {
94
+ $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
95
+
96
+ .list-group-horizontal#{$infix} {
97
+ flex-direction: row;
98
+
99
+ > .list-group-item {
100
+ &:first-child {
101
+ @include border-bottom-left-radius($list-group-border-radius);
102
+ @include border-top-right-radius(0);
103
+ }
104
+
105
+ &:last-child {
106
+ @include border-top-right-radius($list-group-border-radius);
107
+ @include border-bottom-left-radius(0);
108
+ }
109
+
110
+ &.active {
111
+ margin-top: 0;
112
+ }
113
+
114
+ & + .list-group-item {
115
+ border-top-width: $list-group-border-width;
116
+ border-left-width: 0;
117
+
118
+ &.active {
119
+ margin-left: -$list-group-border-width;
120
+ border-left-width: $list-group-border-width;
121
+ }
122
+ }
123
+ }
124
+ }
125
+ }
80
126
  }
81
127
 
82
128
 
@@ -86,26 +132,13 @@
86
132
  // useful within other components (e.g., cards).
87
133
 
88
134
  .list-group-flush {
89
- .list-group-item {
90
- border-right: 0;
91
- border-left: 0;
92
- @include border-radius(0);
135
+ @include border-radius(0);
93
136
 
94
- &:last-child {
95
- margin-bottom: -$list-group-border-width;
96
- }
97
- }
137
+ > .list-group-item {
138
+ border-width: 0 0 $list-group-border-width;
98
139
 
99
- &:first-child {
100
- .list-group-item:first-child {
101
- border-top: 0;
102
- }
103
- }
104
-
105
- &:last-child {
106
- .list-group-item:last-child {
107
- margin-bottom: 0;
108
- border-bottom: 0;
140
+ &:last-child {
141
+ border-bottom-width: 0;
109
142
  }
110
143
  }
111
144
  }
@@ -2,6 +2,12 @@
2
2
  //
3
3
  // Used in conjunction with global variables to enable certain theme features.
4
4
 
5
+ // Vendor
6
+ @import "vendor/rfs";
7
+
8
+ // Deprecate
9
+ @import "mixins/deprecate";
10
+
5
11
  // Utilities
6
12
  @import "mixins/breakpoints";
7
13
  @import "mixins/hover";
@@ -16,7 +22,7 @@
16
22
  @import "mixins/text-truncate";
17
23
  @import "mixins/visibility";
18
24
 
19
- // // Components
25
+ // Components
20
26
  @import "mixins/alert";
21
27
  @import "mixins/buttons";
22
28
  @import "mixins/caret";
@@ -27,14 +33,14 @@
27
33
  @import "mixins/forms";
28
34
  @import "mixins/table-row";
29
35
 
30
- // // Skins
36
+ // Skins
31
37
  @import "mixins/background-variant";
32
38
  @import "mixins/border-radius";
33
39
  @import "mixins/box-shadow";
34
40
  @import "mixins/gradients";
35
41
  @import "mixins/transition";
36
42
 
37
- // // Layout
43
+ // Layout
38
44
  @import "mixins/clearfix";
39
45
  @import "mixins/grid-framework";
40
46
  @import "mixins/grid";
@@ -48,19 +48,59 @@
48
48
  .modal.show & {
49
49
  transform: $modal-show-transform;
50
50
  }
51
+
52
+ // When trying to close, animate focus to scale
53
+ .modal.modal-static & {
54
+ transform: $modal-scale-transform;
55
+ }
56
+ }
57
+
58
+ .modal-dialog-scrollable {
59
+ display: flex; // IE10/11
60
+ max-height: subtract(100%, $modal-dialog-margin * 2);
61
+
62
+ .modal-content {
63
+ max-height: subtract(100vh, $modal-dialog-margin * 2); // IE10/11
64
+ overflow: hidden;
65
+ }
66
+
67
+ .modal-header,
68
+ .modal-footer {
69
+ flex-shrink: 0;
70
+ }
71
+
72
+ .modal-body {
73
+ overflow-y: auto;
74
+ }
51
75
  }
52
76
 
53
77
  .modal-dialog-centered {
54
78
  display: flex;
55
79
  align-items: center;
56
- min-height: calc(100% - (#{$modal-dialog-margin} * 2));
80
+ min-height: subtract(100%, $modal-dialog-margin * 2);
57
81
 
58
82
  // Ensure `modal-dialog-centered` extends the full height of the view (IE10/11)
59
83
  &::before {
60
84
  display: block; // IE10
61
- height: calc(100vh - (#{$modal-dialog-margin} * 2));
85
+ height: subtract(100vh, $modal-dialog-margin * 2);
86
+ height: min-content; // Reset height to 0 except on IE
62
87
  content: "";
63
88
  }
89
+
90
+ // Ensure `.modal-body` shows scrollbar (IE10/11)
91
+ &.modal-dialog-scrollable {
92
+ flex-direction: column;
93
+ justify-content: center;
94
+ height: 100%;
95
+
96
+ .modal-content {
97
+ max-height: none;
98
+ }
99
+
100
+ &::before {
101
+ content: none;
102
+ }
103
+ }
64
104
  }
65
105
 
66
106
  // Actual modal
@@ -70,6 +110,7 @@
70
110
  flex-direction: column;
71
111
  width: 100%; // Ensure `.modal-content` extends the full width of the parent `.modal-dialog`
72
112
  // counteract the pointer-events: none; in the .modal-dialog
113
+ color: $modal-content-color;
73
114
  pointer-events: auto;
74
115
  background-color: $modal-content-bg;
75
116
  background-clip: padding-box;
@@ -103,7 +144,7 @@
103
144
  justify-content: space-between; // Put modal header elements (title and dismiss) on opposite ends
104
145
  padding: $modal-header-padding;
105
146
  border-bottom: $modal-header-border-width solid $modal-header-border-color;
106
- @include border-top-radius($modal-content-border-radius);
147
+ @include border-top-radius($modal-content-inner-border-radius);
107
148
 
108
149
  .close {
109
150
  padding: $modal-header-padding;
@@ -123,7 +164,7 @@
123
164
  .modal-body {
124
165
  position: relative;
125
166
  // Enable `flex-grow: 1` so that the body take up as much space as possible
126
- // when should there be a fixed height on `.modal-dialog`.
167
+ // when there should be a fixed height on `.modal-dialog`.
127
168
  flex: 1 1 auto;
128
169
  padding: $modal-inner-padding;
129
170
  }
@@ -131,15 +172,19 @@
131
172
  // Footer (for actions)
132
173
  .modal-footer {
133
174
  display: flex;
175
+ flex-wrap: wrap;
134
176
  align-items: center; // vertically center
135
177
  justify-content: flex-end; // Right align buttons with flex property because text-align doesn't work on flex items
136
- padding: $modal-inner-padding;
178
+ padding: $modal-inner-padding - $modal-footer-margin-between / 2;
137
179
  border-top: $modal-footer-border-width solid $modal-footer-border-color;
138
- @include border-bottom-radius($modal-content-border-radius);
180
+ @include border-bottom-radius($modal-content-inner-border-radius);
139
181
 
140
- // Easily place margin between footer elements
141
- > :not(:first-child) { margin-left: .25rem; }
142
- > :not(:last-child) { margin-right: .25rem; }
182
+ // Place margin between footer elements
183
+ // This solution is far from ideal because of the universal selector usage,
184
+ // but is needed to fix https://github.com/twbs/bootstrap/issues/24800
185
+ > * {
186
+ margin: $modal-footer-margin-between / 2;
187
+ }
143
188
  }
144
189
 
145
190
  // Measure scrollbar width for padding body during modal show/hide
@@ -159,11 +204,20 @@
159
204
  margin: $modal-dialog-margin-y-sm-up auto;
160
205
  }
161
206
 
207
+ .modal-dialog-scrollable {
208
+ max-height: subtract(100%, $modal-dialog-margin-y-sm-up * 2);
209
+
210
+ .modal-content {
211
+ max-height: subtract(100vh, $modal-dialog-margin-y-sm-up * 2);
212
+ }
213
+ }
214
+
162
215
  .modal-dialog-centered {
163
- min-height: calc(100% - (#{$modal-dialog-margin-y-sm-up} * 2));
216
+ min-height: subtract(100%, $modal-dialog-margin-y-sm-up * 2);
164
217
 
165
218
  &::before {
166
- height: calc(100vh - (#{$modal-dialog-margin-y-sm-up} * 2));
219
+ height: subtract(100vh, $modal-dialog-margin-y-sm-up * 2);
220
+ height: min-content;
167
221
  }
168
222
  }
169
223