3 // Easily pump out default styles, as well as :hover, :focus, :active,
4 // and disabled options for all buttons
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);
10 @include box-shadow($btn-box-shadow);
13 color: color-yiq($hover-background);
14 @include gradient-bg($hover-background);
15 border-color: $hover-border;
20 // Avoid using mixin so we can pass custom focus shadow properly
22 box-shadow: $btn-box-shadow, 0 0 0 $btn-focus-width rgba($border, .5);
24 box-shadow: 0 0 0 $btn-focus-width rgba($border, .5);
28 // Disabled comes first so active can properly restyle
31 background-color: $background;
32 border-color: $border;
35 &:not([disabled]):not(.disabled):active,
36 &:not([disabled]):not(.disabled).active,
37 .show > &.dropdown-toggle {
38 color: color-yiq($active-background);
39 background-color: $active-background;
40 @if $enable-gradients {
41 background-image: none; // Remove the gradient for the pressed/active state
43 border-color: $active-border;
46 // Avoid using mixin so we can pass custom focus shadow properly
48 box-shadow: $btn-active-box-shadow, 0 0 0 $btn-focus-width rgba($border, .5);
50 box-shadow: 0 0 0 $btn-focus-width rgba($border, .5);
56 @mixin button-outline-variant($color, $color-hover: #fff, $active-background: $color, $active-border: $color) {
58 background-color: transparent;
59 background-image: none;
63 color: color-yiq($color);
64 background-color: $active-background;
65 border-color: $active-border;
70 box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
76 background-color: transparent;
79 &:not([disabled]):not(.disabled):active,
80 &:not([disabled]):not(.disabled).active,
81 .show > &.dropdown-toggle {
82 color: color-yiq($color-hover);
83 background-color: $active-background;
84 border-color: $active-border;
85 // Avoid using mixin so we can pass custom focus shadow properly
86 box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
91 @mixin button-size($padding-y, $padding-x, $font-size, $line-height, $border-radius) {
92 padding: $padding-y $padding-x;
93 font-size: $font-size;
94 line-height: $line-height;
95 // Manually declare to provide an override to the browser default
97 border-radius: $border-radius;