2016-01-26 21:12:48 +03:00
|
|
|
// from bs mixins/buttons button-variant
|
2016-03-21 17:56:51 +03:00
|
|
|
@mixin bmd-button-variant($color, $background, $focus-background, $active-background, $border, $focus-border, $active-border) {
|
2016-01-26 21:12:48 +03:00
|
|
|
color: $color;
|
|
|
|
background-color: $background;
|
|
|
|
border-color: $border;
|
|
|
|
|
|
|
|
@include hover {
|
|
|
|
color: $color;
|
|
|
|
background-color: $focus-background;
|
|
|
|
border-color: $focus-border;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:focus,
|
|
|
|
&.focus {
|
|
|
|
color: $color;
|
|
|
|
background-color: $focus-background;
|
|
|
|
border-color: $focus-border;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:active,
|
|
|
|
&.active,
|
|
|
|
.open > &.dropdown-toggle {
|
|
|
|
color: $color;
|
|
|
|
background-color: $focus-background;
|
|
|
|
border-color: $focus-border;
|
|
|
|
|
|
|
|
&:hover,
|
|
|
|
&:focus,
|
|
|
|
&.focus {
|
|
|
|
color: $color;
|
|
|
|
background-color: $active-background;
|
|
|
|
border-color: $active-border;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// when it is an icon, kill the active bg on open dropdown, but stabilize on hover
|
2016-03-21 17:56:51 +03:00
|
|
|
.open > &.dropdown-toggle.bmd-btn-icon {
|
2016-01-26 21:12:48 +03:00
|
|
|
color: inherit;
|
|
|
|
background-color: $background;
|
|
|
|
|
|
|
|
// leave hover on with the lighter focus color
|
|
|
|
&:hover {
|
|
|
|
background-color: $focus-background;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.disabled,
|
|
|
|
&:disabled {
|
|
|
|
&:focus,
|
|
|
|
&.focus {
|
|
|
|
background-color: $background;
|
|
|
|
border-color: $border;
|
|
|
|
}
|
|
|
|
@include hover {
|
|
|
|
background-color: $background;
|
|
|
|
border-color: $border;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-08-03 19:49:32 +03:00
|
|
|
@mixin bmd-flat-button-variant(
|
|
|
|
$color,
|
|
|
|
$border: $bmd-btn-border,
|
|
|
|
$focus-border: $bmd-btn-focus-bg,
|
|
|
|
$active-border: $bmd-btn-active-bg
|
|
|
|
) {
|
2016-03-28 23:18:19 +03:00
|
|
|
$background: $bmd-btn-bg;
|
|
|
|
$focus-background: $bmd-btn-focus-bg;
|
|
|
|
$active-background: $bmd-btn-active-bg;
|
2016-01-26 21:12:48 +03:00
|
|
|
|
2016-03-21 17:56:51 +03:00
|
|
|
@include bmd-button-variant($color,
|
2016-01-26 21:12:48 +03:00
|
|
|
$background,
|
|
|
|
$focus-background,
|
|
|
|
$active-background,
|
|
|
|
$border,
|
|
|
|
$focus-border,
|
|
|
|
$active-border);
|
|
|
|
|
|
|
|
// inverse color scheme
|
|
|
|
.bg-inverse & {
|
2016-03-28 23:18:19 +03:00
|
|
|
$focus-background: $bmd-inverse-btn-focus-bg;
|
|
|
|
$focus-border: $bmd-inverse-btn-focus-bg;
|
2016-01-26 21:12:48 +03:00
|
|
|
|
2016-03-28 23:18:19 +03:00
|
|
|
$active-background: $bmd-inverse-btn-active-bg;
|
|
|
|
$active-border: $bmd-inverse-btn-active-bg;
|
2016-01-26 21:12:48 +03:00
|
|
|
|
2016-03-21 17:56:51 +03:00
|
|
|
@include bmd-button-variant($color,
|
2016-01-26 21:12:48 +03:00
|
|
|
$background,
|
|
|
|
$focus-background,
|
|
|
|
$active-background,
|
|
|
|
$border,
|
|
|
|
$focus-border,
|
|
|
|
$active-border);
|
|
|
|
}
|
|
|
|
|
|
|
|
// reverse the above for links
|
|
|
|
&.btn-link {
|
|
|
|
background-color: transparent;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-21 17:56:51 +03:00
|
|
|
@mixin bmd-flat-button-color() {
|
2016-03-28 23:18:19 +03:00
|
|
|
@include bmd-flat-button-variant($bmd-btn-color);
|
2016-01-26 21:12:48 +03:00
|
|
|
|
|
|
|
// flat bg with text color variations
|
|
|
|
&.btn-primary {
|
2016-03-21 17:56:51 +03:00
|
|
|
@include bmd-flat-button-variant($btn-primary-bg);
|
2016-01-26 21:12:48 +03:00
|
|
|
}
|
|
|
|
&.btn-secondary {
|
2016-03-21 17:56:51 +03:00
|
|
|
@include bmd-flat-button-variant($btn-secondary-color);
|
2016-01-26 21:12:48 +03:00
|
|
|
}
|
|
|
|
&.btn-info {
|
2016-03-21 17:56:51 +03:00
|
|
|
@include bmd-flat-button-variant($btn-info-bg);
|
2016-01-26 21:12:48 +03:00
|
|
|
}
|
|
|
|
&.btn-success {
|
2016-03-21 17:56:51 +03:00
|
|
|
@include bmd-flat-button-variant($btn-success-bg);
|
2016-01-26 21:12:48 +03:00
|
|
|
}
|
|
|
|
&.btn-warning {
|
2016-03-21 17:56:51 +03:00
|
|
|
@include bmd-flat-button-variant($btn-warning-bg);
|
2016-01-26 21:12:48 +03:00
|
|
|
}
|
|
|
|
&.btn-danger {
|
2016-03-21 17:56:51 +03:00
|
|
|
@include bmd-flat-button-variant($btn-danger-bg);
|
2016-01-26 21:12:48 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-08-03 19:49:32 +03:00
|
|
|
@mixin bmd-outline-button-color() {
|
|
|
|
&.btn-outline,
|
|
|
|
&.btn-outline-primary,
|
|
|
|
&.btn-outline-secondary,
|
|
|
|
&.btn-outline-info,
|
|
|
|
&.btn-outline-success,
|
|
|
|
&.btn-outline-warning,
|
|
|
|
&.btn-outline-danger {
|
|
|
|
border-color: currentColor;
|
|
|
|
border-style: solid;
|
|
|
|
border-width: 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
// flat bg with text and border color variations
|
|
|
|
&.btn-outline {
|
|
|
|
@include bmd-flat-button-variant($bmd-btn-color, $bmd-btn-color, $bmd-btn-color, $bmd-btn-color);
|
|
|
|
}
|
|
|
|
&.btn-outline-primary {
|
|
|
|
@include bmd-flat-button-variant($btn-primary-bg, $btn-primary-bg, $btn-primary-bg, $btn-primary-bg);
|
|
|
|
}
|
|
|
|
&.btn-outline-secondary {
|
|
|
|
@include bmd-flat-button-variant($btn-secondary-color, $btn-secondary-color, $btn-secondary-color, $btn-secondary-color);
|
|
|
|
}
|
|
|
|
&.btn-outline-info {
|
|
|
|
@include bmd-flat-button-variant($btn-info-bg, $btn-info-bg, $btn-info-bg, $btn-info-bg);
|
|
|
|
}
|
|
|
|
&.btn-outline-success {
|
|
|
|
@include bmd-flat-button-variant($btn-success-bg, $btn-success-bg, $btn-success-bg, $btn-success-bg);
|
|
|
|
}
|
|
|
|
&.btn-outline-warning {
|
|
|
|
@include bmd-flat-button-variant($btn-warning-bg, $btn-warning-bg, $btn-warning-bg, $btn-warning-bg);
|
|
|
|
}
|
|
|
|
&.btn-outline-danger {
|
|
|
|
@include bmd-flat-button-variant($btn-danger-bg, $btn-danger-bg, $btn-danger-bg, $btn-danger-bg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-21 17:56:51 +03:00
|
|
|
@mixin bmd-raised-button-variant($color, $background, $border) {
|
2016-01-26 21:12:48 +03:00
|
|
|
// FIXME: SPEC - this should be the 600 color, how can we get that programmatically if at all? Or are we limited to the color palette only?
|
2017-08-11 17:59:31 +03:00
|
|
|
$focus-background: contrast-color(
|
|
|
|
$background,
|
|
|
|
darken($background, 4%),
|
|
|
|
lighten($background, 4%)
|
|
|
|
);
|
2016-01-26 21:12:48 +03:00
|
|
|
//$focus-background: darken($background, 10%); // default bootstrap
|
|
|
|
$focus-border: darken($border, 12%);
|
|
|
|
|
|
|
|
$active-background: $focus-background;
|
|
|
|
//$active-background: darken($background, 17%);
|
|
|
|
$active-border: darken($border, 25%);
|
|
|
|
|
2016-03-21 17:56:51 +03:00
|
|
|
@include bmd-button-variant($color,
|
2016-01-26 21:12:48 +03:00
|
|
|
$background,
|
|
|
|
$focus-background,
|
|
|
|
$active-background,
|
|
|
|
$border,
|
|
|
|
$focus-border,
|
|
|
|
$active-border);
|
|
|
|
}
|
|
|
|
|
2016-03-21 17:56:51 +03:00
|
|
|
@mixin bmd-raised-button-color() {
|
2016-01-26 21:12:48 +03:00
|
|
|
&.btn-primary {
|
2017-05-03 14:14:10 +03:00
|
|
|
@include bmd-raised-button-variant($btn-primary-color, $btn-primary-bg, $btn-primary-border-color);
|
2016-01-26 21:12:48 +03:00
|
|
|
}
|
|
|
|
&.btn-secondary {
|
2017-05-03 14:14:10 +03:00
|
|
|
@include bmd-raised-button-variant($btn-secondary-color, $btn-secondary-bg, $btn-secondary-border-color);
|
2016-01-26 21:12:48 +03:00
|
|
|
}
|
|
|
|
&.btn-info {
|
2017-05-03 14:14:10 +03:00
|
|
|
@include bmd-raised-button-variant($btn-info-color, $btn-info-bg, $btn-info-border-color);
|
2016-01-26 21:12:48 +03:00
|
|
|
}
|
|
|
|
&.btn-success {
|
2017-05-03 14:14:10 +03:00
|
|
|
@include bmd-raised-button-variant($btn-success-color, $btn-success-bg, $btn-success-border-color);
|
2016-01-26 21:12:48 +03:00
|
|
|
}
|
|
|
|
&.btn-warning {
|
2017-05-03 14:14:10 +03:00
|
|
|
@include bmd-raised-button-variant($btn-warning-color, $btn-warning-bg, $btn-warning-border-color);
|
2016-01-26 21:12:48 +03:00
|
|
|
}
|
|
|
|
&.btn-danger {
|
2017-05-03 14:14:10 +03:00
|
|
|
@include bmd-raised-button-variant($btn-danger-color, $btn-danger-bg, $btn-danger-border-color);
|
2016-01-26 21:12:48 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin undo-bs-tab-focus() {
|
|
|
|
// clear out the tab-focus() from BS
|
|
|
|
&,
|
|
|
|
&:active,
|
|
|
|
&.active {
|
|
|
|
&:focus,
|
|
|
|
&.focus {
|
|
|
|
//@include tab-focus();
|
|
|
|
outline: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|