diff --git a/CHANGELOG.md b/CHANGELOG.md index 714e36e2..09e0dca5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ ## Unreleased +### New Features + +- Add variant support for danger outline buttons. ([#383](https://github.com/18F/identity-style-guide/pull/383)) + +### Bug Fixes + +- Improve consistency with USWDS disabled buttons styles. ([#383](https://github.com/18F/identity-style-guide/pull/383)) + - [USWDS v3.5.0](https://github.com/uswds/uswds/releases/tag/v3.5.0) removed `.usa-button--disabled` styling in favor of `[aria-disabled="true"]`. This wasn't documented as a breaking change, and it's expected the any `.usa-button--disabled` usage would not be stylized correctly since those changes. You should replace any usage of `usa-button--disabled` with either the `[disabled]` or `[aria-disabled="true"]` attributes. + ### Dependencies - Update USWDS from v3.6.1 to v3.7.0. ([#381](https://github.com/18F/identity-style-guide/pull/381)) diff --git a/docs/_components/buttons.md b/docs/_components/buttons.md index a637a681..7c14f2c8 100644 --- a/docs/_components/buttons.md +++ b/docs/_components/buttons.md @@ -57,6 +57,20 @@ subnav: +### Danger Outline + +```html + + + + + + + ### Unstyled ```html @@ -115,6 +129,20 @@ subnav: +### Danger Outline + +```html + + + + + + + ### Unstyled ```html diff --git a/src/scss/packages/usa-button/src/_overrides.scss b/src/scss/packages/usa-button/src/_overrides.scss index 265b18e4..cc6d0c2e 100644 --- a/src/scss/packages/usa-button/src/_overrides.scss +++ b/src/scss/packages/usa-button/src/_overrides.scss @@ -43,7 +43,7 @@ $button-stroke-big: inset 0 0 0 units($theme-button-stroke-width * 2); } &:disabled, - &.usa-button--disabled { + &[aria-disabled='true'] { background-color: color('white'); color: color('disabled'); } @@ -62,7 +62,7 @@ $button-stroke-big: inset 0 0 0 units($theme-button-stroke-width * 2); } &:disabled, - &.usa-button--disabled { + &[aria-disabled='true'] { box-shadow: $button-stroke-big color('disabled'); } @@ -94,6 +94,46 @@ $button-stroke-big: inset 0 0 0 units($theme-button-stroke-width * 2); &.usa-button--active { background-color: color('secondary-darkest'); } + + &.usa-button--outline { + &:not(:disabled, [aria-disabled='true']) { + background-color: color('white'); + box-shadow: inset 0 0 0 $theme-button-stroke-width color('secondary'); + color: color('secondary'); + + &.usa-button--big { + box-shadow: $button-stroke-big color('secondary'); + } + + &:hover, + &.usa-button--hover { + background-color: color('secondary-lightest'); + box-shadow: inset 0 0 0 $theme-button-stroke-width color('secondary-dark'); + color: color('secondary-dark'); + + &.usa-button--big { + box-shadow: $button-stroke-big color('secondary-dark'); + } + } + } + + &:active, + &.usa-button--active { + &, + &:focus, + &.usa-button--focus, + &:hover, + &.usa-button--hover { + background-color: color('secondary-lighter'); + box-shadow: inset 0 0 0 $theme-button-stroke-width color('secondary-darker'); + color: color('secondary-darker'); + + &.usa-button--big { + box-shadow: $button-stroke-big color('secondary-darker'); + } + } + } + } } .usa-button--inverse { @@ -117,7 +157,7 @@ $button-stroke-big: inset 0 0 0 units($theme-button-stroke-width * 2); } &:disabled, - &.usa-button--disabled { + &[aria-disabled='true'] { background-color: color('disabled'); color: color('white'); }