bootstrap 4.3.1 → 5.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +55 -0
  3. data/CHANGELOG.md +2 -14
  4. data/README.md +28 -5
  5. data/assets/javascripts/bootstrap/alert.js +54 -163
  6. data/assets/javascripts/bootstrap/base-component.js +83 -0
  7. data/assets/javascripts/bootstrap/button.js +44 -152
  8. data/assets/javascripts/bootstrap/carousel.js +289 -569
  9. data/assets/javascripts/bootstrap/collapse.js +170 -349
  10. data/assets/javascripts/bootstrap/dom/data.js +62 -0
  11. data/assets/javascripts/bootstrap/dom/event-handler.js +236 -0
  12. data/assets/javascripts/bootstrap/dom/manipulator.js +71 -0
  13. data/assets/javascripts/bootstrap/dom/selector-engine.js +103 -0
  14. data/assets/javascripts/bootstrap/dropdown.js +303 -496
  15. data/assets/javascripts/bootstrap/modal.js +229 -559
  16. data/assets/javascripts/bootstrap/offcanvas.js +245 -0
  17. data/assets/javascripts/bootstrap/popover.js +61 -226
  18. data/assets/javascripts/bootstrap/scrollspy.js +217 -317
  19. data/assets/javascripts/bootstrap/tab.js +220 -212
  20. data/assets/javascripts/bootstrap/toast.js +145 -229
  21. data/assets/javascripts/bootstrap/tooltip.js +421 -782
  22. data/assets/javascripts/bootstrap/util/backdrop.js +139 -0
  23. data/assets/javascripts/bootstrap/util/component-functions.js +41 -0
  24. data/assets/javascripts/bootstrap/util/config.js +67 -0
  25. data/assets/javascripts/bootstrap/util/focustrap.js +113 -0
  26. data/assets/javascripts/bootstrap/util/index.js +281 -0
  27. data/assets/javascripts/bootstrap/util/sanitizer.js +110 -0
  28. data/assets/javascripts/bootstrap/util/scrollbar.js +112 -0
  29. data/assets/javascripts/bootstrap/util/swipe.js +134 -0
  30. data/assets/javascripts/bootstrap/util/template-factory.js +150 -0
  31. data/assets/javascripts/bootstrap-global-this-define.js +6 -0
  32. data/assets/javascripts/bootstrap-global-this-undefine.js +2 -0
  33. data/assets/javascripts/bootstrap-sprockets.js +23 -7
  34. data/assets/javascripts/bootstrap.js +3690 -3639
  35. data/assets/javascripts/bootstrap.min.js +4 -4
  36. data/assets/stylesheets/_bootstrap-grid.scss +53 -20
  37. data/assets/stylesheets/_bootstrap-reboot.scss +5 -7
  38. data/assets/stylesheets/_bootstrap.scss +21 -13
  39. data/assets/stylesheets/bootstrap/_accordion.scss +158 -0
  40. data/assets/stylesheets/bootstrap/_alert.scss +32 -15
  41. data/assets/stylesheets/bootstrap/_badge.scss +15 -31
  42. data/assets/stylesheets/bootstrap/_breadcrumb.scss +23 -24
  43. data/assets/stylesheets/bootstrap/_button-group.scss +27 -48
  44. data/assets/stylesheets/bootstrap/_buttons.scss +139 -69
  45. data/assets/stylesheets/bootstrap/_card.scss +91 -141
  46. data/assets/stylesheets/bootstrap/_carousel.scss +86 -39
  47. data/assets/stylesheets/bootstrap/_close.scss +51 -29
  48. data/assets/stylesheets/bootstrap/_containers.scss +41 -0
  49. data/assets/stylesheets/bootstrap/_dropdown.scss +131 -72
  50. data/assets/stylesheets/bootstrap/_forms.scss +9 -330
  51. data/assets/stylesheets/bootstrap/_functions.scss +244 -28
  52. data/assets/stylesheets/bootstrap/_grid.scss +18 -31
  53. data/assets/stylesheets/bootstrap/_helpers.scss +12 -0
  54. data/assets/stylesheets/bootstrap/_images.scss +3 -3
  55. data/assets/stylesheets/bootstrap/_list-group.scss +101 -53
  56. data/assets/stylesheets/bootstrap/_maps.scss +174 -0
  57. data/assets/stylesheets/bootstrap/_mixins.scss +13 -18
  58. data/assets/stylesheets/bootstrap/_modal.scss +120 -112
  59. data/assets/stylesheets/bootstrap/_nav.scss +113 -24
  60. data/assets/stylesheets/bootstrap/_navbar.scss +145 -150
  61. data/assets/stylesheets/bootstrap/_offcanvas.scss +146 -0
  62. data/assets/stylesheets/bootstrap/_pagination.scss +74 -38
  63. data/assets/stylesheets/bootstrap/_placeholders.scss +51 -0
  64. data/assets/stylesheets/bootstrap/_popover.scss +99 -74
  65. data/assets/stylesheets/bootstrap/_progress.scss +40 -15
  66. data/assets/stylesheets/bootstrap/_reboot.scss +342 -215
  67. data/assets/stylesheets/bootstrap/_root.scss +174 -9
  68. data/assets/stylesheets/bootstrap/_spinners.scss +52 -22
  69. data/assets/stylesheets/bootstrap/_tables.scss +101 -115
  70. data/assets/stylesheets/bootstrap/_toasts.scss +54 -25
  71. data/assets/stylesheets/bootstrap/_tooltip.scss +67 -63
  72. data/assets/stylesheets/bootstrap/_transitions.scss +8 -1
  73. data/assets/stylesheets/bootstrap/_type.scss +42 -61
  74. data/assets/stylesheets/bootstrap/_utilities.scss +806 -17
  75. data/assets/stylesheets/bootstrap/_variables-dark.scss +85 -0
  76. data/assets/stylesheets/bootstrap/_variables.scss +1235 -615
  77. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +19 -0
  78. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +94 -0
  79. data/assets/stylesheets/bootstrap/forms/_form-check.scss +188 -0
  80. data/assets/stylesheets/bootstrap/forms/_form-control.scss +214 -0
  81. data/assets/stylesheets/bootstrap/forms/_form-range.scss +91 -0
  82. data/assets/stylesheets/bootstrap/forms/_form-select.scss +80 -0
  83. data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
  84. data/assets/stylesheets/bootstrap/forms/_input-group.scss +132 -0
  85. data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
  86. data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
  87. data/assets/stylesheets/bootstrap/helpers/_color-bg.scss +8 -0
  88. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +30 -0
  89. data/assets/stylesheets/bootstrap/helpers/_focus-ring.scss +5 -0
  90. data/assets/stylesheets/bootstrap/helpers/_icon-link.scss +25 -0
  91. data/assets/stylesheets/bootstrap/helpers/_position.scss +36 -0
  92. data/assets/stylesheets/bootstrap/helpers/_ratio.scss +26 -0
  93. data/assets/stylesheets/bootstrap/helpers/_stacks.scss +15 -0
  94. data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
  95. data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
  96. data/assets/stylesheets/bootstrap/helpers/_visually-hidden.scss +8 -0
  97. data/assets/stylesheets/bootstrap/helpers/_vr.scss +8 -0
  98. data/assets/stylesheets/bootstrap/mixins/_alert.scss +11 -6
  99. data/assets/stylesheets/bootstrap/mixins/_backdrop.scss +14 -0
  100. data/assets/stylesheets/bootstrap/mixins/_banner.scss +7 -0
  101. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +37 -22
  102. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +7 -9
  103. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +20 -16
  104. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +60 -97
  105. data/assets/stylesheets/bootstrap/mixins/_caret.scss +34 -27
  106. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
  107. data/assets/stylesheets/bootstrap/mixins/_color-mode.scss +21 -0
  108. data/assets/stylesheets/bootstrap/mixins/_color-scheme.scss +7 -0
  109. data/assets/stylesheets/bootstrap/mixins/_container.scss +11 -0
  110. data/assets/stylesheets/bootstrap/mixins/_forms.scss +77 -116
  111. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +13 -11
  112. data/assets/stylesheets/bootstrap/mixins/_grid.scss +133 -33
  113. data/assets/stylesheets/bootstrap/mixins/_image.scss +0 -20
  114. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +7 -2
  115. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +7 -19
  116. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +2 -2
  117. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +24 -0
  118. data/assets/stylesheets/bootstrap/mixins/_transition.scss +18 -8
  119. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +97 -0
  120. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +33 -0
  121. data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
  122. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +276 -132
  123. data/bootstrap.gemspec +4 -6
  124. data/lib/bootstrap/version.rb +2 -2
  125. data/tasks/updater/js.rb +31 -7
  126. data/tasks/updater/network.rb +10 -4
  127. data/tasks/updater/scss.rb +1 -1
  128. data/tasks/updater.rb +2 -2
  129. data/test/dummy_rails/app/assets/config/manifest.js +3 -0
  130. data/test/dummy_rails/app/assets/javascripts/application.js +4 -3
  131. data/test/dummy_rails/app/assets/stylesheets/.browserslistrc +1 -0
  132. data/test/dummy_rails/app/views/layouts/application.html.erb +3 -1
  133. data/test/dummy_rails/app/views/pages/root.html +89 -0
  134. data/test/dummy_rails/config/application.rb +0 -3
  135. data/test/gemfiles/rails_5_2.gemfile +8 -0
  136. data/test/gemfiles/rails_6_0.gemfile +7 -0
  137. data/test/gemfiles/rails_6_1.gemfile +7 -0
  138. data/test/gemfiles/rails_7_0.gemfile +7 -0
  139. data/test/support/dummy_rails_integration.rb +3 -1
  140. data/test/test_helper.rb +18 -12
  141. metadata +86 -84
  142. data/.travis.yml +0 -17
  143. data/assets/javascripts/bootstrap/util.js +0 -171
  144. data/assets/stylesheets/bootstrap/_code.scss +0 -48
  145. data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -507
  146. data/assets/stylesheets/bootstrap/_input-group.scss +0 -193
  147. data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
  148. data/assets/stylesheets/bootstrap/_media.scss +0 -8
  149. data/assets/stylesheets/bootstrap/_print.scss +0 -141
  150. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -21
  151. data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
  152. data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
  153. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -66
  154. data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
  155. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -10
  156. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +0 -33
  157. data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
  158. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
  159. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -16
  160. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
  161. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
  162. data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
  163. data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
  164. data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
  165. data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
  166. data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
  167. data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
  168. data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
  169. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
  170. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
  171. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
  172. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
  173. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
  174. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
  175. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
  176. data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
  177. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
  178. data/test/dummy_rails/app/views/pages/root.html.slim +0 -58
  179. /data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
