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

Add button link example | Correctly vertically align button group link buttons #2085

Merged
merged 3 commits into from
Oct 31, 2024

Conversation

anselmbradford
Copy link
Member

@anselmbradford anselmbradford commented Oct 31, 2024

If a button is accompanied by a button link, the m-btn-group sets them to flexbox, but doesn't vertically align them.

This PR sets the vertical alignment to align-items: center.

Changes

  • Add button link example to buttons page.
  • Correctly vertically align button group link buttons.
  • Set the button hover color, so that if a link is set as a button, don't change the button text on hover.

Testing

  1. See the button link example at https://deploy-preview-2085--cfpb-design-system.netlify.app/design-system/components/buttons#button-link

Copy link

netlify bot commented Oct 31, 2024

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

Name Link
🔨 Latest commit 7f38dc7
🔍 Latest deploy log https://app.netlify.com/sites/cfpb-design-system/deploys/6723ae74bd533400083b7282
😎 Deploy Preview https://deploy-preview-2085--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.

@@ -5,4 +5,5 @@
display: flex;
gap: math.div(10px, $base-font-size-px) + rem;
flex-wrap: wrap;
align-items: center;
Copy link
Member Author

Choose a reason for hiding this comment

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

We could also consider align-items: baseline for this, so that the button text and link text bottoms are aligned with each other.

Copy link
Member

Choose a reason for hiding this comment

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

IMHO baseline looks better

@anselmbradford anselmbradford merged commit e496180 into main Oct 31, 2024
8 checks passed
@anselmbradford anselmbradford deleted the ans_btn_align branch October 31, 2024 20:27
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.

2 participants