bootstrap 4.4.1 → 5.0.0.alpha2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +12 -2
  3. data/README.md +1 -1
  4. data/assets/javascripts/bootstrap-sprockets.js +12 -8
  5. data/assets/javascripts/bootstrap.js +2094 -1562
  6. data/assets/javascripts/bootstrap.min.js +4 -4
  7. data/assets/javascripts/bootstrap/alert.js +145 -83
  8. data/assets/javascripts/bootstrap/button.js +66 -152
  9. data/assets/javascripts/bootstrap/carousel.js +307 -241
  10. data/assets/javascripts/bootstrap/collapse.js +287 -183
  11. data/assets/javascripts/bootstrap/dom/data.js +81 -0
  12. data/assets/javascripts/bootstrap/dom/event-handler.js +315 -0
  13. data/assets/javascripts/bootstrap/dom/manipulator.js +96 -0
  14. data/assets/javascripts/bootstrap/dom/polyfill.js +110 -0
  15. data/assets/javascripts/bootstrap/dom/selector-engine.js +98 -0
  16. data/assets/javascripts/bootstrap/dropdown.js +255 -261
  17. data/assets/javascripts/bootstrap/modal.js +364 -270
  18. data/assets/javascripts/bootstrap/popover.js +72 -113
  19. data/assets/javascripts/bootstrap/scrollspy.js +162 -147
  20. data/assets/javascripts/bootstrap/tab.js +176 -108
  21. data/assets/javascripts/bootstrap/toast.js +179 -139
  22. data/assets/javascripts/bootstrap/tooltip.js +369 -259
  23. data/assets/stylesheets/_bootstrap-grid.scss +54 -18
  24. data/assets/stylesheets/_bootstrap-reboot.scss +7 -4
  25. data/assets/stylesheets/_bootstrap.scss +17 -11
  26. data/assets/stylesheets/bootstrap/_alert.scss +6 -7
  27. data/assets/stylesheets/bootstrap/_badge.scss +2 -27
  28. data/assets/stylesheets/bootstrap/_breadcrumb.scss +5 -17
  29. data/assets/stylesheets/bootstrap/_button-group.scss +16 -38
  30. data/assets/stylesheets/bootstrap/_buttons.scss +25 -40
  31. data/assets/stylesheets/bootstrap/_card.scss +43 -79
  32. data/assets/stylesheets/bootstrap/_carousel.scss +30 -15
  33. data/assets/stylesheets/bootstrap/_close.scss +31 -31
  34. data/assets/stylesheets/bootstrap/_containers.scss +41 -0
  35. data/assets/stylesheets/bootstrap/_dropdown.scss +54 -9
  36. data/assets/stylesheets/bootstrap/_forms.scss +9 -338
  37. data/assets/stylesheets/bootstrap/_functions.scss +97 -25
  38. data/assets/stylesheets/bootstrap/_grid.scss +3 -50
  39. data/assets/stylesheets/bootstrap/_helpers.scss +7 -0
  40. data/assets/stylesheets/bootstrap/_list-group.scss +16 -17
  41. data/assets/stylesheets/bootstrap/_mixins.scss +7 -13
  42. data/assets/stylesheets/bootstrap/_modal.scss +41 -45
  43. data/assets/stylesheets/bootstrap/_nav.scss +16 -9
  44. data/assets/stylesheets/bootstrap/_navbar.scss +43 -74
  45. data/assets/stylesheets/bootstrap/_pagination.scss +11 -20
  46. data/assets/stylesheets/bootstrap/_popover.scss +5 -5
  47. data/assets/stylesheets/bootstrap/_progress.scss +2 -3
  48. data/assets/stylesheets/bootstrap/_reboot.scss +310 -175
  49. data/assets/stylesheets/bootstrap/_root.scss +5 -9
  50. data/assets/stylesheets/bootstrap/_spinners.scss +5 -4
  51. data/assets/stylesheets/bootstrap/_tables.scss +80 -114
  52. data/assets/stylesheets/bootstrap/_toasts.scss +6 -2
  53. data/assets/stylesheets/bootstrap/_tooltip.scss +5 -5
  54. data/assets/stylesheets/bootstrap/_transitions.scss +0 -1
  55. data/assets/stylesheets/bootstrap/_type.scss +38 -59
  56. data/assets/stylesheets/bootstrap/_utilities.scss +531 -17
  57. data/assets/stylesheets/bootstrap/_variables.scss +609 -444
  58. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +18 -0
  59. data/assets/stylesheets/bootstrap/forms/_form-check.scss +142 -0
  60. data/assets/stylesheets/bootstrap/forms/_form-control.scss +116 -0
  61. data/assets/stylesheets/bootstrap/forms/_form-file.scss +91 -0
  62. data/assets/stylesheets/bootstrap/forms/_form-range.scss +136 -0
  63. data/assets/stylesheets/bootstrap/forms/_form-select.scss +82 -0
  64. data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
  65. data/assets/stylesheets/bootstrap/forms/_input-group.scss +140 -0
  66. data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
  67. data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
  68. data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
  69. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +12 -0
  70. data/assets/stylesheets/bootstrap/helpers/_position.scss +30 -0
  71. data/assets/stylesheets/bootstrap/helpers/_ratio.scss +26 -0
  72. data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
  73. data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
  74. data/assets/stylesheets/bootstrap/helpers/_visually-hidden.scss +8 -0
  75. data/assets/stylesheets/bootstrap/mixins/_alert.scss +0 -4
  76. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +35 -22
  77. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +7 -9
  78. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +14 -10
  79. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +69 -51
  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 +11 -0
  83. data/assets/stylesheets/bootstrap/mixins/_forms.scss +22 -66
  84. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +9 -11
  85. data/assets/stylesheets/bootstrap/mixins/_grid.scss +84 -33
  86. data/assets/stylesheets/bootstrap/mixins/_image.scss +1 -21
  87. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +2 -1
  88. data/assets/stylesheets/bootstrap/mixins/_lists.scss +1 -1
  89. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +15 -8
  90. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +2 -2
  91. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +21 -0
  92. data/assets/stylesheets/bootstrap/mixins/_transition.scss +18 -8
  93. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +49 -0
  94. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +28 -0
  95. data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
  96. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +234 -126
  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/gemfiles/rails_6_0.gemfile +7 -0
  101. metadata +36 -41
  102. data/assets/javascripts/bootstrap/util.js +0 -188
  103. data/assets/stylesheets/bootstrap/_code.scss +0 -48
  104. data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -521
  105. data/assets/stylesheets/bootstrap/_input-group.scss +0 -191
  106. data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
  107. data/assets/stylesheets/bootstrap/_media.scss +0 -8
  108. data/assets/stylesheets/bootstrap/_print.scss +0 -141
  109. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -22
  110. data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
  111. data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
  112. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -71
  113. data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
  114. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -11
  115. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +0 -34
  116. data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
  117. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
  118. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -17
  119. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
  120. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
  121. data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
  122. data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
  123. data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
  124. data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
  125. data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
  126. data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
  127. data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
  128. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
  129. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
  130. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
  131. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
  132. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
  133. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
  134. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
  135. data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
  136. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
@@ -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,108 +3,126 @@
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, darken($background, 7.5%), lighten($background, 7.5%)),
11
+ $hover-border: if($color == $color-contrast-light, darken($border, 10%), lighten($border, 5%)),
12
+ $hover-color: color-contrast($hover-background),
13
+ $active-background: if($color == $color-contrast-light, darken($background, 10%), lighten($background, 10%)),
14
+ $active-border: if($color == $color-contrast-light, darken($border, 12.5%), lighten($border, 5%)),
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
- // Avoid using mixin so we can pass custom focus shadow properly
24
36
  @if $enable-shadows {
25
- 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));
26
38
  } @else {
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;
39
+ // Avoid using mixin so we can pass custom focus shadow properly
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
- // Avoid using mixin so we can pass custom focus shadow properly
55
- @if $enable-shadows and $btn-active-box-shadow != none {
56
- 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));
57
58
  } @else {
58
- box-shadow: 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
59
+ // Avoid using mixin so we can pass custom focus shadow properly
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
- // Avoid using mixin so we can pass custom focus shadow properly
94
- @if $enable-shadows and $btn-active-box-shadow != none {
95
- box-shadow: $btn-active-box-shadow, 0 0 0 $btn-focus-width rgba($color, .5);
106
+ @if $enable-shadows {
107
+ @include box-shadow($btn-active-box-shadow, 0 0 0 $btn-focus-width rgba($color, .5));
96
108
  } @else {
109
+ // Avoid using mixin so we can pass custom focus shadow properly
97
110
  box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
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-right {
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-left {
23
23
  border-top: $caret-width solid transparent;
24
24
  border-right: $caret-width solid;
25
25
  border-bottom: $caret-width solid transparent;
@@ -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,11 @@
1
+ // Container mixins
2
+
3
+ @mixin make-container($gutter: $container-padding-x) {
4
+ --bs-gutter-x: #{$gutter};
5
+
6
+ width: 100%;
7
+ padding-right: calc(var(--bs-gutter-x) / 2); // stylelint-disable-line function-disallowed-list
8
+ padding-left: calc(var(--bs-gutter-x) / 2); // stylelint-disable-line function-disallowed-list
9
+ margin-right: auto;
10
+ margin-left: auto;
11
+ }
@@ -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
- // 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;
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) {
@@ -47,6 +19,7 @@
47
19
  width: 100%;
48
20
  margin-top: $form-feedback-margin-top;
49
21
  @include font-size($form-feedback-font-size);
22
+ font-style: $form-feedback-font-style;
50
23
  color: $color;
51
24
  }
52
25
 
@@ -60,7 +33,7 @@
60
33
  margin-top: .1rem;
61
34
  @include font-size($form-feedback-tooltip-font-size);
62
35
  line-height: $form-feedback-tooltip-line-height;
63
- color: color-yiq($color);
36
+ color: color-contrast($color);
64
37
  background-color: rgba($color, $form-feedback-tooltip-opacity);
65
38
  @include border-radius($form-feedback-tooltip-border-radius);
66
39
  }
@@ -86,7 +59,7 @@
86
59
 
87
60
  &:focus {
88
61
  border-color: $color;
89
- box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
62
+ box-shadow: 0 0 0 $input-focus-width rgba($color, $input-btn-focus-color-opacity);
90
63
  }
91
64
  }
92
65
  }
@@ -101,13 +74,15 @@
101
74
  }
102
75
  }
103
76
 
104
- .custom-select {
77
+ .form-select {
105
78
  @include form-validation-state-selector($state) {
106
79
  border-color: $color;
107
80
 
108
81
  @if $enable-validation-icons {
109
- padding-right: $custom-select-feedback-icon-padding-right;
110
- background: $custom-select-background, escape-svg($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;
111
86
  }
112
87
 
113
88
  &:focus {
@@ -119,55 +94,36 @@
119
94
 
120
95
  .form-check-input {
121
96
  @include form-validation-state-selector($state) {
122
- ~ .form-check-label {
123
- color: $color;
124
- }
125
-
126
- ~ .#{$state}-feedback,
127
- ~ .#{$state}-tooltip {
128
- display: block;
129
- }
130
- }
131
- }
132
-
133
- .custom-control-input {
134
- @include form-validation-state-selector($state) {
135
- ~ .custom-control-label {
136
- color: $color;
137
-
138
- &::before {
139
- border-color: $color;
140
- }
141
- }
97
+ border-color: $color;
142
98
 
143
99
  &:checked {
144
- ~ .custom-control-label::before {
145
- border-color: lighten($color, 10%);
146
- @include gradient-bg(lighten($color, 10%));
147
- }
100
+ background-color: $color;
148
101
  }
149
102
 
150
103
  &:focus {
151
- ~ .custom-control-label::before {
152
- box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
153
- }
104
+ box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
105
+ }
154
106
 
155
- &:not(:checked) ~ .custom-control-label::before {
156
- border-color: $color;
157
- }
107
+ ~ .form-check-label {
108
+ color: $color;
158
109
  }
159
110
  }
160
111
  }
112
+ .form-check-inline .form-check-input {
113
+ ~ .#{$state}-feedback {
114
+ margin-left: .5em;
115
+ }
116
+ }
161
117
 
162
118
  // custom file
163
- .custom-file-input {
119
+ .form-file-input {
164
120
  @include form-validation-state-selector($state) {
165
- ~ .custom-file-label {
121
+ ~ .form-file-label {
166
122
  border-color: $color;
167
123
  }
168
124
 
169
125
  &:focus {
170
- ~ .custom-file-label {
126
+ ~ .form-file-label {
171
127
  border-color: $color;
172
128
  box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
173
129
  }