Skip to content

Commit

Permalink
fix(buttons): make use of currentColor (#62)
Browse files Browse the repository at this point in the history
* Make use of currentColor

To allow customer branding to cascade

* Revert form-control-focus changes

* currentColor cannot override color

* Fix btn-alert:hover:active background

* Fix navbar hover background

* Remove commented out rule

Co-authored-by: Dan Matthew <dm@talis.com>

* More use of currentColor

* Navbar outline should use currentColor

* Fix btn-alert underline and hover color

* btn-link should have transparent border

Co-authored-by: Dan Matthew <dm@talis.com>
  • Loading branch information
Camille Fenton and danielmatthew authored Oct 5, 2020
1 parent d98769f commit 40cb629
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 23 deletions.
3 changes: 1 addition & 2 deletions assets/stylesheets/bootstrap/_button-groups.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@
.btn-group .dropdown-toggle:active,
.btn-group.open .dropdown-toggle {
outline: 0;
border-color: $brand-primary;
// box-shadow: 0 0 0 1px $brand-primary;
border-color: currentColor;
}


Expand Down
22 changes: 11 additions & 11 deletions assets/stylesheets/bootstrap/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ a.btn {
.btn-default,
.btn-success,
.btn-warning {
@include button-variant-plain($btn-default-color, $btn-default-bg, $btn-default-border);
@include button-variant-plain($btn-default-color, $btn-default-bg);
}
// Appears in Talis turqoise
.btn-primary {
Expand All @@ -78,12 +78,12 @@ a.btn {

// Info appears as pink
.btn-info {
@include button-variant-plain($btn-default-color, $btn-default-bg, $btn-default-border);
@include button-variant-plain($btn-default-color, $btn-default-bg);
}

// Danger and error appear as a plain button with red text...
.btn-danger {
@include button-variant-plain($btn-danger-color, $btn-danger-bg, $btn-danger-color);
@include button-variant-plain($btn-danger-color, $btn-danger-bg);
}

.btn-alert {
Expand All @@ -96,8 +96,8 @@ a.btn {

// Make a button look and behave like a link
.btn-link {
font-weight: 400;
color: $link-color;
border-color: transparent;
font-weight: 600;

&,
Expand All @@ -115,26 +115,26 @@ a.btn {
}

&:hover {
border-color: $btn-default-border;
border-color: currentColor;
background-color: $gray200;
}

&:focus {
border-color: $btn-default-color;
border-color: currentColor;
background-color: transparent;
box-shadow: 0px 0px 0px 1px $btn-default-border;
box-shadow: 0px 0px 0px 1px currentColor;
}

&:hover:focus {
background-color: $gray200;
border-color: $btn-default-color;
box-shadow: 0px 0px 0px 1px $btn-default-border;
border-color: currentColor;
box-shadow: 0px 0px 0px 1px currentColor
}

&:active {
background-color: $gray200;
border-color: $btn-default-color;
box-shadow: 0px 0px 0px 1px $btn-default-border;
border-color: currentColor;
box-shadow: 0px 0px 0px 1px currentColor;
}

&[disabled],
Expand Down
6 changes: 3 additions & 3 deletions assets/stylesheets/bootstrap/_navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
}

&:focus {
outline: 2px solid $white;
outline: 2px solid currentColor;
outline-offset: -2px;
}

Expand Down Expand Up @@ -433,9 +433,9 @@
color: $navbar-default-link-color;

&:focus {
outline: 2px solid $white;
outline: 2px solid currentColor;
outline-offset: -2px;
background-color: $navbar-default-bg;
background-color: inherit;
}

&:hover {
Expand Down
2 changes: 1 addition & 1 deletion assets/stylesheets/bootstrap/_scaffolding.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ a {

&:focus {
text-decoration: none;
outline: 1px solid $link-hover-color;
outline: 1px solid currentColor;
}
}

Expand Down
6 changes: 6 additions & 0 deletions assets/stylesheets/bootstrap/mixins/_alerts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,10 @@
a {
color: $text-color;
}
.btn-alert {
text-decoration: none;
&:hover {
color: $white !important;
}
}
}
16 changes: 10 additions & 6 deletions assets/stylesheets/bootstrap/mixins/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// Easily pump out default styles, as well as :hover, :focus, :active,
// and disabled options for all buttons

@mixin button-variant-plain($color, $background, $border) {
@mixin button-variant-plain($color, $background) {
color: $color;
background-color: $background;
border-color: $border;
border-color: currentColor;

&:hover {
background-color: #E9ECEF;
Expand All @@ -17,13 +17,13 @@
&.focus {
color: darken(saturate(adjust-hue($color, -0.2776), 1.4706), 7.0588);
background-color: $background;
border-color: darken(saturate(adjust-hue($color, -0.2776), 1.4706), 7.0588);;
box-shadow: 0px 0px 0px 1px $color;
border-color: currentColor;
box-shadow: 0px 0px 0px 1px currentColor;
}

&:focus:hover {
background-color: #E9ECEF;
box-shadow: 0px 0px 0px 1px $color;
box-shadow: 0px 0px 0px 1px currentColor;
}

&:active,
Expand All @@ -35,7 +35,7 @@
&:focus,
&.focus {
background-color: #E9ECEF;
box-shadow: 0px 0px 0px 1px $color;
box-shadow: 0px 0px 0px 1px currentColor;
}
}

Expand Down Expand Up @@ -199,6 +199,10 @@
background-image: none;
}

&:hover:active {
background-color: $black;
}

&.disabled,
&[disabled],
fieldset[disabled] {
Expand Down

0 comments on commit 40cb629

Please sign in to comment.