Skip to content

Commit

Permalink
Apply hover styling consistently to focused buttons
Browse files Browse the repository at this point in the history
The recently-added `button-hover` mixin, used by the base `button`
mixin and thus inherited by other button mixins, applied hover styling
to focused buttons, but other button mixins that adjust hover styling
were not applying hover styling to focused buttons.

Update mixins to consistently apply hovered styling to focused buttons

Fixes #2610
  • Loading branch information
lyzadanger committed Oct 6, 2020
1 parent bf9a06f commit 484b4f1
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/styles/mixins/buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
&[aria-pressed='true'] {
color: var.$color-brand;

&:hover:not([disabled]) {
&:hover:not([disabled]),
&:focus:not([disabled]) {
color: var.$color-brand;
}
}
Expand All @@ -84,7 +85,8 @@
font-weight: 700;
background-color: var.$grey-1;

&:hover:not([disabled]) {
&:hover:not([disabled]),
&:focus:not([disabled]) {
background-color: var.$grey-2;
}

Expand All @@ -103,7 +105,8 @@
color: var.$color-text--inverted;
background-color: var.$grey-mid;

&:hover:not([disabled]) {
&:hover:not([disabled]),
&:focus:not([disabled]) {
color: var.$color-text--inverted;
background-color: var.$grey-6;
}
Expand Down Expand Up @@ -137,7 +140,8 @@
border-radius: 0; // Turn off border-radius to align with <input> edges
border-left: 0; // Avoid double border with the <input>

&:hover:not([disabled]) {
&:hover:not([disabled]),
&:focus:not([disabled]) {
background-color: var.$grey-2;
}
}
Expand All @@ -149,7 +153,8 @@
@include button;
color: var.$grey-mid;
padding: 0;
&:hover:not([disabled]) {
&:hover:not([disabled]),
&:focus:not([disabled]) {
color: var.$color-link-hover;
text-decoration: underline;
}
Expand Down

0 comments on commit 484b4f1

Please sign in to comment.