Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LG-4226: Add wide button variants #192

Merged
merged 4 commits into from
Feb 26, 2021
Merged

LG-4226: Add wide button variants #192

merged 4 commits into from
Feb 26, 2021

Conversation

aduth
Copy link
Member

@aduth aduth commented Feb 25, 2021

Adds two new button variants:

  1. Minimum width occupies full width on mobile, and a minimum width on wider viewports
  2. Full width always occupies full width

Questions: (cc @anniehirshman-gsa)

  1. The Figma includes text "All buttons default to full width for mobile viewports". Should this behavior apply to the unmodified usa-button ("flexible") button, or only minimum-width and full-size buttons?
  2. The Figma mentions using btn-wide as the class for a minimum width button. As implemented here, I chose to follow the BEM convention as usa-button--wide. Is that okay?
  3. What specific breakpoint should mobile behavior stop taking effect (see USWDS "Utility breakpoints")? As implemented here is tablet.
  4. I included an explicit usa-button--full-width modifier to handle cases like in the IDP where we want full-width buttons on desktop viewports. Is that reasonable to include here, or should that be considered an exceptional case and custom to the IDP?

Screenshot:

button widths

Live Preview: https://federalist-2f194a10-945e-4413-be01-46ca6dae5358.app.cloud.gov/preview/18f/identity-style-guide/aduth-lg-4226-wide-button/components/buttons/#button-widths

Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@anniehirshman-gsa anniehirshman-gsa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! To answer your qs:

  1. The Figma includes text "All buttons default to full width for mobile viewports". Should this behavior apply to the unmodified usa-button ("flexible") button, or only minimum-width and full-size buttons? The unmodified "flexible" button should be full width on mobile as well, in alignment with USWDS defaults
  2. The Figma mentions using btn-wide as the class for a minimum width button. As implemented here, I chose to follow the BEM convention as usa-button--wide. Is that okay? Yes, whatever class name makes the most sense with our conventions. Updated in Figma
  3. What specific breakpoint should mobile behavior stop taking effect (see USWDS "Utility breakpoints")? As implemented here is tablet. Yes, tablet (640px) seems to be our current main breakpoint in the IdP between mobile and desktop layouts, but lmk if you catch inconsistencies on this because that would be good to know.
  4. I included an explicit usa-button--full-width modifier to handle cases like in the IDP where we want full-width buttons on desktop viewports. Is that reasonable to include here, or should that be considered an exceptional case and custom to the IDP? Yes this is great! Updated in Figma

@aduth
Copy link
Member Author

aduth commented Feb 26, 2021

Yes, tablet (640px) seems to be our current main breakpoint in the IdP between mobile and desktop layouts, but lmk if you catch inconsistencies on this because that would be good to know.

I checked on this more closely, and it appears that USWDS actually cuts over at mobile-lg for buttons in particular:

https://github.com/uswds/uswds/blob/1f9bb1c/src/stylesheets/elements/_buttons.scss#L24-L26

I assume we'd probably want to match that. Edit: Updated in 3203f25.

Adds two new button variants:

1. Minimum width occupies full width on mobile, and a minimum width on wider viewports
2. Full width always occupies full width
**Why**: Already full-width at small viewports
@aduth aduth merged commit 238760d into main Feb 26, 2021
@aduth aduth deleted the aduth-lg-4226-wide-button branch February 26, 2021 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants