bootstrap 4.1.3 → 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 (156) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +17 -2
  3. data/CHANGELOG.md +2 -14
  4. data/README.md +7 -4
  5. data/Rakefile +2 -2
  6. data/assets/javascripts/bootstrap/alert.js +226 -166
  7. data/assets/javascripts/bootstrap/base-component.js +63 -0
  8. data/assets/javascripts/bootstrap/button.js +119 -165
  9. data/assets/javascripts/bootstrap/carousel.js +634 -445
  10. data/assets/javascripts/bootstrap/collapse.js +447 -327
  11. data/assets/javascripts/bootstrap/dom/data.js +68 -0
  12. data/assets/javascripts/bootstrap/dom/event-handler.js +322 -0
  13. data/assets/javascripts/bootstrap/dom/manipulator.js +88 -0
  14. data/assets/javascripts/bootstrap/dom/selector-engine.js +85 -0
  15. data/assets/javascripts/bootstrap/dropdown.js +550 -425
  16. data/assets/javascripts/bootstrap/modal.js +695 -492
  17. data/assets/javascripts/bootstrap/offcanvas.js +671 -0
  18. data/assets/javascripts/bootstrap/popover.js +167 -217
  19. data/assets/javascripts/bootstrap/scrollspy.js +319 -302
  20. data/assets/javascripts/bootstrap/tab.js +303 -221
  21. data/assets/javascripts/bootstrap/toast.js +333 -0
  22. data/assets/javascripts/bootstrap/tooltip.js +896 -577
  23. data/assets/javascripts/bootstrap-global-this-define.js +6 -0
  24. data/assets/javascripts/bootstrap-global-this-undefine.js +2 -0
  25. data/assets/javascripts/bootstrap-sprockets.js +15 -7
  26. data/assets/javascripts/bootstrap.js +4262 -3163
  27. data/assets/javascripts/bootstrap.min.js +4 -4
  28. data/assets/stylesheets/_bootstrap-grid.scss +54 -21
  29. data/assets/stylesheets/_bootstrap-reboot.scss +7 -4
  30. data/assets/stylesheets/_bootstrap.scss +21 -11
  31. data/assets/stylesheets/bootstrap/_accordion.scss +118 -0
  32. data/assets/stylesheets/bootstrap/_alert.scss +15 -9
  33. data/assets/stylesheets/bootstrap/_badge.scss +3 -21
  34. data/assets/stylesheets/bootstrap/_breadcrumb.scss +5 -18
  35. data/assets/stylesheets/bootstrap/_button-group.scss +29 -62
  36. data/assets/stylesheets/bootstrap/_buttons.scss +33 -65
  37. data/assets/stylesheets/bootstrap/_card.scss +55 -141
  38. data/assets/stylesheets/bootstrap/_carousel.scss +94 -101
  39. data/assets/stylesheets/bootstrap/_close.scss +33 -28
  40. data/assets/stylesheets/bootstrap/_containers.scss +41 -0
  41. data/assets/stylesheets/bootstrap/_dropdown.scss +114 -40
  42. data/assets/stylesheets/bootstrap/_forms.scss +9 -333
  43. data/assets/stylesheets/bootstrap/_functions.scss +148 -29
  44. data/assets/stylesheets/bootstrap/_grid.scss +4 -34
  45. data/assets/stylesheets/bootstrap/_helpers.scss +7 -0
  46. data/assets/stylesheets/bootstrap/_images.scss +4 -4
  47. data/assets/stylesheets/bootstrap/_list-group.scss +86 -27
  48. data/assets/stylesheets/bootstrap/_mixins.scss +17 -16
  49. data/assets/stylesheets/bootstrap/_modal.scss +90 -42
  50. data/assets/stylesheets/bootstrap/_nav.scss +31 -10
  51. data/assets/stylesheets/bootstrap/_navbar.scss +68 -61
  52. data/assets/stylesheets/bootstrap/_offcanvas.scss +77 -0
  53. data/assets/stylesheets/bootstrap/_pagination.scss +13 -27
  54. data/assets/stylesheets/bootstrap/_popover.scss +63 -88
  55. data/assets/stylesheets/bootstrap/_progress.scss +20 -6
  56. data/assets/stylesheets/bootstrap/_reboot.scss +349 -211
  57. data/assets/stylesheets/bootstrap/_root.scss +5 -8
  58. data/assets/stylesheets/bootstrap/_spinners.scss +69 -0
  59. data/assets/stylesheets/bootstrap/_tables.scss +79 -116
  60. data/assets/stylesheets/bootstrap/_toasts.scss +51 -0
  61. data/assets/stylesheets/bootstrap/_tooltip.scss +18 -18
  62. data/assets/stylesheets/bootstrap/_transitions.scss +2 -3
  63. data/assets/stylesheets/bootstrap/_type.scss +42 -63
  64. data/assets/stylesheets/bootstrap/_utilities.scss +594 -15
  65. data/assets/stylesheets/bootstrap/_variables.scss +952 -440
  66. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +18 -0
  67. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +61 -0
  68. data/assets/stylesheets/bootstrap/forms/_form-check.scss +152 -0
  69. data/assets/stylesheets/bootstrap/forms/_form-control.scss +219 -0
  70. data/assets/stylesheets/bootstrap/forms/_form-range.scss +91 -0
  71. data/assets/stylesheets/bootstrap/forms/_form-select.scss +67 -0
  72. data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
  73. data/assets/stylesheets/bootstrap/forms/_input-group.scss +121 -0
  74. data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
  75. data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
  76. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +12 -0
  77. data/assets/stylesheets/bootstrap/helpers/_position.scss +30 -0
  78. data/assets/stylesheets/bootstrap/helpers/_ratio.scss +26 -0
  79. data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
  80. data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
  81. data/assets/stylesheets/bootstrap/helpers/_visually-hidden.scss +8 -0
  82. data/assets/stylesheets/bootstrap/mixins/_alert.scss +3 -5
  83. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +57 -14
  84. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +14 -1
  85. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +13 -9
  86. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +77 -53
  87. data/assets/stylesheets/bootstrap/mixins/_caret.scss +14 -16
  88. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
  89. data/assets/stylesheets/bootstrap/mixins/_color-scheme.scss +7 -0
  90. data/assets/stylesheets/bootstrap/mixins/_container.scss +9 -0
  91. data/assets/stylesheets/bootstrap/mixins/_deprecate.scss +10 -0
  92. data/assets/stylesheets/bootstrap/mixins/_forms.scss +87 -97
  93. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +13 -11
  94. data/assets/stylesheets/bootstrap/mixins/_grid.scss +106 -33
  95. data/assets/stylesheets/bootstrap/mixins/_image.scss +0 -20
  96. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +5 -2
  97. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +18 -9
  98. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +2 -2
  99. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +21 -0
  100. data/assets/stylesheets/bootstrap/mixins/_transition.scss +19 -6
  101. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +68 -0
  102. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +29 -0
  103. data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
  104. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +312 -0
  105. data/bootstrap.gemspec +7 -6
  106. data/lib/bootstrap/engine.rb +3 -0
  107. data/lib/bootstrap/version.rb +4 -2
  108. data/lib/bootstrap.rb +10 -7
  109. data/tasks/updater/js.rb +20 -5
  110. data/tasks/updater/network.rb +8 -2
  111. data/test/dummy_rails/app/assets/config/manifest.js +3 -0
  112. data/test/dummy_rails/app/assets/javascripts/application.js +4 -3
  113. data/test/dummy_rails/app/assets/stylesheets/.browserslistrc +1 -0
  114. data/test/dummy_rails/app/views/layouts/application.html.erb +3 -1
  115. data/test/dummy_rails/app/views/pages/root.html +89 -0
  116. data/test/dummy_rails/config/application.rb +0 -3
  117. data/test/gemfiles/rails_6_0.gemfile +7 -0
  118. data/test/gemfiles/rails_6_1.gemfile +7 -0
  119. data/test/support/dummy_rails_integration.rb +3 -1
  120. data/test/test_helper.rb +18 -13
  121. metadata +64 -79
  122. data/assets/javascripts/bootstrap/util.js +0 -143
  123. data/assets/stylesheets/bootstrap/_code.scss +0 -48
  124. data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -433
  125. data/assets/stylesheets/bootstrap/_input-group.scss +0 -173
  126. data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -16
  127. data/assets/stylesheets/bootstrap/_media.scss +0 -8
  128. data/assets/stylesheets/bootstrap/_print.scss +0 -141
  129. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -21
  130. data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -12
  131. data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -11
  132. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -67
  133. data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
  134. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -10
  135. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +0 -33
  136. data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -6
  137. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -30
  138. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -14
  139. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -13
  140. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -7
  141. data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
  142. data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
  143. data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -59
  144. data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -38
  145. data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -52
  146. data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
  147. data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -9
  148. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -37
  149. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
  150. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
  151. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -12
  152. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -51
  153. data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -58
  154. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -11
  155. data/test/dummy_rails/app/views/pages/root.html.slim +0 -58
  156. /data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
