diff --git a/CHANGELOG.md b/CHANGELOG.md index e41aa88e..d200a690 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,10 @@ - Before: Hover and active colors are both `primary-darker`. - After: Hover is `primary-dark`, and active is `primary-darker`. - Improved support for "Unstyled" button variant ([see documentation](https://design.login.gov/components/buttons/)) -- Add two new wide-width button variants `usa-button--wide` and `usa-button--full-width`. +- Add three new button variants to control width: + - `usa-button--wide` displays a button at a wider (minimum) width at larger viewport displays. + - `usa-button--flexible-width` displays a button at flexible width regardless of viewport size, and overrides default mobile appearance of full-width buttons. + - `usa-button--full-width` displays a button at full width regardless of viewport size, and overrides default desktop appearance of flexible-width buttons. ### Bug Fixes diff --git a/docs/_components/buttons.md b/docs/_components/buttons.md index 88f45a86..3a311926 100644 --- a/docs/_components/buttons.md +++ b/docs/_components/buttons.md @@ -137,6 +137,16 @@ Default button width for desktop viewports. +Use `usa-button--flexible-width` to set flexible width buttons for mobile. + +```html + + + + ### Minimum width Use `usa-button--wide` to set a minimum button width for desktop viewports. diff --git a/src/scss/components/_buttons.scss b/src/scss/components/_buttons.scss index 8ee78ff8..dc60fa09 100644 --- a/src/scss/components/_buttons.scss +++ b/src/scss/components/_buttons.scss @@ -126,6 +126,10 @@ } } +.usa-button--flexible-width { + width: auto; +} + .usa-button--wide { @include at-media('mobile-lg') { min-width: 14rem;