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

Refactor buttons and pagination to fix alignment issues #2091

Merged
merged 9 commits into from
Nov 6, 2024

Conversation

anselmbradford
Copy link
Member

@anselmbradford anselmbradford commented Nov 5, 2024

Refactor buttons to have less reliance on markup structure and classes, to simplify markup and fix alignment issues.

Removals

  • a-btn__icon--on-left and a-btn__icon--on-right classes.

Changes

  • Refactor buttons to fix alignment issues
  • Remove a-btn__text and a-btn__icon classes and instead target the text and icon with .a-btn span and .a-btn svg.
  • Update buttons to use flexbox and pagination to use grid and flexbox.

Testing

  1. Compare https://deploy-preview-2091--cfpb-design-system.netlify.app/design-system/components/pagination and https://deploy-preview-2091--cfpb-design-system.netlify.app/design-system/components/buttons to production.

Screenshots

Before
Screenshot 2024-11-05 at 10 34 53 AM

Screenshot 2024-11-05 at 10 34 10 AM

Note that the "Back" is too close to the divider.

After
Screenshot 2024-11-05 at 10 34 41 AM

^ Practically, this shouldn't show up. It's showing up here because the container for the pagination can be very narrow on the DS. This should probably use a container query, but for now, this just fixes the clipping that happens in the current version.

Screenshot 2024-11-05 at 10 34 26 AM

Notes

  • There's a current a11y error on the pagination page where the label has a for attribute and shouldn't. This PR fixes that.

Copy link

netlify bot commented Nov 5, 2024

Thanks for the improvements! Browse a preview of your changes using the link below.

Name Link
🔨 Latest commit f936fe7
🔍 Latest deploy log https://app.netlify.com/sites/cfpb-design-system/deploys/672baa163eeb110008a6c845
😎 Deploy Preview https://deploy-preview-2091--cfpb-design-system.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@anselmbradford anselmbradford changed the title Refactor buttons to fix alignment issues Refactor buttons and pagination to fix alignment issues Nov 5, 2024
Copy link
Member

@contolini contolini left a comment

Choose a reason for hiding this comment

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

Looks so much better 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants