2014-12-02 17:02:35 -05:00
|
|
|
// Button variants
|
|
|
|
//
|
|
|
|
// Easily pump out default styles, as well as :hover, :focus, :active,
|
|
|
|
// and disabled options for all buttons
|
|
|
|
|
2017-07-02 02:14:00 -04:00
|
|
|
@mixin button-variant($background, $border, $active-background: darken($background, 7.5%), $active-border: darken($border, 10%)) {
|
2017-06-18 05:57:16 -04:00
|
|
|
@include color-yiq($background);
|
2014-12-02 17:02:35 -05:00
|
|
|
background-color: $background;
|
|
|
|
border-color: $border;
|
2016-01-09 18:27:56 -05:00
|
|
|
@include box-shadow($btn-box-shadow);
|
2014-12-02 17:02:35 -05:00
|
|
|
|
2017-08-13 17:55:28 -04:00
|
|
|
@include hover {
|
2017-06-18 05:57:16 -04:00
|
|
|
@include color-yiq($background);
|
2015-01-01 04:05:01 -05:00
|
|
|
background-color: $active-background;
|
2016-12-26 17:42:29 -05:00
|
|
|
border-color: $active-border;
|
2015-01-01 04:05:01 -05:00
|
|
|
}
|
2017-06-18 13:53:27 -04:00
|
|
|
|
2015-08-22 22:05:43 -04:00
|
|
|
&:focus,
|
|
|
|
&.focus {
|
2016-12-27 17:50:33 -05:00
|
|
|
// Avoid using mixin so we can pass custom focus shadow properly
|
|
|
|
@if $enable-shadows {
|
2017-04-09 00:24:03 -04:00
|
|
|
box-shadow: $btn-box-shadow, 0 0 0 3px rgba($border, .5);
|
2016-12-27 17:50:33 -05:00
|
|
|
} @else {
|
2017-04-09 00:24:03 -04:00
|
|
|
box-shadow: 0 0 0 3px rgba($border, .5);
|
2016-12-27 17:50:33 -05:00
|
|
|
}
|
2016-12-26 17:42:29 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// Disabled comes first so active can properly restyle
|
|
|
|
&.disabled,
|
|
|
|
&:disabled {
|
|
|
|
background-color: $background;
|
|
|
|
border-color: $border;
|
2014-12-02 17:02:35 -05:00
|
|
|
}
|
2015-08-22 22:05:43 -04:00
|
|
|
|
2014-12-02 17:02:35 -05:00
|
|
|
&:active,
|
|
|
|
&.active,
|
2016-12-26 17:42:29 -05:00
|
|
|
.show > &.dropdown-toggle {
|
2015-08-22 22:05:43 -04:00
|
|
|
background-color: $active-background;
|
2016-12-26 17:42:29 -05:00
|
|
|
background-image: none; // Remove the gradient for the pressed/active state
|
2016-12-26 17:52:39 -05:00
|
|
|
border-color: $active-border;
|
2016-01-09 18:14:36 -05:00
|
|
|
@include box-shadow($btn-active-box-shadow);
|
2014-12-02 17:02:35 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-16 16:02:52 -04:00
|
|
|
@mixin button-outline-variant($color, $color-hover: #fff) {
|
2015-08-10 02:45:36 -04:00
|
|
|
color: $color;
|
2015-08-18 02:43:25 -04:00
|
|
|
background-color: transparent;
|
2017-03-18 16:06:05 -04:00
|
|
|
background-image: none;
|
2015-08-10 02:45:36 -04:00
|
|
|
border-color: $color;
|
|
|
|
|
2016-02-15 06:50:10 -05:00
|
|
|
@include hover {
|
2016-09-16 16:02:52 -04:00
|
|
|
color: $color-hover;
|
2016-02-15 06:50:10 -05:00
|
|
|
background-color: $color;
|
2016-12-26 17:42:29 -05:00
|
|
|
border-color: $color;
|
2016-02-15 06:50:10 -05:00
|
|
|
}
|
|
|
|
|
2015-08-10 02:45:36 -04:00
|
|
|
&:focus,
|
2016-02-15 06:50:10 -05:00
|
|
|
&.focus {
|
2017-04-09 00:24:03 -04:00
|
|
|
box-shadow: 0 0 0 3px rgba($color, .5);
|
2016-12-26 17:42:29 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
&.disabled,
|
|
|
|
&:disabled {
|
|
|
|
color: $color;
|
|
|
|
background-color: transparent;
|
2015-08-10 02:45:36 -04:00
|
|
|
}
|
2016-02-15 06:50:10 -05:00
|
|
|
|
|
|
|
&:active,
|
|
|
|
&.active,
|
2016-12-26 17:42:29 -05:00
|
|
|
.show > &.dropdown-toggle {
|
2016-09-16 16:02:52 -04:00
|
|
|
color: $color-hover;
|
2015-08-10 02:45:36 -04:00
|
|
|
background-color: $color;
|
2016-12-26 17:42:29 -05:00
|
|
|
border-color: $color;
|
2015-08-10 02:45:36 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-12-02 17:02:35 -05:00
|
|
|
// Button sizes
|
2017-03-28 12:28:27 -04:00
|
|
|
@mixin button-size($padding-y, $padding-x, $font-size, $line-height, $border-radius) {
|
2015-08-14 02:04:16 -04:00
|
|
|
padding: $padding-y $padding-x;
|
2014-12-02 17:02:35 -05:00
|
|
|
font-size: $font-size;
|
2017-03-28 12:28:27 -04:00
|
|
|
line-height: $line-height;
|
2014-12-02 17:02:35 -05:00
|
|
|
@include border-radius($border-radius);
|
|
|
|
}
|