@@ -3,105 +3,68 @@
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);
8
- @include gradient-bg($background);
9
- border-color: $border;
10
- @include box-shadow($btn-box-shadow);
11
-
12
- @include hover {
13
- color: color-yiq($hover-background);
14
- @include gradient-bg($hover-background);
15
- border-color: $hover-border;
16
- }
17
-
18
- &:focus,
19
- &.focus {
20
- // Avoid using mixin so we can pass custom focus shadow properly
21
- @if $enable-shadows {
22
- box-shadow: $btn-box-shadow, 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
23
- } @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;
37
- }
38
- }
39
-
40
- &:not(:disabled):not(.disabled):active,
41
- &:not(:disabled):not(.disabled).active,
42
- .show > &.dropdown-toggle {
43
- color: color-yiq($active-background);
44
- background-color: $active-background;
45
- @if $enable-gradients {
46
- background-image: none; // Remove the gradient for the pressed/active state
47
- }
48
- border-color: $active-border;
49
-
50
- &: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);
54
- } @else {
55
- box-shadow: 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
56
- }
57
- }
58
- }
6
+ // scss-docs-start btn-variant-mixin
7
+ @mixin button-variant(
8
+ $background,
9
+ $border,
10
+ $color: color-contrast($background),
11
+ $hover-background: if($color == $color-contrast-light, shade-color($background, $btn-hover-bg-shade-amount), tint-color($background, $btn-hover-bg-tint-amount)),
12
+ $hover-border: if($color == $color-contrast-light, shade-color($border, $btn-hover-border-shade-amount), tint-color($border, $btn-hover-border-tint-amount)),
13
+ $hover-color: color-contrast($hover-background),
14
+ $active-background: if($color == $color-contrast-light, shade-color($background, $btn-active-bg-shade-amount), tint-color($background, $btn-active-bg-tint-amount)),
15
+ $active-border: if($color == $color-contrast-light, shade-color($border, $btn-active-border-shade-amount), tint-color($border, $btn-active-border-tint-amount)),
16
+ $active-color: color-contrast($active-background),
17
+ $disabled-background: $background,
18
+ $disabled-border: $border,
19
+ $disabled-color: color-contrast($disabled-background)
20
+ ) {
21
+ --#{$prefix}btn-color: #{$color};
22
+ --#{$prefix}btn-bg: #{$background};
23
+ --#{$prefix}btn-border-color: #{$border};
24
+ --#{$prefix}btn-hover-color: #{$hover-color};
25
+ --#{$prefix}btn-hover-bg: #{$hover-background};
26
+ --#{$prefix}btn-hover-border-color: #{$hover-border};
27
+ --#{$prefix}btn-focus-shadow-rgb: #{to-rgb(mix($color, $border, 15%))};
28
+ --#{$prefix}btn-active-color: #{$active-color};
29
+ --#{$prefix}btn-active-bg: #{$active-background};
30
+ --#{$prefix}btn-active-border-color: #{$active-border};
31
+ --#{$prefix}btn-active-shadow: #{$btn-active-box-shadow};
32
+ --#{$prefix}btn-disabled-color: #{$disabled-color};
33
+ --#{$prefix}btn-disabled-bg: #{$disabled-background};
34
+ --#{$prefix}btn-disabled-border-color: #{$disabled-border};
59
35
  }
