aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2017-08-13 14:55:28 -0700
committerGitHub <[email protected]>2017-08-13 14:55:28 -0700
commitcd22eb1da03d5dbc9062ad5c9e75c05429e4bcd0 (patch)
tree0ce08d97def778c8a344eded3a243bea5c9801a6
parentbb0cab9f10c4716e01972e9404849deb9f2882ca (diff)
downloadbootstrap-cd22eb1da03d5dbc9062ad5c9e75c05429e4bcd0.tar.xz
bootstrap-cd22eb1da03d5dbc9062ad5c9e75c05429e4bcd0.zip
Button code cleanup (#22951)
* use a mixin there * revamp .btn-link to match default and outline variants * remove unnecessary properties
-rw-r--r--scss/_button-group.scss40
-rw-r--r--scss/_buttons.scss32
-rw-r--r--scss/mixins/_buttons.scss2
3 files changed, 36 insertions, 38 deletions
diff --git a/scss/_button-group.scss b/scss/_button-group.scss
index 30a14d883..406350682 100644
--- a/scss/_button-group.scss
+++ b/scss/_button-group.scss
@@ -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);
}
diff --git a/scss/_buttons.scss b/scss/_buttons.scss
index 607f24a2d..a708560b3 100644
--- a/scss/_buttons.scss
+++ b/scss/_buttons.scss
@@ -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 {
+ @include hover {
+ color: $link-hover-color;
+ text-decoration: $link-hover-decoration;
background-color: transparent;
- @include box-shadow(none);
+ border-color: transparent;
}
- &,
+
&:focus,
- &:active {
+ &.focus {
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;
- }
- &:disabled {
- color: $btn-link-disabled-color;
- @include hover-focus {
- text-decoration: none;
- }
+ &:disabled,
+ &.disabled {
+ color: $btn-link-disabled-color;
}
+
+ // No need for an active state here
}
diff --git a/scss/mixins/_buttons.scss b/scss/mixins/_buttons.scss
index f7ec5764e..312a18f1d 100644
--- a/scss/mixins/_buttons.scss
+++ b/scss/mixins/_buttons.scss
@@ -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;