You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

144 lines
2.7 KiB

8 years ago
// stylelint-disable selector-no-qualifying-type
8 years ago
//
// Base styles
//
.btn {
display: inline-block;
font-weight: $btn-font-weight;
text-align: center;
white-space: nowrap;
vertical-align: middle;
user-select: none;
8 years ago
border: $btn-border-width solid transparent;
@include button-size($btn-padding-y, $btn-padding-x, $font-size-base, $btn-line-height, $btn-border-radius);
8 years ago
@include transition($btn-transition);
// Share hover and focus styles
@include hover-focus {
text-decoration: none;
}
8 years ago
8 years ago
&:focus,
&.focus {
outline: 0;
box-shadow: $btn-focus-box-shadow;
}
// Disabled comes first so active can properly restyle
&.disabled,
&:disabled {
8 years ago
opacity: $btn-disabled-opacity;
8 years ago
@include box-shadow(none);
}
8 years ago
// Opinionated: add "hand" cursor to non-disabled .btn elements
&:not(:disabled):not(.disabled) {
cursor: pointer;
}
&:not(:disabled):not(.disabled):active,
&:not(:disabled):not(.disabled).active {
8 years ago
background-image: none;
8 years ago
@include box-shadow($btn-active-box-shadow);
&:focus {
@include box-shadow($btn-focus-box-shadow, $btn-active-box-shadow);
}
8 years ago
}
}
// Future-proof disabling of clicks on `<a>` elements
a.btn.disabled,
8 years ago
fieldset:disabled a.btn {
8 years ago
pointer-events: none;
}
//
// Alternate buttons
//
8 years ago
@each $color, $value in $theme-colors {
.btn-#{$color} {
@include button-variant($value, $value);
}
8 years ago
}
8 years ago
@each $color, $value in $theme-colors {
.btn-outline-#{$color} {
@include button-outline-variant($value);
}
8 years ago
}
//
// Link buttons
//
// Make a button look and behave like a link
.btn-link {
font-weight: $font-weight-normal;
color: $link-color;
8 years ago
background-color: transparent;
8 years ago
@include hover {
color: $link-hover-color;
text-decoration: $link-hover-decoration;
background-color: transparent;
8 years ago
border-color: transparent;
8 years ago
}
8 years ago
&:focus,
&.focus {
text-decoration: $link-hover-decoration;
border-color: transparent;
box-shadow: none;
}
&:disabled,
&.disabled {
color: $btn-link-disabled-color;
8 years ago
}
8 years ago
// No need for an active state here
8 years ago
}
//
// Button Sizes
//
.btn-lg {
8 years ago
@include button-size($btn-padding-y-lg, $btn-padding-x-lg, $font-size-lg, $btn-line-height-lg, $btn-border-radius-lg);
8 years ago
}
8 years ago
8 years ago
.btn-sm {
8 years ago
@include button-size($btn-padding-y-sm, $btn-padding-x-sm, $font-size-sm, $btn-line-height-sm, $btn-border-radius-sm);
8 years ago
}
//
// Block button
//
.btn-block {
display: block;
width: 100%;
8 years ago
// Vertically space out multiple block buttons
+ .btn-block {
margin-top: $btn-block-spacing-y;
}
8 years ago
}
// Specificity overrides
input[type="submit"],
input[type="reset"],
input[type="button"] {
&.btn-block {
width: 100%;
}
}