36
+ // scss-docs-end btn-variant-mixin
60
37
 
61
- @mixin button-outline-variant($color, $color-hover: color-yiq($color), $active-background: $color, $active-border: $color) {
62
- color: $color;
63
- border-color: $color;
64
-
65
- @include hover {
66
- color: $color-hover;
67
- background-color: $active-background;
68
- border-color: $active-border;
69
- }
70
-
71
- &:focus,
72
- &.focus {
73
- box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
74
- }
75
-
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);
86
- background-color: $active-background;
87
- border-color: $active-border;
88
-
89
- &: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);
93
- } @else {
94
- box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
95
- }
96
- }
97
- }
38
+ // scss-docs-start btn-outline-variant-mixin
39
+ @mixin button-outline-variant(
40
+ $color,
41
+ $color-hover: color-contrast($color),
42
+ $active-background: $color,
43
+ $active-border: $color,
44
+ $active-color: color-contrast($active-background)
45
+ ) {
46
+ --#{$prefix}btn-color: #{$color};
47
+ --#{$prefix}btn-border-color: #{$color};
48
+ --#{$prefix}btn-hover-color: #{$color-hover};
49
+ --#{$prefix}btn-hover-bg: #{$active-background};
50
+ --#{$prefix}btn-hover-border-color: #{$active-border};
51
+ --#{$prefix}btn-focus-shadow-rgb: #{to-rgb($color)};
52
+ --#{$prefix}btn-active-color: #{$active-color};
53
+ --#{$prefix}btn-active-bg: #{$active-background};
54
+ --#{$prefix}btn-active-border-color: #{$active-border};
55
+ --#{$prefix}btn-active-shadow: #{$btn-active-box-shadow};
56
+ --#{$prefix}btn-disabled-color: #{$color};
57
+ --#{$prefix}btn-disabled-bg: transparent;
58
+ --#{$prefix}btn-disabled-border-color: #{$color};
59
+ --#{$prefix}gradient: none;
98
60
  }
61
+ // scss-docs-end btn-outline-variant-mixin
99
62
 
100
- // Button sizes
101
- @mixin button-size($padding-y, $padding-x, $font-size, $line-height, $border-radius) {
102
- padding: $padding-y $padding-x;
103
- @include font-size($font-size);
104
- line-height: $line-height;
105
- // Manually declare to provide an override to the browser default
106
- @include border-radius($border-radius, 0);
63
+ // scss-docs-start btn-size-mixin
64
+ @mixin button-size($padding-y, $padding-x, $font-size, $border-radius) {
65
+ --#{$prefix}btn-padding-y: #{$padding-y};
66
+ --#{$prefix}btn-padding-x: #{$padding-x};
67
+ @include rfs($font-size, --#{$prefix}btn-font-size);
68
+ --#{$prefix}btn-border-radius: #{$border-radius};
107
69
  }
70
+ // scss-docs-end btn-size-mixin
@@ -1,57 +1,63 @@
1
- @mixin caret-down {
2
- border-top: $caret-width solid;
3
- border-right: $caret-width solid transparent;
1
+ // scss-docs-start caret-mixins
2
+ @mixin caret-down($width: $caret-width) {
3
+ border-top: $width solid;
4
+ border-right: $width solid transparent;
4
5
  border-bottom: 0;
5
- border-left: $caret-width solid transparent;
6
+ border-left: $width solid transparent;
6
7
  }
7
8
 
8
- @mixin caret-up {
9
+ @mixin caret-up($width: $caret-width) {
9
10
  border-top: 0;
10
- border-right: $caret-width solid transparent;
11
- border-bottom: $caret-width solid;
12
- border-left: $caret-width solid transparent;
11
+ border-right: $width solid transparent;
12
+ border-bottom: $width solid;
13
+ border-left: $width solid transparent;
13
14
  }
14
15
 
15
- @mixin caret-right {
16
- border-top: $caret-width solid transparent;
16
+ @mixin caret-end($width: $caret-width) {
17
+ border-top: $width solid transparent;
17
18
  border-right: 0;
18
- border-bottom: $caret-width solid transparent;
19
- border-left: $caret-width solid;
19
+ border-bottom: $width solid transparent;
20
+ border-left: $width solid;
20
21
  }
21
22
 
22
- @mixin caret-left {
23
- border-top: $caret-width solid transparent;
24
- border-right: $caret-width solid;
25
- border-bottom: $caret-width solid transparent;
23
+ @mixin caret-start($width: $caret-width) {
24
+ border-top: $width solid transparent;
25
+ border-right: $width solid;
26
+ border-bottom: $width solid transparent;
26
27
  }
27
28
 
28
- @mixin caret($direction: down) {
29
+ @mixin caret(
30
+ $direction: down,
31
+ $width: $caret-width,
32
+ $spacing: $caret-spacing,
33
+ $vertical-align: $caret-vertical-align
34
+ ) {
29
35
  @if $enable-caret {
30
36
  &::after {
31
37
  display: inline-block;
32
- margin-left: $caret-spacing;
33
- vertical-align: $caret-vertical-align;
38
+ margin-left: $spacing;
39
+ vertical-align: $vertical-align;
34
40
  content: "";
35
41
  @if $direction == down {
36
- @include caret-down;
42
+ @include caret-down($width);
37
43
  } @else if $direction == up {
38
- @include caret-up;
39
- } @else if $direction == right {
40
- @include caret-right;
44
+ @include caret-up($width);
45
+ } @else if $direction == end {
46
+ @include caret-end($width);
41
47
  }
42
48
  }
43
49
 
44
- @if $direction == left {
50
+ @if $direction == start {
45
51
  &::after {
46
52
  display: none;
47
53
  }
48
54
 
49
55
  &::before {
50
56
  display: inline-block;
51
- margin-right: $caret-spacing;
52
- vertical-align: $caret-vertical-align;
57
+ margin-right: $spacing;
58
+ vertical-align: $vertical-align;
53
59
  content: "";
54
- @include caret-left;
60
+ @include caret-start($width);
55
61
  }
56
62
  }
57
63
 
@@ -60,3 +66,4 @@
60
66
  }
61
67
  }
62
68
  }
69
+ // scss-docs-end caret-mixins
@@ -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,21 @@
1
+ // scss-docs-start color-mode-mixin
2
+ @mixin color-mode($mode: light, $root: false) {
3
+ @if $color-mode-type == "media-query" {
4
+ @if $root == true {
5
+ @media (prefers-color-scheme: $mode) {
6
+ :root {
7
+ @content;
8
+ }
9
+ }
10
+ } @else {
11
+ @media (prefers-color-scheme: $mode) {
12
+ @content;
13
+ }
14
+ }
15
+ } @else {
16
+ [data-bs-theme="#{$mode}"] {
17
+ @content;
18
+ }
19
+ }
20
+ }
21
+ // scss-docs-end color-mode-mixin
@@ -0,0 +1,7 @@
1
+ // scss-docs-start mixin-color-scheme
2
+ @mixin color-scheme($name) {
3
+ @media (prefers-color-scheme: #{$name}) {
4
+ @content;
5
+ }
6
+ }
7
+ // scss-docs-end mixin-color-scheme
@@ -0,0 +1,11 @@
1
+ // Container mixins
2
+
3
+ @mixin make-container($gutter: $container-padding-x) {
4
+ --#{$prefix}gutter-x: #{$gutter};
5
+ --#{$prefix}gutter-y: 0;
6
+ width: 100%;
7
+ padding-right: calc(var(--#{$prefix}gutter-x) * .5); // stylelint-disable-line function-disallowed-list
8
+ padding-left: calc(var(--#{$prefix}gutter-x) * .5); // stylelint-disable-line function-disallowed-list
9
+ margin-right: auto;
10
+ margin-left: auto;
11
+ }
@@ -1,37 +1,35 @@
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
+
4
+ // scss-docs-start form-validation-mixins
5
+ @mixin form-validation-state-selector($state) {
6
+ @if ($state == "valid" or $state == "invalid") {
7
+ .was-validated #{if(&, "&", "")}:#{$state},
8
+ #{if(&, "&", "")}.is-#{$state} {
9
+ @content;
10
+ }
11
+ } @else {
12
+ #{if(&, "&", "")}.is-#{$state} {
13
+ @content;
24
14
  }
25
15
  }
26
16
  }
27
17
 
28
-
29
- @mixin form-validation-state($state, $color, $icon) {
18
+ @mixin form-validation-state(
19
+ $state,
20
+ $color,
21
+ $icon,
22
+ $tooltip-color: color-contrast($color),
23
+ $tooltip-bg-color: rgba($color, $form-feedback-tooltip-opacity),
24
+ $focus-box-shadow: 0 0 $input-btn-focus-blur $input-focus-width rgba($color, $input-btn-focus-color-opacity),
25
+ $border-color: $color
26
+ ) {
30
27
  .#{$state}-feedback {
31
28
  display: none;
32
29
  width: 100%;
33
30
  margin-top: $form-feedback-margin-top;
34
31
  @include font-size($form-feedback-font-size);
32
+ font-style: $form-feedback-font-style;
35
33
  color: $color;
36
34
  }
37
35
 
@@ -45,40 +43,40 @@
45
43
  margin-top: .1rem;
46
44
  @include font-size($form-feedback-tooltip-font-size);
47
45
  line-height: $form-feedback-tooltip-line-height;
48
- color: color-yiq($color);
49
- background-color: rgba($color, $form-feedback-tooltip-opacity);
46
+ color: $tooltip-color;
47
+ background-color: $tooltip-bg-color;
50
48
  @include border-radius($form-feedback-tooltip-border-radius);
51
49
  }
52
50
 
51
+ @include form-validation-state-selector($state) {
52
+ ~ .#{$state}-feedback,
53
+ ~ .#{$state}-tooltip {
54
+ display: block;
55
+ }
56
+ }
57
+
53
58
  .form-control {
54
- .was-validated &:#{$state},
55
- &.is-#{$state} {
56
- border-color: $color;
59
+ @include form-validation-state-selector($state) {
60
+ border-color: $border-color;
57
61
 
58
62
  @if $enable-validation-icons {
59
63
  padding-right: $input-height-inner;
60
- background-image: $icon;
64
+ background-image: escape-svg($icon);
61
65
  background-repeat: no-repeat;
62
- background-position: center right $input-height-inner-quarter;
66
+ background-position: right $input-height-inner-quarter center;
63
67
  background-size: $input-height-inner-half $input-height-inner-half;
64
68
  }
65
69
 
66
70
  &:focus {
67
- 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;
71
+ border-color: $border-color;
72
+ box-shadow: $focus-box-shadow;
74
73
  }
75
74
  }
76
75
  }
77
76
 
78
77
  // stylelint-disable-next-line selector-no-qualifying-type
79
78
  textarea.form-control {
80
- .was-validated &:#{$state},
81
- &.is-#{$state} {
79
+ @include form-validation-state-selector($state) {
82
80
  @if $enable-validation-icons {
83
81
  padding-right: $input-height-inner;
84
82
  background-position: top $input-height-inner-quarter right $input-height-inner-quarter;
@@ -86,107 +84,70 @@
86
84
  }
87
85
  }
88
86
 
89
- .custom-select {
90
- .was-validated &:#{$state},
91
- &.is-#{$state} {
92
- border-color: $color;
87
+ .form-select {
88
+ @include form-validation-state-selector($state) {
89
+ border-color: $border-color;
93
90
 
94
91
  @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;
92
+ &:not([multiple]):not([size]),
93
+ &:not([multiple])[size="1"] {
94
+ --#{$prefix}form-select-bg-icon: #{escape-svg($icon)};
95
+ padding-right: $form-select-feedback-icon-padding-end;
96
+ background-position: $form-select-bg-position, $form-select-feedback-icon-position;
97
+ background-size: $form-select-bg-size, $form-select-feedback-icon-size;
98
+ }
97
99
  }
98
100
 
99
101
  &:focus {
100
- border-color: $color;
101
- box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
102
- }
103
-
104
- ~ .#{$state}-feedback,
105
- ~ .#{$state}-tooltip {
106
- display: block;
102
+ border-color: $border-color;
103
+ box-shadow: $focus-box-shadow;
107
104
  }
108
105
  }
109
106
  }
110
107
 
111
-
112
- .form-control-file {
113
- .was-validated &:#{$state},
114
- &.is-#{$state} {
115
- ~ .#{$state}-feedback,
116
- ~ .#{$state}-tooltip {
117
- display: block;
108
+ .form-control-color {
109
+ @include form-validation-state-selector($state) {
110
+ @if $enable-validation-icons {
111
+ width: add($form-color-width, $input-height-inner);
118
112
  }
119
113
  }
120
114
  }
121
115
 
122
116
  .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
- }
117
+ @include form-validation-state-selector($state) {
118
+ border-color: $border-color;
151
119
 
152
120
  &:checked {
153
- ~ .custom-control-label::before {
154
- border-color: lighten($color, 10%);
155
- @include gradient-bg(lighten($color, 10%));
156
- }
121
+ background-color: $color;
157
122
  }
158
123
 
159
124
  &:focus {
160
- ~ .custom-control-label::before {
161
- box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
162
- }
125
+ box-shadow: $focus-box-shadow;
126
+ }
163
127
 
164
- &:not(:checked) ~ .custom-control-label::before {
165
- border-color: $color;
166
- }
128
+ ~ .form-check-label {
129
+ color: $color;
167
130
  }
168
131
  }
169
132
  }
133
+ .form-check-inline .form-check-input {
134
+ ~ .#{$state}-feedback {
135
+ margin-left: .5em;
136
+ }
137
+ }
170
138
 
171
- // custom file
172
- .custom-file-input {
173
- .was-validated &:#{$state},
174
- &.is-#{$state} {
175
- ~ .custom-file-label {
176
- border-color: $color;
177
- }
178
-
179
- ~ .#{$state}-feedback,
180
- ~ .#{$state}-tooltip {
181
- display: block;
182
- }
183
-
184
- &:focus {
185
- ~ .custom-file-label {
186
- border-color: $color;
187
- box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
139
+ .input-group {
140
+ > .form-control:not(:focus),
141
+ > .form-select:not(:focus),
142
+ > .form-floating:not(:focus-within) {
143
+ @include form-validation-state-selector($state) {
144
+ @if $state == "valid" {
145
+ z-index: 3;
146
+ } @else if $state == "invalid" {
147
+ z-index: 4;
188
148
  }
189
149
  }
190
150
  }
191
151
  }
192
152
  }
153
+ // scss-docs-end form-validation-mixins
@@ -1,45 +1,47 @@
1
1
  // Gradients
2
2
 
3
- @mixin gradient-bg($color) {
3
+ // scss-docs-start gradient-bg-mixin
4
+ @mixin gradient-bg($color: null) {
5
+ background-color: $color;
6
+
4
7
  @if $enable-gradients {
5
- background: $color linear-gradient(180deg, mix($body-bg, $color, 15%), $color) repeat-x;
6
- } @else {
7
- background-color: $color;
8
+ background-image: var(--#{$prefix}gradient);
8
9
  }
9
10
  }
11
+ // scss-docs-end gradient-bg-mixin
10
12
 
13
+ // scss-docs-start gradient-mixins
11
14
  // Horizontal gradient, from left to right
12
15
  //
13
16
  // Creates two color stops, start and end, by specifying a color and position for each color stop.
14
17
  @mixin gradient-x($start-color: $gray-700, $end-color: $gray-800, $start-percent: 0%, $end-percent: 100%) {
15
18
  background-image: linear-gradient(to right, $start-color $start-percent, $end-color $end-percent);
16
- background-repeat: repeat-x;
17
19
  }
18
20
 
19
21
  // Vertical gradient, from top to bottom
20
22
  //
21
23
  // Creates two color stops, start and end, by specifying a color and position for each color stop.
22
- @mixin gradient-y($start-color: $gray-700, $end-color: $gray-800, $start-percent: 0%, $end-percent: 100%) {
24
+ @mixin gradient-y($start-color: $gray-700, $end-color: $gray-800, $start-percent: null, $end-percent: null) {
23
25
  background-image: linear-gradient(to bottom, $start-color $start-percent, $end-color $end-percent);
24
- background-repeat: repeat-x;
25
26
  }
26
27
 
27
28
  @mixin gradient-directional($start-color: $gray-700, $end-color: $gray-800, $deg: 45deg) {
28
29
  background-image: linear-gradient($deg, $start-color, $end-color);
29
- background-repeat: repeat-x;
30
30
  }
31
+
31
32
  @mixin gradient-x-three-colors($start-color: $blue, $mid-color: $purple, $color-stop: 50%, $end-color: $red) {
32
33
  background-image: linear-gradient(to right, $start-color, $mid-color $color-stop, $end-color);
33
- background-repeat: no-repeat;
34
34
  }
35
+
35
36
  @mixin gradient-y-three-colors($start-color: $blue, $mid-color: $purple, $color-stop: 50%, $end-color: $red) {
36
37
  background-image: linear-gradient($start-color, $mid-color $color-stop, $end-color);
37
- background-repeat: no-repeat;
38
38
  }
39
+
39
40
  @mixin gradient-radial($inner-color: $gray-700, $outer-color: $gray-800) {
40
41
  background-image: radial-gradient(circle, $inner-color, $outer-color);
41
- background-repeat: no-repeat;
42
42
  }
43
+
43
44
  @mixin gradient-striped($color: rgba($white, .15), $angle: 45deg) {
44
45
  background-image: linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent);
45
46
  }
47
+ // scss-docs-end gradient-mixins