Skip to content

Commit

Permalink
LG-4226: Fix double focus ring (#190)
Browse files Browse the repository at this point in the history
This pull request seeks to resolve an issue where focused buttons appear with two focus rings. The button styles included in the design system intend to unset the inherited focus styles from USWDS, but are not of high enough specificity to override the styles.

Reference: https://github.com/uswds/uswds/blob/1f9bb1cc/src/stylesheets/global/_focus.scss#L1-L11
  • Loading branch information
aduth committed Feb 25, 2021
1 parent 93747d7 commit ca8c31c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Unreleased

### Bug Fixes

- Fix an issue where focused buttons appear with a double focus ring style.

## 4.0.0

### Breaking Changes
Expand Down
14 changes: 7 additions & 7 deletions src/scss/components/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
color: color('white');
}

&:focus,
&.usa--focus {
&:not([disabled]):focus,
&:not([disabled]).usa-focus {
outline-offset: units(0.5);
}

Expand All @@ -27,8 +27,8 @@
}
}

.usa-button:focus,
.usa-button.usa-focus {
.usa-button:not([disabled]):focus,
.usa-button:not([disabled]).usa-focus {
@include disable-default-focus-styles;
box-shadow: roundable-focus-outline-box-shadows();
}
Expand All @@ -43,8 +43,8 @@
color: color('primary');
}

&:focus,
&.usa-focus {
&:not([disabled]):focus,
&:not([disabled]).usa-focus {
box-shadow: $button-stroke color('primary'), roundable-focus-outline-box-shadows();
}

Expand Down Expand Up @@ -224,4 +224,4 @@
color: color('primary');
text-decoration: none;
}
}
}

0 comments on commit ca8c31c

Please sign in to comment.