@@ -27,25 +27,31 @@
27
27
  // Expand the right padding and account for the close button's positioning.
28
28
 
29
29
  .alert-dismissible {
30
- padding-right: ($close-font-size + $alert-padding-x * 2);
30
+ padding-right: $alert-dismissible-padding-r;
31
31
 
32
32
  // Adjust close link position
33
- .close {
33
+ .btn-close {
34
34
  position: absolute;
35
35
  top: 0;
36
36
  right: 0;
37
- padding: $alert-padding-y $alert-padding-x;
38
- color: inherit;
37
+ z-index: $stretched-link-z-index + 1;
38
+ padding: $alert-padding-y * 1.25 $alert-padding-x;
39
39
  }
40
40
  }
41
41
 
42
42
 
43
- // Alternate styles
44
- //
43
+ // scss-docs-start alert-modifiers
45
44
  // Generate contextual modifier classes for colorizing the alert.
46
45
 
47
- @each $color, $value in $theme-colors {
48
- .alert-#{$color} {
49
- @include alert-variant(theme-color-level($color, $alert-bg-level), theme-color-level($color, $alert-border-level), theme-color-level($color, $alert-color-level));
46
+ @each $state, $value in $theme-colors {
47
+ $alert-background: shift-color($value, $alert-bg-scale);
48
+ $alert-border: shift-color($value, $alert-border-scale);
49
+ $alert-color: shift-color($value, $alert-color-scale);
50
+ @if (contrast-ratio($alert-background, $alert-color) < $min-contrast-ratio) {
51
+ $alert-color: mix($value, color-contrast($alert-background), abs($alert-color-scale));
52
+ }
53
+ .alert-#{$state} {
54
+ @include alert-variant($alert-background, $alert-border, $alert-color);
50
55
  }
51
56
  }
57
+ // scss-docs-end alert-modifiers
@@ -6,13 +6,15 @@
6
6
  .badge {
7
7
  display: inline-block;
8
8
  padding: $badge-padding-y $badge-padding-x;
9
- font-size: $badge-font-size;
9
+ @include font-size($badge-font-size);
10
10
  font-weight: $badge-font-weight;
11
11
  line-height: 1;
12
+ color: $badge-color;
12
13
  text-align: center;
13
14
  white-space: nowrap;
14
15
  vertical-align: baseline;
15
16
  @include border-radius($badge-border-radius);
17
+ @include gradient-bg();
16
18
 
17
19
  // Empty badges collapse automatically
18
20
  &:empty {
@@ -25,23 +27,3 @@
25
27
  position: relative;
26
28
  top: -1px;
27
29
  }
28
-
29
- // Pill badges
30
- //
31
- // Make them extra rounded with a modifier to replace v3's badges.
32
-
33
- .badge-pill {
34
- padding-right: $badge-pill-padding-x;
35
- padding-left: $badge-pill-padding-x;
36
- @include border-radius($badge-pill-border-radius);
37
- }
38
-
39
- // Colors
40
- //
41
- // Contextual variations (linked badges get darker on :hover).
42
-
43
- @each $color, $value in $theme-colors {
44
- .badge-#{$color} {
45
- @include badge-variant($value);
46
- }
47
- }
@@ -3,6 +3,7 @@
3
3
  flex-wrap: wrap;
4
4
  padding: $breadcrumb-padding-y $breadcrumb-padding-x;
5
5
  margin-bottom: $breadcrumb-margin-bottom;
6
+ @include font-size($breadcrumb-font-size);
6
7
  list-style: none;
7
8
  background-color: $breadcrumb-bg;
8
9
  @include border-radius($breadcrumb-border-radius);
@@ -11,30 +12,16 @@
11
12
  .breadcrumb-item {
12
13
  // The separator between breadcrumbs (by default, a forward-slash: "/")
13
14
  + .breadcrumb-item {
14
- padding-left: $breadcrumb-item-padding;
15
+ padding-left: $breadcrumb-item-padding-x;
15
16
 
16
17
  &::before {
17
- display: inline-block; // Suppress underlining of the separator in modern browsers
18
- padding-right: $breadcrumb-item-padding;
18
+ float: left; // Suppress inline spacings and underlining of the separator
19
+ padding-right: $breadcrumb-item-padding-x;
19
20
  color: $breadcrumb-divider-color;
20
- content: $breadcrumb-divider;
21
+ content: var(--#{$variable-prefix}breadcrumb-divider, escape-svg($breadcrumb-divider)) #{"/* rtl:"} var(--#{$variable-prefix}breadcrumb-divider, escape-svg($breadcrumb-divider-flipped)) #{"*/"};
21
22
  }
22
23
  }
23
24
 
24
- // IE9-11 hack to properly handle hyperlink underlines for breadcrumbs built
25
- // without `<ul>`s. The `::before` pseudo-element generates an element
26
- // *within* the .breadcrumb-item and thereby inherits the `text-decoration`.
27
- //
28
- // To trick IE into suppressing the underline, we give the pseudo-element an
29
- // underline and then immediately remove it.
30
- + .breadcrumb-item:hover::before {
31
- text-decoration: underline;
32
- }
33
- // stylelint-disable-next-line no-duplicate-selectors
34
- + .breadcrumb-item:hover::before {
35
- text-decoration: none;
36
- }
37
-
38
25
  &.active {
39
26
  color: $breadcrumb-active-color;
40
27
  }
@@ -1,5 +1,3 @@
1
- // stylelint-disable selector-no-qualifying-type
2
-
3
1
  // Make the div behave like a button
4
2
  .btn-group,
5
3
  .btn-group-vertical {
@@ -9,26 +7,18 @@
9
7
 
10
8
  > .btn {
11
9
  position: relative;
12
- flex: 0 1 auto;
13
-
14
- // Bring the hover, focused, and "active" buttons to the front to overlay
15
- // the borders properly
16
- @include hover {
17
- z-index: 1;
18
- }
19
- &:focus,
20
- &:active,
21
- &.active {
22
- z-index: 1;
23
- }
10
+ flex: 1 1 auto;
24
11
  }
25
12
 
26
- // Prevent double borders when buttons are next to each other
27
- .btn + .btn,
28
- .btn + .btn-group,
29
- .btn-group + .btn,
30
- .btn-group + .btn-group {
31
- margin-left: -$btn-border-width;
13
+ // Bring the hover, focused, and "active" buttons to the front to overlay
14
+ // the borders properly
15
+ > .btn-check:checked + .btn,
16
+ > .btn-check:focus + .btn,
17
+ > .btn:hover,
18
+ > .btn:focus,
19
+ > .btn:active,
20
+ > .btn.active {
21
+ z-index: 1;
32
22
  }
33
23
  }
34
24
 
@@ -44,19 +34,26 @@
44
34
  }
45
35
 
46
36
  .btn-group {
47
- > .btn:first-child {
48
- margin-left: 0;
37
+ // Prevent double borders when buttons are next to each other
38
+ > .btn:not(:first-child),
39
+ > .btn-group:not(:first-child) {
40
+ margin-left: -$btn-border-width;
49
41
  }
50
42
 
51
43
  // Reset rounded corners
52
44
  > .btn:not(:last-child):not(.dropdown-toggle),
53
45
  > .btn-group:not(:last-child) > .btn {
54
- @include border-right-radius(0);
46
+ @include border-end-radius(0);
55
47
  }
56
48
 
57
- > .btn:not(:first-child),
49
+ // The left radius should be 0 if the button is:
50
+ // - the "third or more" child
51
+ // - the second child and the previous element isn't `.btn-check` (making it the first child visually)
52
+ // - part of a btn-group which isn't the first child
53
+ > .btn:nth-child(n + 3),
54
+ > :not(.btn-check) + .btn,
58
55
  > .btn-group:not(:first-child) > .btn {
59
- @include border-left-radius(0);
56
+ @include border-start-radius(0);
60
57
  }
61
58
  }
62
59
 
@@ -78,11 +75,11 @@
78
75
 
79
76
  &::after,
80
77
  .dropup &::after,
81
- .dropright &::after {
78
+ .dropend &::after {
82
79
  margin-left: 0;
83
80
  }
84
81
 
85
- .dropleft &::before {
82
+ .dropstart &::before {
86
83
  margin-right: 0;
87
84
  }
88
85
  }
@@ -119,17 +116,14 @@
119
116
  align-items: flex-start;
120
117
  justify-content: center;
121
118
 
122
- .btn,
123
- .btn-group {
119
+ > .btn,
120
+ > .btn-group {
124
121
  width: 100%;
125
122
  }
126
123
 
127
- > .btn + .btn,
128
- > .btn + .btn-group,
129
- > .btn-group + .btn,
130
- > .btn-group + .btn-group {
124
+ > .btn:not(:first-child),
125
+ > .btn-group:not(:first-child) {
131
126
  margin-top: -$btn-border-width;
132
- margin-left: 0;
133
127
  }
134
128
 
135
129
  // Reset rounded corners
@@ -138,35 +132,8 @@
138
132
  @include border-bottom-radius(0);
139
133
  }
140
134
 
141
- > .btn:not(:first-child),
135
+ > .btn ~ .btn,
142
136
  > .btn-group:not(:first-child) > .btn {
143
137
  @include border-top-radius(0);
144
138
  }
145
139
  }
146
-
147
-
148
- // Checkbox and radio options
149
- //
150
- // In order to support the browser's form validation feedback, powered by the
151
- // `required` attribute, we have to "hide" the inputs via `clip`. We cannot use
152
- // `display: none;` or `visibility: hidden;` as that also hides the popover.
153
- // Simply visually hiding the inputs via `opacity` would leave them clickable in
154
- // certain cases which is prevented by using `clip` and `pointer-events`.
155
- // This way, we ensure a DOM element is visible to position the popover from.
156
- //
157
- // See https://github.com/twbs/bootstrap/pull/12794 and
158
- // https://github.com/twbs/bootstrap/pull/14559 for more information.
159
-
160
- .btn-group-toggle {
161
- > .btn,
162
- > .btn-group > .btn {
163
- margin-bottom: 0; // Override default `<label>` value
164
-
165
- input[type="radio"],
166
- input[type="checkbox"] {
167
- position: absolute;
168
- clip: rect(0, 0, 0, 0);
169
- pointer-events: none;
170
- }
171
- }
172
- }
@@ -1,57 +1,53 @@
1
- // stylelint-disable selector-no-qualifying-type
2
-
3
1
  //
4
2
  // Base styles
5
3
  //
6
4
 
7
5
  .btn {
8
6
  display: inline-block;
7
+ font-family: $btn-font-family;
9
8
  font-weight: $btn-font-weight;
9
+ line-height: $btn-line-height;
10
+ color: $body-color;
10
11
  text-align: center;
11
- white-space: nowrap;
12
+ text-decoration: if($link-decoration == none, null, none);
13
+ white-space: $btn-white-space;
12
14
  vertical-align: middle;
15
+ cursor: if($enable-button-pointers, pointer, null);
13
16
  user-select: none;
17
+ background-color: transparent;
14
18
  border: $btn-border-width solid transparent;
15
- @include button-size($btn-padding-y, $btn-padding-x, $font-size-base, $btn-line-height, $btn-border-radius);
19
+ @include button-size($btn-padding-y, $btn-padding-x, $btn-font-size, $btn-border-radius);
16
20
  @include transition($btn-transition);
17
21
 
18
- // Share hover and focus styles
19
- @include hover-focus {
20
- text-decoration: none;
22
+ &:hover {
23
+ color: $body-color;
24
+ text-decoration: if($link-hover-decoration == underline, none, null);
21
25
  }
22
26
 
23
- &:focus,
24
- &.focus {
27
+ .btn-check:focus + &,
28
+ &:focus {
25
29
  outline: 0;
26
30
  box-shadow: $btn-focus-box-shadow;
27
31
  }
28
32
 
29
- // Disabled comes first so active can properly restyle
30
- &.disabled,
31
- &:disabled {
32
- opacity: $btn-disabled-opacity;
33
- @include box-shadow(none);
34
- }
35
-
36
- // Opinionated: add "hand" cursor to non-disabled .btn elements
37
- &:not(:disabled):not(.disabled) {
38
- cursor: pointer;
39
- }
40
-
41
- &:not(:disabled):not(.disabled):active,
42
- &:not(:disabled):not(.disabled).active {
33
+ .btn-check:checked + &,
34
+ .btn-check:active + &,
35
+ &:active,
36
+ &.active {
43
37
  @include box-shadow($btn-active-box-shadow);
44
38
 
45
39
  &:focus {
46
40
  @include box-shadow($btn-focus-box-shadow, $btn-active-box-shadow);
47
41
  }
48
42
  }
49
- }
50
43
 
51
- // Future-proof disabling of clicks on `<a>` elements
52
- a.btn.disabled,
53
- fieldset:disabled a.btn {
54
- pointer-events: none;
44
+ &:disabled,
45
+ &.disabled,
46
+ fieldset:disabled & {
47
+ pointer-events: none;
48
+ opacity: $btn-disabled-opacity;
49
+ @include box-shadow(none);
50
+ }
55
51
  }
56
52
 
57
53
 
@@ -59,6 +55,7 @@ fieldset:disabled a.btn {
59
55
  // Alternate buttons
60
56
  //
61
57
 
58
+ // scss-docs-start btn-variant-loops
62
59
  @each $color, $value in $theme-colors {
63
60
  .btn-#{$color} {
64
61
  @include button-variant($value, $value);
@@ -70,6 +67,7 @@ fieldset:disabled a.btn {
70
67
  @include button-outline-variant($value);
71
68
  }
72
69
  }
70
+ // scss-docs-end btn-variant-loops
73
71
 
74
72
 
75
73
  //
@@ -79,27 +77,21 @@ fieldset:disabled a.btn {
79
77
  // Make a button look and behave like a link
80
78
  .btn-link {
81
79
  font-weight: $font-weight-normal;
82
- color: $link-color;
83
- background-color: transparent;
80
+ color: $btn-link-color;
81
+ text-decoration: $link-decoration;
84
82
 
85
- @include hover {
86
- color: $link-hover-color;
83
+ &:hover {
84
+ color: $btn-link-hover-color;
87
85
  text-decoration: $link-hover-decoration;
88
- background-color: transparent;
89
- border-color: transparent;
90
86
  }
91
87
 
92
- &:focus,
93
- &.focus {
88
+ &:focus {
94
89
  text-decoration: $link-hover-decoration;
95
- border-color: transparent;
96
- box-shadow: none;
97
90
  }
98
91
 
99
92
  &:disabled,
100
93
  &.disabled {
101
94
  color: $btn-link-disabled-color;
102
- pointer-events: none;
103
95
  }
104
96
 
105
97
  // No need for an active state here
@@ -111,33 +103,9 @@ fieldset:disabled a.btn {
111
103
  //
112
104
 
113
105
  .btn-lg {
114
- @include button-size($btn-padding-y-lg, $btn-padding-x-lg, $font-size-lg, $btn-line-height-lg, $btn-border-radius-lg);
106
+ @include button-size($btn-padding-y-lg, $btn-padding-x-lg, $btn-font-size-lg, $btn-border-radius-lg);
115
107
  }
116
108
 
117
109
  .btn-sm {
118
- @include button-size($btn-padding-y-sm, $btn-padding-x-sm, $font-size-sm, $btn-line-height-sm, $btn-border-radius-sm);
119
- }
120
-
121
-
122
- //
123
- // Block button
124
- //
125
-
126
- .btn-block {
127
- display: block;
128
- width: 100%;
129
-
130
- // Vertically space out multiple block buttons
131
- + .btn-block {
132
- margin-top: $btn-block-spacing-y;
133
- }
134
- }
135
-
136
- // Specificity overrides
137
- input[type="submit"],
138
- input[type="reset"],
139
- input[type="button"] {
140
- &.btn-block {
141
- width: 100%;
142
- }
110
+ @include button-size($btn-padding-y-sm, $btn-padding-x-sm, $btn-font-size-sm, $btn-border-radius-sm);
143
111
  }