bootstrap 4.3.0 → 5.0.0.alpha1

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 (139) 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 +5 -1
  6. data/assets/javascripts/bootstrap.js +2292 -1514
  7. data/assets/javascripts/bootstrap.min.js +4 -4
  8. data/assets/javascripts/bootstrap/alert.js +148 -85
  9. data/assets/javascripts/bootstrap/button.js +69 -110
  10. data/assets/javascripts/bootstrap/carousel.js +320 -239
  11. data/assets/javascripts/bootstrap/collapse.js +300 -177
  12. data/assets/javascripts/bootstrap/dom/data.js +81 -0
  13. data/assets/javascripts/bootstrap/dom/event-handler.js +311 -0
  14. data/assets/javascripts/bootstrap/dom/manipulator.js +100 -0
  15. data/assets/javascripts/bootstrap/dom/polyfill.js +110 -0
  16. data/assets/javascripts/bootstrap/dom/selector-engine.js +98 -0
  17. data/assets/javascripts/bootstrap/dropdown.js +282 -265
  18. data/assets/javascripts/bootstrap/modal.js +348 -231
  19. data/assets/javascripts/bootstrap/popover.js +80 -105
  20. data/assets/javascripts/bootstrap/scrollspy.js +173 -138
  21. data/assets/javascripts/bootstrap/tab.js +180 -115
  22. data/assets/javascripts/bootstrap/toast.js +188 -132
  23. data/assets/javascripts/bootstrap/tooltip.js +508 -230
  24. data/assets/stylesheets/_bootstrap-grid.scss +54 -18
  25. data/assets/stylesheets/_bootstrap-reboot.scss +7 -4
  26. data/assets/stylesheets/_bootstrap.scss +17 -11
  27. data/assets/stylesheets/bootstrap/_alert.scss +3 -3
  28. data/assets/stylesheets/bootstrap/_badge.scss +2 -27
  29. data/assets/stylesheets/bootstrap/_breadcrumb.scss +7 -18
  30. data/assets/stylesheets/bootstrap/_button-group.scss +16 -38
  31. data/assets/stylesheets/bootstrap/_buttons.scss +26 -39
  32. data/assets/stylesheets/bootstrap/_card.scss +48 -97
  33. data/assets/stylesheets/bootstrap/_carousel.scss +16 -18
  34. data/assets/stylesheets/bootstrap/_close.scss +9 -14
  35. data/assets/stylesheets/bootstrap/_containers.scss +41 -0
  36. data/assets/stylesheets/bootstrap/_dropdown.scss +13 -9
  37. data/assets/stylesheets/bootstrap/_forms.scss +9 -330
  38. data/assets/stylesheets/bootstrap/_functions.scss +141 -24
  39. data/assets/stylesheets/bootstrap/_grid.scss +4 -34
  40. data/assets/stylesheets/bootstrap/_helpers.scss +7 -0
  41. data/assets/stylesheets/bootstrap/_images.scss +2 -2
  42. data/assets/stylesheets/bootstrap/_list-group.scss +41 -33
  43. data/assets/stylesheets/bootstrap/_mixins.scss +9 -15
  44. data/assets/stylesheets/bootstrap/_modal.scss +54 -48
  45. data/assets/stylesheets/bootstrap/_nav.scss +12 -9
  46. data/assets/stylesheets/bootstrap/_navbar.scss +54 -56
  47. data/assets/stylesheets/bootstrap/_pagination.scss +10 -22
  48. data/assets/stylesheets/bootstrap/_popover.scss +13 -14
  49. data/assets/stylesheets/bootstrap/_progress.scss +6 -4
  50. data/assets/stylesheets/bootstrap/_reboot.scss +318 -185
  51. data/assets/stylesheets/bootstrap/_root.scss +5 -8
  52. data/assets/stylesheets/bootstrap/_spinners.scss +3 -2
  53. data/assets/stylesheets/bootstrap/_tables.scss +80 -114
  54. data/assets/stylesheets/bootstrap/_tooltip.scss +5 -5
  55. data/assets/stylesheets/bootstrap/_transitions.scss +0 -1
  56. data/assets/stylesheets/bootstrap/_type.scss +40 -61
  57. data/assets/stylesheets/bootstrap/_utilities.scss +503 -17
  58. data/assets/stylesheets/bootstrap/_variables.scss +567 -430
  59. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +18 -0
  60. data/assets/stylesheets/bootstrap/forms/_form-check.scss +142 -0
  61. data/assets/stylesheets/bootstrap/forms/_form-control.scss +116 -0
  62. data/assets/stylesheets/bootstrap/forms/_form-file.scss +91 -0
  63. data/assets/stylesheets/bootstrap/forms/_form-range.scss +136 -0
  64. data/assets/stylesheets/bootstrap/forms/_form-select.scss +82 -0
  65. data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
  66. data/assets/stylesheets/bootstrap/forms/_input-group.scss +140 -0
  67. data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
  68. data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
  69. data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
  70. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +12 -0
  71. data/assets/stylesheets/bootstrap/helpers/_embed.scss +31 -0
  72. data/assets/stylesheets/bootstrap/helpers/_position.scss +30 -0
  73. data/assets/stylesheets/bootstrap/helpers/_screenreaders.scss +8 -0
  74. data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
  75. data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
  76. data/assets/stylesheets/bootstrap/mixins/_alert.scss +0 -4
  77. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +26 -13
  78. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +11 -8
  79. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +68 -50
  80. data/assets/stylesheets/bootstrap/mixins/_caret.scss +4 -4
  81. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
  82. data/assets/stylesheets/bootstrap/mixins/_container.scss +9 -0
  83. data/assets/stylesheets/bootstrap/mixins/_forms.scss +47 -106
  84. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +9 -11
  85. data/assets/stylesheets/bootstrap/mixins/_grid.scss +99 -29
  86. data/assets/stylesheets/bootstrap/mixins/_image.scss +0 -20
  87. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +2 -1
  88. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +15 -8
  89. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +1 -1
  90. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +14 -19
  91. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +21 -0
  92. data/assets/stylesheets/bootstrap/mixins/_transition.scss +17 -7
  93. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +49 -0
  94. data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
  95. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +230 -130
  96. data/bootstrap.gemspec +1 -1
  97. data/lib/bootstrap/version.rb +2 -2
  98. data/tasks/updater/js.rb +3 -3
  99. data/tasks/updater/network.rb +2 -2
  100. data/test/dummy_rails/app/assets/config/manifest.js +3 -0
  101. data/test/dummy_rails/app/assets/stylesheets/.browserslistrc +1 -0
  102. data/test/gemfiles/rails_6_0.gemfile +7 -0
  103. data/test/support/dummy_rails_integration.rb +3 -1
  104. data/test/test_helper.rb +18 -13
  105. metadata +40 -42
  106. data/assets/javascripts/bootstrap/util.js +0 -171
  107. data/assets/stylesheets/bootstrap/_code.scss +0 -48
  108. data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -507
  109. data/assets/stylesheets/bootstrap/_input-group.scss +0 -193
  110. data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
  111. data/assets/stylesheets/bootstrap/_media.scss +0 -8
  112. data/assets/stylesheets/bootstrap/_print.scss +0 -141
  113. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -21
  114. data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
  115. data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
  116. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -66
  117. data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
  118. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -10
  119. data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
  120. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
  121. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -16
  122. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
  123. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
  124. data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
  125. data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
  126. data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
  127. data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
  128. data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
  129. data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
  130. data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
  131. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
  132. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
  133. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
  134. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
  135. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
  136. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
  137. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
  138. data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
  139. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
