bootstrap 4.6.0 → 5.0.0

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 (149) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -1
  3. data/README.md +7 -4
  4. data/assets/javascripts/bootstrap/alert.js +181 -109
  5. data/assets/javascripts/bootstrap/base-component.js +63 -0
  6. data/assets/javascripts/bootstrap/button.js +85 -173
  7. data/assets/javascripts/bootstrap/carousel.js +458 -355
  8. data/assets/javascripts/bootstrap/collapse.js +366 -218
  9. data/assets/javascripts/bootstrap/dom/data.js +68 -0
  10. data/assets/javascripts/bootstrap/dom/event-handler.js +322 -0
  11. data/assets/javascripts/bootstrap/dom/manipulator.js +88 -0
  12. data/assets/javascripts/bootstrap/dom/selector-engine.js +85 -0
  13. data/assets/javascripts/bootstrap/dropdown.js +459 -351
  14. data/assets/javascripts/bootstrap/modal.js +597 -429
  15. data/assets/javascripts/bootstrap/offcanvas.js +671 -0
  16. data/assets/javascripts/bootstrap/popover.js +130 -154
  17. data/assets/javascripts/bootstrap/scrollspy.js +238 -188
  18. data/assets/javascripts/bootstrap/tab.js +235 -137
  19. data/assets/javascripts/bootstrap/toast.js +210 -148
  20. data/assets/javascripts/bootstrap/tooltip.js +627 -466
  21. data/assets/javascripts/bootstrap-global-this-define.js +6 -0
  22. data/assets/javascripts/bootstrap-global-this-undefine.js +2 -0
  23. data/assets/javascripts/bootstrap-sprockets.js +15 -8
  24. data/assets/javascripts/bootstrap.js +3174 -2563
  25. data/assets/javascripts/bootstrap.min.js +2 -2
  26. data/assets/stylesheets/_bootstrap-grid.scss +51 -16
  27. data/assets/stylesheets/_bootstrap-reboot.scss +4 -1
  28. data/assets/stylesheets/_bootstrap.scss +16 -8
  29. data/assets/stylesheets/bootstrap/_accordion.scss +118 -0
  30. data/assets/stylesheets/bootstrap/_alert.scss +15 -10
  31. data/assets/stylesheets/bootstrap/_badge.scss +2 -27
  32. data/assets/stylesheets/bootstrap/_breadcrumb.scss +3 -17
  33. data/assets/stylesheets/bootstrap/_button-group.scss +21 -45
  34. data/assets/stylesheets/bootstrap/_buttons.scss +29 -60
  35. data/assets/stylesheets/bootstrap/_card.scss +20 -91
  36. data/assets/stylesheets/bootstrap/_carousel.scss +65 -33
  37. data/assets/stylesheets/bootstrap/_close.scss +30 -30
  38. data/assets/stylesheets/bootstrap/_containers.scss +41 -0
  39. data/assets/stylesheets/bootstrap/_dropdown.scss +84 -36
  40. data/assets/stylesheets/bootstrap/_forms.scss +9 -347
  41. data/assets/stylesheets/bootstrap/_functions.scss +84 -23
  42. data/assets/stylesheets/bootstrap/_grid.scss +3 -54
  43. data/assets/stylesheets/bootstrap/_helpers.scss +7 -0
  44. data/assets/stylesheets/bootstrap/_list-group.scss +28 -8
  45. data/assets/stylesheets/bootstrap/_mixins.scss +8 -13
  46. data/assets/stylesheets/bootstrap/_modal.scss +43 -55
  47. data/assets/stylesheets/bootstrap/_nav.scss +23 -4
  48. data/assets/stylesheets/bootstrap/_navbar.scss +45 -71
  49. data/assets/stylesheets/bootstrap/_offcanvas.scss +77 -0
  50. data/assets/stylesheets/bootstrap/_pagination.scss +10 -20
  51. data/assets/stylesheets/bootstrap/_popover.scss +15 -27
  52. data/assets/stylesheets/bootstrap/_progress.scss +5 -4
  53. data/assets/stylesheets/bootstrap/_reboot.scss +316 -179
  54. data/assets/stylesheets/bootstrap/_root.scss +5 -8
  55. data/assets/stylesheets/bootstrap/_spinners.scss +11 -7
  56. data/assets/stylesheets/bootstrap/_tables.scss +79 -114
  57. data/assets/stylesheets/bootstrap/_toasts.scss +20 -15
  58. data/assets/stylesheets/bootstrap/_tooltip.scss +17 -17
  59. data/assets/stylesheets/bootstrap/_transitions.scss +2 -1
  60. data/assets/stylesheets/bootstrap/_type.scss +38 -59
  61. data/assets/stylesheets/bootstrap/_utilities.scss +594 -18
  62. data/assets/stylesheets/bootstrap/_variables.scss +800 -482
  63. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +18 -0
  64. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +61 -0
  65. data/assets/stylesheets/bootstrap/forms/_form-check.scss +152 -0
  66. data/assets/stylesheets/bootstrap/forms/_form-control.scss +219 -0
  67. data/assets/stylesheets/bootstrap/forms/_form-range.scss +91 -0
  68. data/assets/stylesheets/bootstrap/forms/_form-select.scss +67 -0
  69. data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
  70. data/assets/stylesheets/bootstrap/forms/_input-group.scss +121 -0
  71. data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
  72. data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
  73. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +12 -0
  74. data/assets/stylesheets/bootstrap/helpers/_position.scss +30 -0
  75. data/assets/stylesheets/bootstrap/helpers/_ratio.scss +26 -0
  76. data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
  77. data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
  78. data/assets/stylesheets/bootstrap/helpers/_visually-hidden.scss +8 -0
  79. data/assets/stylesheets/bootstrap/mixins/_alert.scss +3 -5
  80. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +10 -8
  81. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +7 -9
  82. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +14 -10
  83. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +71 -48
  84. data/assets/stylesheets/bootstrap/mixins/_caret.scss +10 -8
  85. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
  86. data/assets/stylesheets/bootstrap/mixins/_color-scheme.scss +7 -0
  87. data/assets/stylesheets/bootstrap/mixins/_container.scss +9 -0
  88. data/assets/stylesheets/bootstrap/mixins/_forms.scss +38 -86
  89. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +13 -11
  90. data/assets/stylesheets/bootstrap/mixins/_grid.scss +89 -33
  91. data/assets/stylesheets/bootstrap/mixins/_image.scss +1 -21
  92. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +5 -2
  93. data/assets/stylesheets/bootstrap/mixins/_lists.scss +1 -1
  94. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +17 -8
  95. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +2 -2
  96. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +21 -0
  97. data/assets/stylesheets/bootstrap/mixins/_transition.scss +1 -1
  98. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +68 -0
  99. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +29 -0
  100. data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
  101. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +234 -126
  102. data/bootstrap.gemspec +1 -3
  103. data/lib/bootstrap/version.rb +2 -2
  104. data/tasks/updater/js.rb +20 -5
  105. data/tasks/updater/network.rb +7 -1
  106. data/test/dummy_rails/app/assets/javascripts/application.js +4 -3
  107. data/test/dummy_rails/app/views/layouts/application.html.erb +3 -1
  108. data/test/dummy_rails/app/views/pages/root.html +89 -0
  109. data/test/dummy_rails/config/application.rb +0 -3
  110. data/test/gemfiles/rails_6_1.gemfile +7 -0
  111. metadata +45 -73
  112. data/assets/javascripts/bootstrap/util.js +0 -192
  113. data/assets/stylesheets/bootstrap/_code.scss +0 -48
  114. data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -526
  115. data/assets/stylesheets/bootstrap/_input-group.scss +0 -208
  116. data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
  117. data/assets/stylesheets/bootstrap/_media.scss +0 -8
  118. data/assets/stylesheets/bootstrap/_print.scss +0 -141
  119. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -23
  120. data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
  121. data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
  122. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -80
  123. data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
  124. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -11
  125. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +0 -34
  126. data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
  127. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
  128. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -17
  129. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
  130. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
  131. data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
  132. data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
  133. data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
  134. data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
  135. data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
  136. data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
  137. data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
  138. data/assets/stylesheets/bootstrap/utilities/_interactions.scss +0 -5
  139. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
  140. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
  141. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
  142. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
  143. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
  144. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
  145. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
  146. data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
  147. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
  148. data/test/dummy_rails/app/views/pages/root.html.slim +0 -58
  149. /data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
