|
19 | 19 | &:focus,
|
20 | 20 | &.focus,
|
21 | 21 | .btn-input:focus + &,
|
22 |
| - .btn-input:active + & { |
| 22 | + .btn-input:not(:disabled):active + & { |
23 | 23 | color: color-yiq($hover-background);
|
24 | 24 | @include gradient-bg($hover-background);
|
25 | 25 | border-color: $hover-border;
|
|
33 | 33 |
|
34 | 34 | // Disabled comes first so active can properly restyle
|
35 | 35 | &.disabled,
|
36 |
| - &:disabled { |
| 36 | + &:disabled, |
| 37 | + .btn-input:disabled + & { |
37 | 38 | color: color-yiq($background);
|
38 | 39 | background-color: $background;
|
39 | 40 | border-color: $border;
|
|
45 | 46 |
|
46 | 47 | &:not(:disabled):not(.disabled):active,
|
47 | 48 | &:not(:disabled):not(.disabled).active,
|
48 |
| - .btn-input:checked + &, |
49 |
| - .btn-input:active + &, |
| 49 | + .btn-input:not(:disabled):checked + &, |
| 50 | + .btn-input:not(:disabled):active + &, |
50 | 51 | .show > &.dropdown-toggle {
|
51 | 52 | color: color-yiq($active-background);
|
52 | 53 | background-color: $active-background;
|
|
64 | 65 | }
|
65 | 66 | }
|
66 | 67 | }
|
| 68 | + |
| 69 | + // Duplicate the disabled styles again specifically to |
| 70 | + // override the previous :active styles, as button-like |
| 71 | + // checkbox/radio buttons can't be excluded generically |
| 72 | + // from the previous set of selectors |
| 73 | + .btn-input:disabled + &:active { |
| 74 | + color: color-yiq($background); |
| 75 | + background-color: $background; |
| 76 | + border-color: $border; |
| 77 | + // Remove CSS gradients if they're enabled |
| 78 | + @if $enable-gradients { |
| 79 | + background-image: none; |
| 80 | + } |
| 81 | + } |
67 | 82 | }
|
68 | 83 |
|
69 | 84 | @mixin button-outline-variant($color, $color-hover: color-yiq($color), $active-background: $color, $active-border: $color) {
|
|
80 | 95 | &:focus,
|
81 | 96 | &.focus,
|
82 | 97 | .btn-input:focus + &,
|
83 |
| - .btn-input:active + & { |
| 98 | + .btn-input:not(:disabled):active + & { |
84 | 99 | box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
|
85 | 100 | }
|
86 | 101 |
|
87 | 102 | &.disabled,
|
88 |
| - &:disabled { |
| 103 | + &:disabled, |
| 104 | + .btn-input:disabled + &, |
| 105 | + .btn-input:not(:disabled) + &:active { |
89 | 106 | color: $color;
|
90 | 107 | background-color: transparent;
|
91 | 108 | }
|
92 | 109 |
|
93 | 110 | &:not(:disabled):not(.disabled):active,
|
94 | 111 | &:not(:disabled):not(.disabled).active,
|
95 |
| - .btn-input:checked + &, |
96 |
| - .btn-input:active + &, |
| 112 | + .btn-input:not(:disabled):checked + &, |
| 113 | + .btn-input:not(:disabled):active + &, |
97 | 114 | .show > &.dropdown-toggle {
|
98 | 115 | color: color-yiq($active-background);
|
99 | 116 | background-color: $active-background;
|
|
108 | 125 | }
|
109 | 126 | }
|
110 | 127 | }
|
| 128 | + |
| 129 | + // Duplicate the disabled styles again specifically to |
| 130 | + // override the previous :active styles, as button-like |
| 131 | + // checkbox/radio buttons can't be excluded generically |
| 132 | + // from the previous set of selectors |
| 133 | + .btn-input:disabled + &:active { |
| 134 | + color: $color; |
| 135 | + background-color: transparent; |
| 136 | + } |
111 | 137 | }
|
112 | 138 |
|
113 | 139 | // Button sizes
|
|
0 commit comments