Button code cleanup (#22951)

* use a mixin there
* revamp .btn-link to match default and outline variants
* remove unnecessary properties
This commit is contained in:
Mark Otto 2017-08-13 14:55:28 -07:00 committed by GitHub
parent bb0cab9f10
commit cd22eb1da0
3 changed files with 37 additions and 39 deletions

View File

@ -10,7 +10,6 @@
> .btn {
position: relative;
flex: 0 1 auto;
margin-bottom: 0;
// Bring the hover, focused, and "active" buttons to the front to overlay
// the borders properly
@ -66,15 +65,18 @@
.btn-group > .btn-group {
float: left;
}
.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0;
}
.btn-group > .btn-group:first-child:not(:last-child) {
> .btn:last-child,
> .dropdown-toggle {
@include border-right-radius(0);
}
}
.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {
@include border-left-radius(0);
}
@ -129,7 +131,6 @@
//
.btn-group-vertical {
display: inline-flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
@ -146,30 +147,35 @@
margin-top: -$input-btn-border-width;
margin-left: 0;
}
}
.btn-group-vertical > .btn {
&:not(:first-child):not(:last-child) {
border-radius: 0;
> .btn {
&:not(:first-child):not(:last-child) {
border-radius: 0;
}
}
&:first-child:not(:last-child) {
@include border-bottom-radius(0);
}
&:last-child:not(:first-child) {
@include border-top-radius(0);
}
}
.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0;
}
.btn-group-vertical > .btn-group:first-child:not(:last-child) {
> .btn:last-child,
> .dropdown-toggle {
@include border-bottom-radius(0);
> .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0;
}
> .btn-group:first-child:not(:last-child) {
> .btn:last-child,
> .dropdown-toggle {
@include border-bottom-radius(0);
}
}
> .btn-group:last-child:not(:first-child) > .btn:first-child {
@include border-top-radius(0);
}
}
.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {
@include border-top-radius(0);
}

View File

@ -71,36 +71,28 @@ fieldset[disabled] a.btn {
.btn-link {
font-weight: $font-weight-normal;
color: $link-color;
background-color: transparent;
border-radius: 0;
&,
&:active,
&.active,
&:disabled {
background-color: transparent;
@include box-shadow(none);
}
&,
&:focus,
&:active {
border-color: transparent;
box-shadow: none;
}
@include hover {
border-color: transparent;
}
@include hover-focus {
color: $link-hover-color;
text-decoration: $link-hover-decoration;
background-color: transparent;
border-color: transparent;
}
&:disabled {
color: $btn-link-disabled-color;
@include hover-focus {
text-decoration: none;
}
&:focus,
&.focus {
border-color: transparent;
box-shadow: none;
}
&:disabled,
&.disabled {
color: $btn-link-disabled-color;
}
// No need for an active state here
}

View File

@ -9,7 +9,7 @@
border-color: $border;
@include box-shadow($btn-box-shadow);
&:hover {
@include hover {
@include color-yiq($background);
background-color: $active-background;
border-color: $active-border;