cfpb / design-system

CFPB's work-in-progress design system
https://cfpb.github.io/design-system
Creative Commons Zero v1.0 Universal
41 stars 13 forks source link

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

Closed anselmbradford closed 6 days ago

anselmbradford commented 6 months ago

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

sonnakim commented 4 months ago

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 commented 4 months ago

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.

anselmbradford commented 4 months ago

@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.

sonnakim commented 3 months ago

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