@@ -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.
@@ -105,7 +108,7 @@
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
110
  $min: breakpoint-min($name, $breakpoints);
108
- $max: breakpoint-max($name, $breakpoints);
111
+ $max: breakpoint-max(breakpoint-next($name, $breakpoints));
109
112
 
110
113
  @if $min != null and $max != null {
111
114
  @media (min-width: $min) and (max-width: $max) {
@@ -3,105 +3,123 @@
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: darken($background, 7.5%),
11
+ $hover-border: darken($border, 10%),
12
+ $hover-color: color-contrast($hover-background),
13
+ $active-background: darken($background, 10%),
14
+ $active-border: darken($border, 12.5%),
15
+ $active-color: color-contrast($active-background)
16
+ ) {
17
+ color: $color;
8
18
  @include gradient-bg($background);
9
19
  border-color: $border;
10
20
  @include box-shadow($btn-box-shadow);
11
21
 
12
- @include hover {
13
- color: color-yiq($hover-background);
22
+ &:hover {
23
+ color: $hover-color;
14
24
  @include gradient-bg($hover-background);
15
25
  border-color: $hover-border;
16
26
  }
17
27
 
18
- &:focus,
19
- &.focus {
20
- // Avoid using mixin so we can pass custom focus shadow properly
28
+ .btn-check:focus + &,
29
+ &:focus {
30
+ color: $hover-color;
31
+ @include gradient-bg($hover-background);
32
+ border-color: $hover-border;
21
33
  @if $enable-shadows {
22
- box-shadow: $btn-box-shadow, 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
34
+ @include box-shadow($btn-box-shadow, 0 0 0 $btn-focus-width rgba(mix($color, $border, 15%), .5));
23
35
  } @else {
24
- box-shadow: 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
25
- }
26
- }
27
-
28
- // Disabled comes first so active can properly restyle
29
- &.disabled,
30
- &:disabled {
31
- color: color-yiq($background);
32
- background-color: $background;
33
- border-color: $border;
34
- // Remove CSS gradients if they're enabled
35
- @if $enable-gradients {
36
- background-image: none;
36
+ // Avoid using mixin so we can pass custom focus shadow properly
37
+ box-shadow: 0 0 0 $btn-focus-width rgba(mix($color, $border, 15%), .5);
37
38
  }
38
39
  }
39
40
 
40
- &:not(:disabled):not(.disabled):active,
41
- &:not(:disabled):not(.disabled).active,
41
+ .btn-check:checked + &,
42
+ .btn-check:active + &,
43
+ &:active,
44
+ &.active,
42
45
  .show > &.dropdown-toggle {
43
- color: color-yiq($active-background);
46
+ color: $active-color;
44
47
  background-color: $active-background;
45
- @if $enable-gradients {
46
- background-image: none; // Remove the gradient for the pressed/active state
47
- }
48
+ // Remove CSS gradients if they're enabled
49
+ background-image: if($enable-gradients, none, null);
48
50
  border-color: $active-border;
49
51
 
50
52
  &:focus {
51
- // Avoid using mixin so we can pass custom focus shadow properly
52
- @if $enable-shadows and $btn-active-box-shadow != none {
53
- box-shadow: $btn-active-box-shadow, 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
53
+ @if $enable-shadows {
54
+ @include box-shadow($btn-active-box-shadow, 0 0 0 $btn-focus-width rgba(mix($color, $border, 15%), .5));
54
55
  } @else {
55
- box-shadow: 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
56
+ // Avoid using mixin so we can pass custom focus shadow properly
57
+ box-shadow: 0 0 0 $btn-focus-width rgba(mix($color, $border, 15%), .5);
56
58
  }
57
59
  }
58
60
  }
61
+
62
+ &:disabled,
63
+ &.disabled {
64
+ color: $color;
65
+ background-color: $background;
66
+ // Remove CSS gradients if they're enabled
67
+ background-image: if($enable-gradients, none, null);
68
+ border-color: $border;
69
+ }
59
70
  }
60
71
 
61
- @mixin button-outline-variant($color, $color-hover: color-yiq($color), $active-background: $color, $active-border: $color) {
72
+ @mixin button-outline-variant(
73
+ $color,
74
+ $color-hover: color-contrast($color),
75
+ $active-background: $color,
76
+ $active-border: $color,
77
+ $active-color: color-contrast($active-background)
78
+ ) {
62
79
  color: $color;
63
80
  border-color: $color;
64
81
 
65
- @include hover {
82
+ &:hover {
66
83
  color: $color-hover;
67
84
  background-color: $active-background;
68
85
  border-color: $active-border;
69
86
  }
70
87
 
71
- &:focus,
72
- &.focus {
88
+ .btn-check:focus + &,
89
+ &:focus {
73
90
  box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
74
91
  }
75
92
 
76
- &.disabled,
77
- &:disabled {
78
- color: $color;
79
- background-color: transparent;
80
- }
81
-
82
- &:not(:disabled):not(.disabled):active,
83
- &:not(:disabled):not(.disabled).active,
84
- .show > &.dropdown-toggle {
85
- color: color-yiq($active-background);
93
+ .btn-check:checked + &,
94
+ .btn-check:active + &,
95
+ &:active,
96
+ &.active,
97
+ &.dropdown-toggle.show {
98
+ color: $active-color;
86
99
  background-color: $active-background;
87
100
  border-color: $active-border;
88
101
 
89
102
  &:focus {
90
- // Avoid using mixin so we can pass custom focus shadow properly
91
- @if $enable-shadows and $btn-active-box-shadow != none {
92
- box-shadow: $btn-active-box-shadow, 0 0 0 $btn-focus-width rgba($color, .5);
103
+ @if $enable-shadows {
104
+ @include box-shadow($btn-active-box-shadow, 0 0 0 $btn-focus-width rgba($color, .5));
93
105
  } @else {
106
+ // Avoid using mixin so we can pass custom focus shadow properly
94
107
  box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
95
108
  }
96
109
  }
97
110
  }
111
+
112
+ &:disabled,
113
+ &.disabled {
114
+ color: $color;
115
+ background-color: transparent;
116
+ }
98
117
  }
99
118
 
100
119
  // Button sizes
101
- @mixin button-size($padding-y, $padding-x, $font-size, $line-height, $border-radius) {
120
+ @mixin button-size($padding-y, $padding-x, $font-size, $border-radius) {
102
121
  padding: $padding-y $padding-x;
103
122
  @include font-size($font-size);
104
- line-height: $line-height;
105
123
  // Manually declare to provide an override to the browser default
106
124
  @include border-radius($border-radius, 0);
107
125
  }
@@ -33,11 +33,11 @@
33
33
  vertical-align: $caret-vertical-align;
34
34
  content: "";
35
35
  @if $direction == down {
36
- @include caret-down;
36
+ @include caret-down();
37
37
  } @else if $direction == up {
38
- @include caret-up;
38
+ @include caret-up();
39
39
  } @else if $direction == right {
40
- @include caret-right;
40
+ @include caret-right();
41
41
  }
42
42
  }
43
43
 
@@ -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-left();
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($padding-x: $container-padding-x) {
4
+ width: 100%;
5
+ padding-right: $padding-x;
6
+ padding-left: $padding-x;
7
+ margin-right: auto;
8
+ margin-left: auto;
9
+ }
@@ -1,37 +1,25 @@
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() {
14
- &:focus {
15
- color: $input-focus-color;
16
- background-color: $input-focus-bg;
17
- border-color: $input-focus-border-color;
18
- outline: 0;
19
- // Avoid using mixin so we can pass custom focus shadow properly
20
- @if $enable-shadows {
21
- box-shadow: $input-box-shadow, $input-focus-box-shadow;
22
- } @else {
23
- box-shadow: $input-focus-box-shadow;
1
+ // This mixin uses an `if()` technique to be compatible with Dart Sass
2
+ // See https://github.com/sass/sass/issues/1873#issuecomment-152293725 for more details
3
+ @mixin form-validation-state-selector($state) {
4
+ @if ($state == "valid" or $state == "invalid") {
5
+ .was-validated #{if(&, "&", "")}:#{$state},
6
+ #{if(&, "&", "")}.is-#{$state} {
7
+ @content;
8
+ }
9
+ } @else {
10
+ #{if(&, "&", "")}.is-#{$state} {
11
+ @content;
24
12
  }
25
13
  }
26
14
  }
27
15
 
28
-
29
16
  @mixin form-validation-state($state, $color, $icon) {
30
17
  .#{$state}-feedback {
31
18
  display: none;
32
19
  width: 100%;
33
20
  margin-top: $form-feedback-margin-top;
34
21
  @include font-size($form-feedback-font-size);
22
+ font-style: $form-feedback-font-style;
35
23
  color: $color;
36
24
  }
37
25
 
@@ -45,40 +33,40 @@
45
33
  margin-top: .1rem;
46
34
  @include font-size($form-feedback-tooltip-font-size);
47
35
  line-height: $form-feedback-tooltip-line-height;
48
- color: color-yiq($color);
36
+ color: color-contrast($color);
49
37
  background-color: rgba($color, $form-feedback-tooltip-opacity);
50
38
  @include border-radius($form-feedback-tooltip-border-radius);
51
39
  }
52
40
 
41
+ @include form-validation-state-selector($state) {
42
+ ~ .#{$state}-feedback,
43
+ ~ .#{$state}-tooltip {
44
+ display: block;
45
+ }
46
+ }
47
+
53
48
  .form-control {
54
- .was-validated &:#{$state},
55
- &.is-#{$state} {
49
+ @include form-validation-state-selector($state) {
56
50
  border-color: $color;
57
51
 
58
52
  @if $enable-validation-icons {
59
53
  padding-right: $input-height-inner;
60
- background-image: $icon;
54
+ background-image: escape-svg($icon);
61
55
  background-repeat: no-repeat;
62
- background-position: center right $input-height-inner-quarter;
56
+ background-position: right $input-height-inner-quarter center;
63
57
  background-size: $input-height-inner-half $input-height-inner-half;
64
58
  }
65
59
 
66
60
  &:focus {
67
61
  border-color: $color;
68
- box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
69
- }
70
-
71
- ~ .#{$state}-feedback,
72
- ~ .#{$state}-tooltip {
73
- display: block;
62
+ box-shadow: 0 0 0 $input-focus-width rgba($color, $input-btn-focus-color-opacity);
74
63
  }
75
64
  }
76
65
  }
77
66
 
78
67
  // stylelint-disable-next-line selector-no-qualifying-type
79
68
  textarea.form-control {
80
- .was-validated &:#{$state},
81
- &.is-#{$state} {
69
+ @include form-validation-state-selector($state) {
82
70
  @if $enable-validation-icons {
83
71
  padding-right: $input-height-inner;
84
72
  background-position: top $input-height-inner-quarter right $input-height-inner-quarter;
@@ -86,103 +74,56 @@
86
74
  }
87
75
  }
88
76
 
89
- .custom-select {
90
- .was-validated &:#{$state},
91
- &.is-#{$state} {
77
+ .form-select {
78
+ @include form-validation-state-selector($state) {
92
79
  border-color: $color;
93
80
 
94
81
  @if $enable-validation-icons {
95
- padding-right: $custom-select-feedback-icon-padding-right;
96
- background: $custom-select-background, $icon $custom-select-bg no-repeat $custom-select-feedback-icon-position / $custom-select-feedback-icon-size;
82
+ padding-right: $form-select-feedback-icon-padding-right;
83
+ background-image: escape-svg($form-select-indicator), escape-svg($icon);
84
+ background-position: $form-select-bg-position, $form-select-feedback-icon-position;
85
+ background-size: $form-select-bg-size, $form-select-feedback-icon-size;
97
86
  }
98
87
 
99
88
  &:focus {
100
89
  border-color: $color;
101
90
  box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
102
91
  }
103
-
104
- ~ .#{$state}-feedback,
105
- ~ .#{$state}-tooltip {
106
- display: block;
107
- }
108
- }
109
- }
110
-
111
-
112
- .form-control-file {
113
- .was-validated &:#{$state},
114
- &.is-#{$state} {
115
- ~ .#{$state}-feedback,
116
- ~ .#{$state}-tooltip {
117
- display: block;
118
- }
119
92
  }
120
93
  }
121
94
 
122
95
  .form-check-input {
123
- .was-validated &:#{$state},
124
- &.is-#{$state} {
125
- ~ .form-check-label {
126
- color: $color;
127
- }
128
-
129
- ~ .#{$state}-feedback,
130
- ~ .#{$state}-tooltip {
131
- display: block;
132
- }
133
- }
134
- }
135
-
136
- .custom-control-input {
137
- .was-validated &:#{$state},
138
- &.is-#{$state} {
139
- ~ .custom-control-label {
140
- color: $color;
141
-
142
- &::before {
143
- border-color: $color;
144
- }
145
- }
146
-
147
- ~ .#{$state}-feedback,
148
- ~ .#{$state}-tooltip {
149
- display: block;
150
- }
96
+ @include form-validation-state-selector($state) {
97
+ border-color: $color;
151
98
 
152
99
  &:checked {
153
- ~ .custom-control-label::before {
154
- border-color: lighten($color, 10%);
155
- @include gradient-bg(lighten($color, 10%));
156
- }
100
+ background-color: $color;
157
101
  }
158
102
 
159
103
  &:focus {
160
- ~ .custom-control-label::before {
161
- box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
162
- }
104
+ box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
105
+ }
163
106
 
164
- &:not(:checked) ~ .custom-control-label::before {
165
- border-color: $color;
166
- }
107
+ ~ .form-check-label {
108
+ color: $color;
167
109
  }
168
110
  }
169
111
  }
112
+ .form-check-inline .form-check-input {
113
+ ~ .#{$state}-feedback {
114
+ margin-left: .5em;
115
+ }
116
+ }
170
117
 
171
118
  // custom file
172
- .custom-file-input {
173
- .was-validated &:#{$state},
174
- &.is-#{$state} {
175
- ~ .custom-file-label {
119
+ .form-file-input {
120
+ @include form-validation-state-selector($state) {
121
+ ~ .form-file-label {
176
122
  border-color: $color;
177
123
  }
178
124
 
179
- ~ .#{$state}-feedback,
180
- ~ .#{$state}-tooltip {
181
- display: block;
182
- }
183
-
184
125
  &:focus {
185
- ~ .custom-file-label {
126
+ ~ .form-file-label {
186
127
  border-color: $color;
187
128
  box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
188
129
  }