bootstrap 4.6.0 → 5.0.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -1
  3. data/README.md +7 -4
  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 +14 -8
  7. data/assets/javascripts/bootstrap.js +2152 -1633
  8. data/assets/javascripts/bootstrap.min.js +2 -2
  9. data/assets/javascripts/bootstrap/alert.js +179 -64
  10. data/assets/javascripts/bootstrap/base-component.js +75 -0
  11. data/assets/javascripts/bootstrap/button.js +94 -143
  12. data/assets/javascripts/bootstrap/carousel.js +386 -202
  13. data/assets/javascripts/bootstrap/collapse.js +349 -132
  14. data/assets/javascripts/bootstrap/dom/data.js +81 -0
  15. data/assets/javascripts/bootstrap/dom/event-handler.js +310 -0
  16. data/assets/javascripts/bootstrap/dom/manipulator.js +86 -0
  17. data/assets/javascripts/bootstrap/dom/selector-engine.js +93 -0
  18. data/assets/javascripts/bootstrap/dropdown.js +387 -224
  19. data/assets/javascripts/bootstrap/modal.js +391 -220
  20. data/assets/javascripts/bootstrap/popover.js +94 -49
  21. data/assets/javascripts/bootstrap/scrollspy.js +212 -80
  22. data/assets/javascripts/bootstrap/tab.js +198 -79
  23. data/assets/javascripts/bootstrap/toast.js +211 -78
  24. data/assets/javascripts/bootstrap/tooltip.js +558 -300
  25. data/assets/stylesheets/_bootstrap-grid.scss +51 -16
  26. data/assets/stylesheets/_bootstrap-reboot.scss +4 -1
  27. data/assets/stylesheets/_bootstrap.scss +15 -8
  28. data/assets/stylesheets/bootstrap/_accordion.scss +126 -0
  29. data/assets/stylesheets/bootstrap/_alert.scss +15 -10
  30. data/assets/stylesheets/bootstrap/_badge.scss +2 -27
  31. data/assets/stylesheets/bootstrap/_breadcrumb.scss +3 -17
  32. data/assets/stylesheets/bootstrap/_button-group.scss +21 -45
  33. data/assets/stylesheets/bootstrap/_buttons.scss +27 -60
  34. data/assets/stylesheets/bootstrap/_card.scss +21 -92
  35. data/assets/stylesheets/bootstrap/_carousel.scss +65 -33
  36. data/assets/stylesheets/bootstrap/_close.scss +30 -30
  37. data/assets/stylesheets/bootstrap/_containers.scss +41 -0
  38. data/assets/stylesheets/bootstrap/_dropdown.scss +95 -38
  39. data/assets/stylesheets/bootstrap/_forms.scss +9 -347
  40. data/assets/stylesheets/bootstrap/_functions.scss +84 -23
  41. data/assets/stylesheets/bootstrap/_grid.scss +3 -54
  42. data/assets/stylesheets/bootstrap/_helpers.scss +7 -0
  43. data/assets/stylesheets/bootstrap/_list-group.scss +17 -8
  44. data/assets/stylesheets/bootstrap/_mixins.scss +7 -13
  45. data/assets/stylesheets/bootstrap/_modal.scss +41 -46
  46. data/assets/stylesheets/bootstrap/_nav.scss +16 -4
  47. data/assets/stylesheets/bootstrap/_navbar.scss +43 -71
  48. data/assets/stylesheets/bootstrap/_pagination.scss +10 -20
  49. data/assets/stylesheets/bootstrap/_popover.scss +15 -27
  50. data/assets/stylesheets/bootstrap/_progress.scss +2 -4
  51. data/assets/stylesheets/bootstrap/_reboot.scss +314 -163
  52. data/assets/stylesheets/bootstrap/_root.scss +5 -8
  53. data/assets/stylesheets/bootstrap/_spinners.scss +5 -5
  54. data/assets/stylesheets/bootstrap/_tables.scss +79 -114
  55. data/assets/stylesheets/bootstrap/_toasts.scss +20 -15
  56. data/assets/stylesheets/bootstrap/_tooltip.scss +17 -17
  57. data/assets/stylesheets/bootstrap/_transitions.scss +0 -1
  58. data/assets/stylesheets/bootstrap/_type.scss +38 -59
  59. data/assets/stylesheets/bootstrap/_utilities.scss +566 -18
  60. data/assets/stylesheets/bootstrap/_variables.scss +673 -463
  61. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +18 -0
  62. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +61 -0
  63. data/assets/stylesheets/bootstrap/forms/_form-check.scss +152 -0
  64. data/assets/stylesheets/bootstrap/forms/_form-control.scss +223 -0
  65. data/assets/stylesheets/bootstrap/forms/_form-range.scss +91 -0
  66. data/assets/stylesheets/bootstrap/forms/_form-select.scss +67 -0
  67. data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
  68. data/assets/stylesheets/bootstrap/forms/_input-group.scss +121 -0
  69. data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
  70. data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
  71. data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
  72. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +12 -0
  73. data/assets/stylesheets/bootstrap/helpers/_position.scss +30 -0
  74. data/assets/stylesheets/bootstrap/helpers/_ratio.scss +26 -0
  75. data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
  76. data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
  77. data/assets/stylesheets/bootstrap/helpers/_visually-hidden.scss +8 -0
  78. data/assets/stylesheets/bootstrap/mixins/_alert.scss +1 -5
  79. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +8 -8
  80. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +7 -9
  81. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +14 -10
  82. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +65 -47
  83. data/assets/stylesheets/bootstrap/mixins/_caret.scss +8 -8
  84. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
  85. data/assets/stylesheets/bootstrap/mixins/_container.scss +9 -0
  86. data/assets/stylesheets/bootstrap/mixins/_forms.scss +27 -88
  87. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +13 -11
  88. data/assets/stylesheets/bootstrap/mixins/_grid.scss +83 -32
  89. data/assets/stylesheets/bootstrap/mixins/_image.scss +1 -21
  90. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +3 -2
  91. data/assets/stylesheets/bootstrap/mixins/_lists.scss +1 -1
  92. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +15 -8
  93. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +2 -2
  94. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +21 -0
  95. data/assets/stylesheets/bootstrap/mixins/_transition.scss +1 -1
  96. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +68 -0
  97. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +29 -0
  98. data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
  99. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +234 -126
  100. data/bootstrap.gemspec +1 -3
  101. data/lib/bootstrap/version.rb +2 -2
  102. data/tasks/updater/js.rb +20 -5
  103. data/test/dummy_rails/app/assets/javascripts/application.js +4 -3
  104. data/test/dummy_rails/app/views/layouts/application.html.erb +3 -1
  105. data/test/dummy_rails/app/views/pages/root.html +89 -0
  106. data/test/dummy_rails/config/application.rb +0 -3
  107. data/test/gemfiles/rails_6_1.gemfile +7 -0
  108. metadata +44 -75
  109. data/assets/javascripts/bootstrap/util.js +0 -192
  110. data/assets/stylesheets/bootstrap/_code.scss +0 -48
  111. data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -526
  112. data/assets/stylesheets/bootstrap/_input-group.scss +0 -208
  113. data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
  114. data/assets/stylesheets/bootstrap/_media.scss +0 -8
  115. data/assets/stylesheets/bootstrap/_print.scss +0 -141
  116. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -23
  117. data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
  118. data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
  119. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -80
  120. data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
  121. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -11
  122. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +0 -34
  123. data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
  124. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
  125. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -17
  126. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
  127. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
  128. data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
  129. data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
  130. data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
  131. data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
  132. data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
  133. data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
  134. data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
  135. data/assets/stylesheets/bootstrap/utilities/_interactions.scss +0 -5
  136. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
  137. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
  138. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
  139. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
  140. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
  141. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
  142. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
  143. data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
  144. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
  145. data/test/dummy_rails/app/views/pages/root.html.slim +0 -58
