design-system icon indicating copy to clipboard operation
design-system copied to clipboard

cfpb-buttons: m-btn-group needs to add a row gap when buttons wrap

Open anselmbradford opened this issue 1 year ago • 4 comments

Describe the bug

If buttons appear in a m-btn-group and the buttons wrap (for example at small screen sizes), then the gap between the buttons is too tight.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://cfpb.github.io/design-system/components/buttons
  2. Inspect the page and edit the markup around groups of buttons to add a wrapper m-btn-group div.
  3. See at smaller screen sizes when the buttons wrap that they don't have a row gap between each other. Additionally, the wrapped button gets indented on a new line.
Screenshot 2024-05-02 at 10 24 57 AM

@sonnakim for awareness

anselmbradford avatar May 02 '24 14:05 anselmbradford

Next step: Check to see if there's a button group (more than 2 adjacent buttons) on cf.gov and if this bug is happening on that page @sonnakim

sonnakim avatar Jun 27 '24 18:06 sonnakim

I checked using our internal cfgov scraper/crawler, and it looks like the only page where an instance of more than 2 buttons occurs on our site is Before You Claim. It looks fine? A screenshot of that page at 400px width (mobile) is below. Screenshot 2024-06-27 at 3 15 19 PM

@anselmbradford I'll close this, but feel free to reopen if there's anything else you'd want to check, or if you want this left open as a wont-fix.

sonnakim avatar Jun 27 '24 19:06 sonnakim

@sonnakim I'd leave it open. If you visit the DS on our phones, for example, it has that spaceless wrapping on the buttons page. We may not have enough buttons on the site to trigger this, but we could and the pattern should handle it. I'd recommend the button-group CSS be updated to be flexbox with a 6px gap and ditch the margin-left technique that's currently being used.

anselmbradford avatar Jun 27 '24 22:06 anselmbradford

Ans and I discussed this. We'd want to rewrite using Flexbox when moving to web components. Will put on hold for now.

sonnakim avatar Jul 10 '24 17:07 sonnakim