@@ -0,0 +1,121 @@
1
+ //
2
+ // Base styles
3
+ //
4
+
5
+ .input-group {
6
+ position: relative;
7
+ display: flex;
8
+ flex-wrap: wrap; // For form validation feedback
9
+ align-items: stretch;
10
+ width: 100%;
11
+
12
+ > .form-control,
13
+ > .form-select {
14
+ position: relative; // For focus state's z-index
15
+ flex: 1 1 auto;
16
+ width: 1%;
17
+ min-width: 0; // https://stackoverflow.com/questions/36247140/why-dont-flex-items-shrink-past-content-size
18
+ }
19
+
20
+ // Bring the "active" form control to the top of surrounding elements
21
+ > .form-control:focus,
22
+ > .form-select:focus {
23
+ z-index: 3;
24
+ }
25
+
26
+ // Ensure buttons are always above inputs for more visually pleasing borders.
27
+ // This isn't needed for `.input-group-text` since it shares the same border-color
28
+ // as our inputs.
29
+ .btn {
30
+ position: relative;
31
+ z-index: 2;
32
+
33
+ &:focus {
34
+ z-index: 3;
35
+ }
36
+ }
37
+ }
38
+
39
+
40
+ // Textual addons
41
+ //
42
+ // Serves as a catch-all element for any text or radio/checkbox input you wish
43
+ // to prepend or append to an input.
44
+
45
+ .input-group-text {
46
+ display: flex;
47
+ align-items: center;
48
+ padding: $input-group-addon-padding-y $input-group-addon-padding-x;
49
+ @include font-size($input-font-size); // Match inputs
50
+ font-weight: $input-group-addon-font-weight;
51
+ line-height: $input-line-height;
52
+ color: $input-group-addon-color;
53
+ text-align: center;
54
+ white-space: nowrap;
55
+ background-color: $input-group-addon-bg;
56
+ border: $input-border-width solid $input-group-addon-border-color;
57
+ @include border-radius($input-border-radius);
58
+ }
59
+
60
+
61
+ // Sizing
62
+ //
63
+ // Remix the default form control sizing classes into new ones for easier
64
+ // manipulation.
65
+
66
+ .input-group-lg > .form-control,
67
+ .input-group-lg > .form-select,
68
+ .input-group-lg > .input-group-text,
69
+ .input-group-lg > .btn {
70
+ padding: $input-padding-y-lg $input-padding-x-lg;
71
+ @include font-size($input-font-size-lg);
72
+ @include border-radius($input-border-radius-lg);
73
+ }
74
+
75
+ .input-group-sm > .form-control,
76
+ .input-group-sm > .form-select,
77
+ .input-group-sm > .input-group-text,
78
+ .input-group-sm > .btn {
79
+ padding: $input-padding-y-sm $input-padding-x-sm;
80
+ @include font-size($input-font-size-sm);
81
+ @include border-radius($input-border-radius-sm);
82
+ }
83
+
84
+ .input-group-lg > .form-select,
85
+ .input-group-sm > .form-select {
86
+ padding-right: $form-select-padding-x + $form-select-indicator-padding;
87
+ }
88
+
89
+
90
+ // Rounded corners
91
+ //
92
+ // These rulesets must come after the sizing ones to properly override sm and lg
93
+ // border-radius values when extending. They're more specific than we'd like
94
+ // with the `.input-group >` part, but without it, we cannot override the sizing.
95
+
96
+ // stylelint-disable-next-line no-duplicate-selectors
97
+ .input-group {
98
+ &:not(.has-validation) {
99
+ > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu),
100
+ > .dropdown-toggle:nth-last-child(n + 3) {
101
+ @include border-end-radius(0);
102
+ }
103
+ }
104
+
105
+ &.has-validation {
106
+ > :nth-last-child(n + 3):not(.dropdown-toggle):not(.dropdown-menu),
107
+ > .dropdown-toggle:nth-last-child(n + 4) {
108
+ @include border-end-radius(0);
109
+ }
110
+ }
111
+
112
+ $validation-messages: "";
113
+ @each $state in map-keys($form-validation-states) {
114
+ $validation-messages: $validation-messages + ":not(." + unquote($state) + "-tooltip)" + ":not(." + unquote($state) + "-feedback)";
115
+ }
116
+
117
+ > :not(:first-child):not(.dropdown-menu)#{$validation-messages} {
118
+ margin-left: -$input-border-width;
119
+ @include border-start-radius(0);
120
+ }
121
+ }
@@ -0,0 +1,36 @@
1
+ //
2
+ // Labels
3
+ //
4
+
5
+ .form-label {
6
+ margin-bottom: $form-label-margin-bottom;
7
+ @include font-size($form-label-font-size);
8
+ font-style: $form-label-font-style;
9
+ font-weight: $form-label-font-weight;
10
+ color: $form-label-color;
11
+ }
12
+
13
+ // For use with horizontal and inline forms, when you need the label (or legend)
14
+ // text to align with the form controls.
15
+ .col-form-label {
16
+ padding-top: add($input-padding-y, $input-border-width);
17
+ padding-bottom: add($input-padding-y, $input-border-width);
18
+ margin-bottom: 0; // Override the `<legend>` default
19
+ @include font-size(inherit); // Override the `<legend>` default
20
+ font-style: $form-label-font-style;
21
+ font-weight: $form-label-font-weight;
22
+ line-height: $input-line-height;
23
+ color: $form-label-color;
24
+ }
25
+
26
+ .col-form-label-lg {
27
+ padding-top: add($input-padding-y-lg, $input-border-width);
28
+ padding-bottom: add($input-padding-y-lg, $input-border-width);
29
+ @include font-size($input-font-size-lg);
30
+ }
31
+
32
+ .col-form-label-sm {
33
+ padding-top: add($input-padding-y-sm, $input-border-width);
34
+ padding-bottom: add($input-padding-y-sm, $input-border-width);
35
+ @include font-size($input-font-size-sm);
36
+ }
@@ -0,0 +1,12 @@
1
+ // Form validation
2
+ //
3
+ // Provide feedback to users when form field values are valid or invalid. Works
4
+ // primarily for client-side validation via scoped `:invalid` and `:valid`
5
+ // pseudo-classes but also includes `.is-invalid` and `.is-valid` classes for
6
+ // server-side validation.
7
+
8
+ // scss-docs-start form-validation-states-loop
9
+ @each $state, $data in $form-validation-states {
10
+ @include form-validation-state($state, $data...);
11
+ }
12
+ // scss-docs-end form-validation-states-loop
@@ -0,0 +1,12 @@
1
+ @each $color, $value in $theme-colors {
2
+ .link-#{$color} {
3
+ color: $value;
4
+
5
+ @if $link-shade-percentage != 0 {
6
+ &:hover,
7
+ &:focus {
8
+ color: if(color-contrast($value) == $color-contrast-light, shade-color($value, $link-shade-percentage), tint-color($value, $link-shade-percentage));
9
+ }
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,30 @@
1
+ // Shorthand
2
+
3
+ .fixed-top {
4
+ position: fixed;
5
+ top: 0;
6
+ right: 0;
7
+ left: 0;
8
+ z-index: $zindex-fixed;
9
+ }
10
+
11
+ .fixed-bottom {
12
+ position: fixed;
13
+ right: 0;
14
+ bottom: 0;
15
+ left: 0;
16
+ z-index: $zindex-fixed;
17
+ }
18
+
19
+ // Responsive sticky top
20
+ @each $breakpoint in map-keys($grid-breakpoints) {
21
+ @include media-breakpoint-up($breakpoint) {
22
+ $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
23
+
24
+ .sticky#{$infix}-top {
25
+ position: sticky;
26
+ top: 0;
27
+ z-index: $zindex-sticky;
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,26 @@
1
+ // Credit: Nicolas Gallagher and SUIT CSS.
2
+
3
+ .ratio {
4
+ position: relative;
5
+ width: 100%;
6
+
7
+ &::before {
8
+ display: block;
9
+ padding-top: var(--#{$variable-prefix}aspect-ratio);
10
+ content: "";
11
+ }
12
+
13
+ > * {
14
+ position: absolute;
15
+ top: 0;
16
+ left: 0;
17
+ width: 100%;
18
+ height: 100%;
19
+ }
20
+ }
21
+
22
+ @each $key, $ratio in $aspect-ratios {
23
+ .ratio-#{$key} {
24
+ --#{$variable-prefix}aspect-ratio: #{$ratio};
25
+ }
26
+ }
@@ -0,0 +1,15 @@
1
+ //
2
+ // Stretched link
3
+ //
4
+
5
+ .stretched-link {
6
+ &::#{$stretched-link-pseudo-element} {
7
+ position: absolute;
8
+ top: 0;
9
+ right: 0;
10
+ bottom: 0;
11
+ left: 0;
12
+ z-index: $stretched-link-z-index;
13
+ content: "";
14
+ }
15
+ }
@@ -0,0 +1,7 @@
1
+ //
2
+ // Text truncation
3
+ //
4
+
5
+ .text-truncate {
6
+ @include text-truncate();
7
+ }
@@ -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
+ }
@@ -1,13 +1,11 @@
1
+ // scss-docs-start alert-variant-mixin
1
2
  @mixin alert-variant($background, $border, $color) {
2
3
  color: $color;
3
4
  @include gradient-bg($background);
4
5
  border-color: $border;
5
6
 
6
- hr {
7
- border-top-color: darken($border, 5%);
8
- }
9
-
10
7
  .alert-link {
11
- color: darken($color, 10%);
8
+ color: shade-color($color, 20%);
12
9
  }
13
10
  }
11
+ // scss-docs-end alert-variant-mixin
@@ -14,6 +14,7 @@
14
14
  @return $return;
15
15
  }
16
16
 
17
+ // scss-docs-start border-radius-mixins
17
18
  @mixin border-radius($radius: $border-radius, $fallback-border-radius: false) {
18
19
  @if $enable-rounded {
19
20
  border-radius: valid-radius($radius);
@@ -23,54 +24,55 @@
23
24
  }
24
25
  }
25
26
 
26
- @mixin border-top-radius($radius) {
27
+ @mixin border-top-radius($radius: $border-radius) {
27
28
  @if $enable-rounded {
28
29
  border-top-left-radius: valid-radius($radius);
29
30
  border-top-right-radius: valid-radius($radius);
30
31
  }
31
32
  }
32
33
 
33
- @mixin border-right-radius($radius) {
34
+ @mixin border-end-radius($radius: $border-radius) {
34
35
  @if $enable-rounded {
35
36
  border-top-right-radius: valid-radius($radius);
36
37
  border-bottom-right-radius: valid-radius($radius);
37
38
  }
38
39
  }
39
40
 
40
- @mixin border-bottom-radius($radius) {
41
+ @mixin border-bottom-radius($radius: $border-radius) {
41
42
  @if $enable-rounded {
42
43
  border-bottom-right-radius: valid-radius($radius);
43
44
  border-bottom-left-radius: valid-radius($radius);
44
45
  }
45
46
  }
46
47
 
47
- @mixin border-left-radius($radius) {
48
+ @mixin border-start-radius($radius: $border-radius) {
48
49
  @if $enable-rounded {
49
50
  border-top-left-radius: valid-radius($radius);
50
51
  border-bottom-left-radius: valid-radius($radius);
51
52
  }
52
53
  }
53
54
 
54
- @mixin border-top-left-radius($radius) {
55
+ @mixin border-top-start-radius($radius: $border-radius) {
55
56
  @if $enable-rounded {
56
57
  border-top-left-radius: valid-radius($radius);
57
58
  }
58
59
  }
59
60
 
60
- @mixin border-top-right-radius($radius) {
61
+ @mixin border-top-end-radius($radius: $border-radius) {
61
62
  @if $enable-rounded {
62
63
  border-top-right-radius: valid-radius($radius);
63
64
  }
64
65
  }
65
66
 
66
- @mixin border-bottom-right-radius($radius) {
67
+ @mixin border-bottom-end-radius($radius: $border-radius) {
67
68
  @if $enable-rounded {
68
69
  border-bottom-right-radius: valid-radius($radius);
69
70
  }
70
71
  }
71
72
 
72
- @mixin border-bottom-left-radius($radius) {
73
+ @mixin border-bottom-start-radius($radius: $border-radius) {
73
74
  @if $enable-rounded {
74
75
  border-bottom-left-radius: valid-radius($radius);
75
76
  }
76
77
  }
78
+ // scss-docs-end border-radius-mixins
@@ -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,110 @@
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
+ // 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
+ color: $color;
8
22
  @include gradient-bg($background);
9
23
  border-color: $border;
10
24
  @include box-shadow($btn-box-shadow);
11
25
 
12
- @include hover() {
13
- color: color-yiq($hover-background);
26
+ &:hover {
27
+ color: $hover-color;
14
28
  @include gradient-bg($hover-background);
15
29
  border-color: $hover-border;
16
30
  }
17
31
 
18
- &:focus,
19
- &.focus {
20
- color: color-yiq($hover-background);
32
+ .btn-check:focus + &,
33
+ &:focus {
34
+ color: $hover-color;
21
35
  @include gradient-bg($hover-background);
22
36
  border-color: $hover-border;
23
37
  @if $enable-shadows {
24
- @include box-shadow($btn-box-shadow, 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5));
38
+ @include box-shadow($btn-box-shadow, 0 0 0 $btn-focus-width rgba(mix($color, $border, 15%), .5));
25
39
  } @else {
26
40
  // 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;
41
+ box-shadow: 0 0 0 $btn-focus-width rgba(mix($color, $border, 15%), .5);
40
42
  }
41
43
  }
42
44
 
43
- &:not(:disabled):not(.disabled):active,
44
- &:not(:disabled):not(.disabled).active,
45
+ .btn-check:checked + &,
46
+ .btn-check:active + &,
47
+ &:active,
48
+ &.active,
45
49
  .show > &.dropdown-toggle {
46
- color: color-yiq($active-background);
50
+ color: $active-color;
47
51
  background-color: $active-background;
48
- @if $enable-gradients {
49
- background-image: none; // Remove the gradient for the pressed/active state
50
- }
52
+ // Remove CSS gradients if they're enabled
53
+ background-image: if($enable-gradients, none, null);
51
54
  border-color: $active-border;
52
55
 
53
56
  &: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));
57
+ @if $enable-shadows {
58
+ @include box-shadow($btn-active-box-shadow, 0 0 0 $btn-focus-width rgba(mix($color, $border, 15%), .5));
56
59
  } @else {
57
60
  // 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);
61
+ box-shadow: 0 0 0 $btn-focus-width rgba(mix($color, $border, 15%), .5);
59
62
  }
60
63
  }
61
64
  }
65
+
66
+ &:disabled,
67
+ &.disabled {
68
+ color: $disabled-color;
69
+ background-color: $disabled-background;
70
+ // Remove CSS gradients if they're enabled
71
+ background-image: if($enable-gradients, none, null);
72
+ border-color: $disabled-border;
73
+ }
62
74
  }
75
+ // scss-docs-end btn-variant-mixin
63
76
 
64
- @mixin button-outline-variant($color, $color-hover: color-yiq($color), $active-background: $color, $active-border: $color) {
77
+ // scss-docs-start btn-outline-variant-mixin
78
+ @mixin button-outline-variant(
79
+ $color,
80
+ $color-hover: color-contrast($color),
81
+ $active-background: $color,
82
+ $active-border: $color,
83
+ $active-color: color-contrast($active-background)
84
+ ) {
65
85
  color: $color;
66
86
  border-color: $color;
67
87
 
68
- @include hover() {
88
+ &:hover {
69
89
  color: $color-hover;
70
90
  background-color: $active-background;
71
91
  border-color: $active-border;
72
92
  }
73
93
 
74
- &:focus,
75
- &.focus {
94
+ .btn-check:focus + &,
95
+ &:focus {
76
96
  box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
77
97
  }
78
98
 
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);
99
+ .btn-check:checked + &,
100
+ .btn-check:active + &,
101
+ &:active,
102
+ &.active,
103
+ &.dropdown-toggle.show {
104
+ color: $active-color;
89
105
  background-color: $active-background;
90
106
  border-color: $active-border;
91
107
 
92
108
  &:focus {
93
- @if $enable-shadows and $btn-active-box-shadow != none {
109
+ @if $enable-shadows {
94
110
  @include box-shadow($btn-active-box-shadow, 0 0 0 $btn-focus-width rgba($color, .5));
95
111
  } @else {
96
112
  // Avoid using mixin so we can pass custom focus shadow properly
@@ -98,13 +114,20 @@
98
114
  }
99
115
  }
100
116
  }
117
+
118
+ &:disabled,
119
+ &.disabled {
120
+ color: $color;
121
+ background-color: transparent;
122
+ }
101
123
  }
124
+ // scss-docs-end btn-outline-variant-mixin
102
125
 
103
- // Button sizes
104
- @mixin button-size($padding-y, $padding-x, $font-size, $line-height, $border-radius) {
126
+ // scss-docs-start btn-size-mixin
127
+ @mixin button-size($padding-y, $padding-x, $font-size, $border-radius) {
105
128
  padding: $padding-y $padding-x;
106
129
  @include font-size($font-size);
107
- line-height: $line-height;
108
130
  // Manually declare to provide an override to the browser default
109
131
  @include border-radius($border-radius, 0);
110
132
  }
133
+ // scss-docs-end btn-size-mixin