@@ -0,0 +1,8 @@
1
+ //
2
+ // Visually hidden
3
+ //
4
+
5
+ .visually-hidden,
6
+ .visually-hidden-focusable:not(:focus):not(:focus-within) {
7
+ @include visually-hidden();
8
+ }
@@ -3,11 +3,7 @@
3
3
  @include gradient-bg($background);
4
4
  border-color: $border;
5
5
 
6
- hr {
7
- border-top-color: darken($border, 5%);
8
- }
9
-
10
6
  .alert-link {
11
- color: darken($color, 10%);
7
+ color: shade-color($color, 20%);
12
8
  }
13
9
  }
@@ -23,53 +23,53 @@
23
23
  }
24
24
  }
25
25
 
26
- @mixin border-top-radius($radius) {
26
+ @mixin border-top-radius($radius: $border-radius) {
27
27
  @if $enable-rounded {
28
28
  border-top-left-radius: valid-radius($radius);
29
29
  border-top-right-radius: valid-radius($radius);
30
30
  }
31
31
  }
32
32
 
33
- @mixin border-right-radius($radius) {
33
+ @mixin border-end-radius($radius: $border-radius) {
34
34
  @if $enable-rounded {
35
35
  border-top-right-radius: valid-radius($radius);
36
36
  border-bottom-right-radius: valid-radius($radius);
37
37
  }
38
38
  }
39
39
 
40
- @mixin border-bottom-radius($radius) {
40
+ @mixin border-bottom-radius($radius: $border-radius) {
41
41
  @if $enable-rounded {
42
42
  border-bottom-right-radius: valid-radius($radius);
43
43
  border-bottom-left-radius: valid-radius($radius);
44
44
  }
45
45
  }
46
46
 
47
- @mixin border-left-radius($radius) {
47
+ @mixin border-start-radius($radius: $border-radius) {
48
48
  @if $enable-rounded {
49
49
  border-top-left-radius: valid-radius($radius);
50
50
  border-bottom-left-radius: valid-radius($radius);
51
51
  }
52
52
  }
53
53
 
54
- @mixin border-top-left-radius($radius) {
54
+ @mixin border-top-start-radius($radius: $border-radius) {
55
55
  @if $enable-rounded {
56
56
  border-top-left-radius: valid-radius($radius);
57
57
  }
58
58
  }
59
59
 
60
- @mixin border-top-right-radius($radius) {
60
+ @mixin border-top-end-radius($radius: $border-radius) {
61
61
  @if $enable-rounded {
62
62
  border-top-right-radius: valid-radius($radius);
63
63
  }
64
64
  }
65
65
 
66
- @mixin border-bottom-right-radius($radius) {
66
+ @mixin border-bottom-end-radius($radius: $border-radius) {
67
67
  @if $enable-rounded {
68
68
  border-bottom-right-radius: valid-radius($radius);
69
69
  }
70
70
  }
71
71
 
72
- @mixin border-bottom-left-radius($radius) {
72
+ @mixin border-bottom-start-radius($radius: $border-radius) {
73
73
  @if $enable-rounded {
74
74
  border-bottom-left-radius: valid-radius($radius);
75
75
  }
@@ -2,17 +2,15 @@
2
2
  @if $enable-shadows {
3
3
  $result: ();
4
4
 
5
- @if (length($shadow) == 1) {
6
- // We can pass `@include box-shadow(none);`
7
- $result: $shadow;
8
- } @else {
9
- // Filter to avoid invalid properties for example `box-shadow: none, 1px 1px black;`
10
- @for $i from 1 through length($shadow) {
11
- @if nth($shadow, $i) != "none" {
12
- $result: append($result, nth($shadow, $i), "comma");
13
- }
5
+ @each $value in $shadow {
6
+ @if $value != null {
7
+ $result: append($result, $value, "comma");
8
+ }
9
+ @if $value == none and length($shadow) > 1 {
10
+ @warn "The keyword 'none' must be used as a single argument.";
14
11
  }
15
12
  }
13
+
16
14
  @if (length($result) > 0) {
17
15
  box-shadow: $result;
18
16
  }
@@ -16,7 +16,10 @@
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 != null and $n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null);
19
+ @if not $n {
20
+ @error "breakpoint `#{$name}` not found in `#{$breakpoints}`";
21
+ }
22
+ @return if($n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null);
20
23
  }
21
24
 
22
25
  // Minimum breakpoint width. Null for the smallest (first) breakpoint.
@@ -28,18 +31,18 @@
28
31
  @return if($min != 0, $min, null);
29
32
  }
30
33
 
31
- // Maximum breakpoint width. Null for the largest (last) breakpoint.
32
- // The maximum value is calculated as the minimum of the next one less 0.02px
33
- // to work around the limitations of `min-` and `max-` prefixes and viewports with fractional widths.
34
+ // Maximum breakpoint width.
35
+ // The maximum value is reduced by 0.02px to work around the limitations of
36
+ // `min-` and `max-` prefixes and viewports with fractional widths.
34
37
  // See https://www.w3.org/TR/mediaqueries-4/#mq-min-max
35
38
  // Uses 0.02px rather than 0.01px to work around a current rounding bug in Safari.
36
39
  // See https://bugs.webkit.org/show_bug.cgi?id=178261
37
40
  //
38
- // >> breakpoint-max(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
41
+ // >> breakpoint-max(md, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
39
42
  // 767.98px
40
43
  @function breakpoint-max($name, $breakpoints: $grid-breakpoints) {
41
- $next: breakpoint-next($name, $breakpoints);
42
- @return if($next, breakpoint-min($next, $breakpoints) - .02, null);
44
+ $max: map-get($breakpoints, $name);
45
+ @return if($max and $max > 0, $max - .02, null);
43
46
  }
44
47
 
45
48
  // Returns a blank string if smallest breakpoint, otherwise returns the name with a dash in front.
@@ -104,8 +107,9 @@
104
107
  // No minimum for the smallest breakpoint, and no maximum for the largest one.
105
108
  // Makes the @content apply only to the given breakpoint, not viewports any wider or narrower.
106
109
  @mixin media-breakpoint-only($name, $breakpoints: $grid-breakpoints) {
107
- $min: breakpoint-min($name, $breakpoints);
108
- $max: breakpoint-max($name, $breakpoints);
110
+ $min: breakpoint-min($name, $breakpoints);
111
+ $next: breakpoint-next($name, $breakpoints);
112
+ $max: breakpoint-max($next);
109
113
 
110
114
  @if $min != null and $max != null {
111
115
  @media (min-width: $min) and (max-width: $max) {
@@ -116,7 +120,7 @@
116
120
  @content;
117
121
  }
118
122
  } @else if $min == null {
119
- @include media-breakpoint-down($name, $breakpoints) {
123
+ @include media-breakpoint-down($next, $breakpoints) {
120
124
  @content;
121
125
  }
122
126
  }
@@ -3,94 +3,107 @@
3
3
  // Easily pump out default styles, as well as :hover, :focus, :active,
4
4
  // and disabled options for all buttons
5
5
 
6
- @mixin button-variant($background, $border, $hover-background: darken($background, 7.5%), $hover-border: darken($border, 10%), $active-background: darken($background, 10%), $active-border: darken($border, 12.5%)) {
7
- color: color-yiq($background);
6
+ @mixin button-variant(
7
+ $background,
8
+ $border,
9
+ $color: color-contrast($background),
10
+ $hover-background: if($color == $color-contrast-light, shade-color($background, $btn-hover-bg-shade-amount), tint-color($background, $btn-hover-bg-tint-amount)),
11
+ $hover-border: if($color == $color-contrast-light, shade-color($border, $btn-hover-border-shade-amount), tint-color($border, $btn-hover-border-tint-amount)),
12
+ $hover-color: color-contrast($hover-background),
13
+ $active-background: if($color == $color-contrast-light, shade-color($background,$btn-active-bg-shade-amount), tint-color($background, $btn-active-bg-tint-amount)),
14
+ $active-border: if($color == $color-contrast-light, shade-color($border, $btn-active-border-shade-amount), tint-color($border, $btn-active-border-tint-amount)),
15
+ $active-color: color-contrast($active-background),
16
+ $disabled-background: $background,
17
+ $disabled-border: $border,
18
+ $disabled-color: color-contrast($disabled-background)
19
+ ) {
20
+ color: $color;
8
21
  @include gradient-bg($background);
9
22
  border-color: $border;
10
23
  @include box-shadow($btn-box-shadow);
11
24
 
12
- @include hover() {
13
- color: color-yiq($hover-background);
25
+ &:hover {
26
+ color: $hover-color;
14
27
  @include gradient-bg($hover-background);
15
28
  border-color: $hover-border;
16
29
  }
17
30
 
18
- &:focus,
19
- &.focus {
20
- color: color-yiq($hover-background);
31
+ .btn-check:focus + &,
32
+ &:focus {
33
+ color: $hover-color;
21
34
  @include gradient-bg($hover-background);
22
35
  border-color: $hover-border;
23
36
  @if $enable-shadows {
24
- @include box-shadow($btn-box-shadow, 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5));
37
+ @include box-shadow($btn-box-shadow, 0 0 0 $btn-focus-width rgba(mix($color, $border, 15%), .5));
25
38
  } @else {
26
39
  // Avoid using mixin so we can pass custom focus shadow properly
27
- box-shadow: 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
28
- }
29
- }
30
-
31
- // Disabled comes first so active can properly restyle
32
- &.disabled,
33
- &:disabled {
34
- color: color-yiq($background);
35
- background-color: $background;
36
- border-color: $border;
37
- // Remove CSS gradients if they're enabled
38
- @if $enable-gradients {
39
- background-image: none;
40
+ box-shadow: 0 0 0 $btn-focus-width rgba(mix($color, $border, 15%), .5);
40
41
  }
41
42
  }
42
43
 
43
- &:not(:disabled):not(.disabled):active,
44
- &:not(:disabled):not(.disabled).active,
44
+ .btn-check:checked + &,
45
+ .btn-check:active + &,
46
+ &:active,
47
+ &.active,
45
48
  .show > &.dropdown-toggle {
46
- color: color-yiq($active-background);
49
+ color: $active-color;
47
50
  background-color: $active-background;
48
- @if $enable-gradients {
49
- background-image: none; // Remove the gradient for the pressed/active state
50
- }
51
+ // Remove CSS gradients if they're enabled
52
+ background-image: if($enable-gradients, none, null);
51
53
  border-color: $active-border;
52
54
 
53
55
  &:focus {
54
- @if $enable-shadows and $btn-active-box-shadow != none {
55
- @include box-shadow($btn-active-box-shadow, 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5));
56
+ @if $enable-shadows {
57
+ @include box-shadow($btn-active-box-shadow, 0 0 0 $btn-focus-width rgba(mix($color, $border, 15%), .5));
56
58
  } @else {
57
59
  // Avoid using mixin so we can pass custom focus shadow properly
58
- box-shadow: 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
60
+ box-shadow: 0 0 0 $btn-focus-width rgba(mix($color, $border, 15%), .5);
59
61
  }
60
62
  }
61
63
  }
64
+
65
+ &:disabled,
66
+ &.disabled {
67
+ color: $disabled-color;
68
+ background-color: $disabled-background;
69
+ // Remove CSS gradients if they're enabled
70
+ background-image: if($enable-gradients, none, null);
71
+ border-color: $disabled-border;
72
+ }
62
73
  }
63
74
 
64
- @mixin button-outline-variant($color, $color-hover: color-yiq($color), $active-background: $color, $active-border: $color) {
75
+ @mixin button-outline-variant(
76
+ $color,
77
+ $color-hover: color-contrast($color),
78
+ $active-background: $color,
79
+ $active-border: $color,
80
+ $active-color: color-contrast($active-background)
81
+ ) {
65
82
  color: $color;
66
83
  border-color: $color;
67
84
 
68
- @include hover() {
85
+ &:hover {
69
86
  color: $color-hover;
70
87
  background-color: $active-background;
71
88
  border-color: $active-border;
72
89
  }
73
90
 
74
- &:focus,
75
- &.focus {
91
+ .btn-check:focus + &,
92
+ &:focus {
76
93
  box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
77
94
  }
78
95
 
79
- &.disabled,
80
- &:disabled {
81
- color: $color;
82
- background-color: transparent;
83
- }
84
-
85
- &:not(:disabled):not(.disabled):active,
86
- &:not(:disabled):not(.disabled).active,
87
- .show > &.dropdown-toggle {
88
- color: color-yiq($active-background);
96
+ .btn-check:checked + &,
97
+ .btn-check:active + &,
98
+ &:active,
99
+ &.active,
100
+ &.dropdown-toggle.show {
101
+ color: $active-color;
89
102
  background-color: $active-background;
90
103
  border-color: $active-border;
91
104
 
92
105
  &:focus {
93
- @if $enable-shadows and $btn-active-box-shadow != none {
106
+ @if $enable-shadows {
94
107
  @include box-shadow($btn-active-box-shadow, 0 0 0 $btn-focus-width rgba($color, .5));
95
108
  } @else {
96
109
  // Avoid using mixin so we can pass custom focus shadow properly
@@ -98,13 +111,18 @@
98
111
  }
99
112
  }
100
113
  }
114
+
115
+ &:disabled,
116
+ &.disabled {
117
+ color: $color;
118
+ background-color: transparent;
119
+ }
101
120
  }
102
121
 
103
122
  // Button sizes
104
- @mixin button-size($padding-y, $padding-x, $font-size, $line-height, $border-radius) {
123
+ @mixin button-size($padding-y, $padding-x, $font-size, $border-radius) {
105
124
  padding: $padding-y $padding-x;
106
125
  @include font-size($font-size);
107
- line-height: $line-height;
108
126
  // Manually declare to provide an override to the browser default
109
127
  @include border-radius($border-radius, 0);
110
128
  }
@@ -1,25 +1,25 @@
1
- @mixin caret-down() {
1
+ @mixin caret-down {
2
2
  border-top: $caret-width solid;
3
3
  border-right: $caret-width solid transparent;
4
4
  border-bottom: 0;
5
5
  border-left: $caret-width solid transparent;
6
6
  }
7
7
 
8
- @mixin caret-up() {
8
+ @mixin caret-up {
9
9
  border-top: 0;
10
10
  border-right: $caret-width solid transparent;
11
11
  border-bottom: $caret-width solid;
12
12
  border-left: $caret-width solid transparent;
13
13
  }
14
14
 
15
- @mixin caret-right() {
15
+ @mixin caret-end {
16
16
  border-top: $caret-width solid transparent;
17
17
  border-right: 0;
18
18
  border-bottom: $caret-width solid transparent;
19
19
  border-left: $caret-width solid;
20
20
  }
21
21
 
22
- @mixin caret-left() {
22
+ @mixin caret-start {
23
23
  border-top: $caret-width solid transparent;
24
24
  border-right: $caret-width solid;
25
25
  border-bottom: $caret-width solid transparent;
@@ -36,12 +36,12 @@
36
36
  @include caret-down();
37
37
  } @else if $direction == up {
38
38
  @include caret-up();
39
- } @else if $direction == right {
40
- @include caret-right();
39
+ } @else if $direction == end {
40
+ @include caret-end();
41
41
  }
42
42
  }
43
43
 
44
- @if $direction == left {
44
+ @if $direction == start {
45
45
  &::after {
46
46
  display: none;
47
47
  }
@@ -51,7 +51,7 @@
51
51
  margin-right: $caret-spacing;
52
52
  vertical-align: $caret-vertical-align;
53
53
  content: "";
54
- @include caret-left();
54
+ @include caret-start();
55
55
  }
56
56
  }
57
57
 
@@ -1,3 +1,4 @@
1
+ // scss-docs-start clearfix
1
2
  @mixin clearfix() {
2
3
  &::after {
3
4
  display: block;
@@ -5,3 +6,4 @@
5
6
  content: "";
6
7
  }
7
8
  }
9
+ // scss-docs-end clearfix
@@ -0,0 +1,9 @@
1
+ // Container mixins
2
+
3
+ @mixin make-container($gutter: $container-padding-x) {
4
+ width: 100%;
5
+ padding-right: var(--#{$variable-prefix}gutter-x, #{$gutter});
6
+ padding-left: var(--#{$variable-prefix}gutter-x, #{$gutter});
7
+ margin-right: auto;
8
+ margin-left: auto;
9
+ }
@@ -1,31 +1,3 @@
1
- // Form control focus state
2
- //
3
- // Generate a customized focus state and for any input with the specified color,
4
- // which defaults to the `$input-focus-border-color` variable.
5
- //
6
- // We highly encourage you to not customize the default value, but instead use
7
- // this to tweak colors on an as-needed basis. This aesthetic change is based on
8
- // WebKit's default styles, but applicable to a wider range of browsers. Its
9
- // usability and accessibility should be taken into account with any change.
10
- //
11
- // Example usage: change the default blue border and shadow to white for better
12
- // contrast against a dark gray background.
13
- @mixin form-control-focus($ignore-warning: false) {
14
- &:focus {
15
- color: $input-focus-color;
16
- background-color: $input-focus-bg;
17
- border-color: $input-focus-border-color;
18
- outline: 0;
19
- @if $enable-shadows {
20
- @include box-shadow($input-box-shadow, $input-focus-box-shadow);
21
- } @else {
22
- // Avoid using mixin so we can pass custom focus shadow properly
23
- box-shadow: $input-focus-box-shadow;
24
- }
25
- }
26
- @include deprecate("The `form-control-focus()` mixin", "v4.4.0", "v5", $ignore-warning);
27
- }
28
-
29
1
  // This mixin uses an `if()` technique to be compatible with Dart Sass
30
2
  // See https://github.com/sass/sass/issues/1873#issuecomment-152293725 for more details
31
3
  @mixin form-validation-state-selector($state) {
@@ -41,19 +13,26 @@
41
13
  }
42
14
  }
43
15
 
44
- @mixin form-validation-state($state, $color, $icon) {
16
+ @mixin form-validation-state(
17
+ $state,
18
+ $color,
19
+ $icon,
20
+ $tooltip-color: color-contrast($color),
21
+ $tooltip-bg-color: rgba($color, $form-feedback-tooltip-opacity),
22
+ $focus-box-shadow: 0 0 0 $input-focus-width rgba($color, $input-btn-focus-color-opacity)
23
+ ) {
45
24
  .#{$state}-feedback {
46
25
  display: none;
47
26
  width: 100%;
48
27
  margin-top: $form-feedback-margin-top;
49
28
  @include font-size($form-feedback-font-size);
29
+ font-style: $form-feedback-font-style;
50
30
  color: $color;
51
31
  }
52
32
 
53
33
  .#{$state}-tooltip {
54
34
  position: absolute;
55
35
  top: 100%;
56
- left: 0;
57
36
  z-index: 5;
58
37
  display: none;
59
38
  max-width: 100%; // Contain to parent when possible
@@ -61,16 +40,9 @@
61
40
  margin-top: .1rem;
62
41
  @include font-size($form-feedback-tooltip-font-size);
63
42
  line-height: $form-feedback-tooltip-line-height;
64
- color: color-yiq($color);
65
- background-color: rgba($color, $form-feedback-tooltip-opacity);
43
+ color: $tooltip-color;
44
+ background-color: $tooltip-bg-color;
66
45
  @include border-radius($form-feedback-tooltip-border-radius);
67
-
68
- // See https://github.com/twbs/bootstrap/pull/31557
69
- // Align tooltip to form elements
70
- .form-row > .col > &,
71
- .form-row > [class*="col-"] > & {
72
- left: $form-grid-gutter-width / 2;
73
- }
74
46
  }
75
47
 
76
48
  @include form-validation-state-selector($state) {
@@ -94,7 +66,7 @@
94
66
 
95
67
  &:focus {
96
68
  border-color: $color;
97
- box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
69
+ box-shadow: $focus-box-shadow;
98
70
  }
99
71
  }
100
72
  }
@@ -109,77 +81,44 @@
109
81
  }
110
82
  }
111
83
 
112
- .custom-select {
84
+ .form-select {
113
85
  @include form-validation-state-selector($state) {
114
86
  border-color: $color;
115
87
 
116
88
  @if $enable-validation-icons {
117
- padding-right: $custom-select-feedback-icon-padding-right;
118
- background: $custom-select-background, $custom-select-bg escape-svg($icon) $custom-select-feedback-icon-position / $custom-select-feedback-icon-size no-repeat;
89
+ padding-right: $form-select-feedback-icon-padding-end;
90
+ background-image: escape-svg($form-select-indicator), escape-svg($icon);
91
+ background-position: $form-select-bg-position, $form-select-feedback-icon-position;
92
+ background-size: $form-select-bg-size, $form-select-feedback-icon-size;
119
93
  }
120
94
 
121
95
  &:focus {
122
96
  border-color: $color;
123
- box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
97
+ box-shadow: $focus-box-shadow;
124
98
  }
125
99
  }
126
100
  }
127
101
 
128
102
  .form-check-input {
129
103
  @include form-validation-state-selector($state) {
130
- ~ .form-check-label {
131
- color: $color;
132
- }
133
-
134
- ~ .#{$state}-feedback,
135
- ~ .#{$state}-tooltip {
136
- display: block;
137
- }
138
- }
139
- }
140
-
141
- .custom-control-input {
142
- @include form-validation-state-selector($state) {
143
- ~ .custom-control-label {
144
- color: $color;
145
-
146
- &::before {
147
- border-color: $color;
148
- }
149
- }
104
+ border-color: $color;
150
105
 
151
106
  &:checked {
152
- ~ .custom-control-label::before {
153
- border-color: lighten($color, 10%);
154
- @include gradient-bg(lighten($color, 10%));
155
- }
107
+ background-color: $color;
156
108
  }
157
109
 
158
110
  &:focus {
159
- ~ .custom-control-label::before {
160
- box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
161
- }
111
+ box-shadow: $focus-box-shadow;
112
+ }
162
113
 
163
- &:not(:checked) ~ .custom-control-label::before {
164
- border-color: $color;
165
- }
114
+ ~ .form-check-label {
115
+ color: $color;
166
116
  }
167
117
  }
168
118
  }
169
-
170
- // custom file
171
- .custom-file-input {
172
- @include form-validation-state-selector($state) {
173
- ~ .custom-file-label {
174
- border-color: $color;
175
- }
176
-
177
- &:focus {
178
- ~ .custom-file-label {
179
- border-color: $color;
180
- box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
181
- }
182
- }
119
+ .form-check-inline .form-check-input {
120
+ ~ .#{$state}-feedback {
121
+ margin-left: .5em;
183
122
  }
184
123
  }
185
124
  }