Skip to content

Ensure primary button in button group has its border appear #2583

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

Merged
merged 1 commit into from
May 6, 2025

Conversation

emma-sg
Copy link
Member

@emma-sg emma-sg commented May 1, 2025

Changes

Adds a couple CSS rules that make a primary button in a button group show up above a secondary button next to it, which allows the primary button's border to show on its right side instead of the secondary button's border.

Also color-matches the left border of the button to the primary button's right to the primary button's border color, so that when transitioning on hover the transition happens from the primary border color to the default hover border color, rather than from the default border color.1

Screenshots

Before After
Screenshot 2025-05-01 at 4 12 23 PM Screenshot 2025-05-01 at 4 12 07 PM

Footnotes

  1. This isn't quite perfect: because this just sets the border color, there's a 45 degree angle on the top and bottom of the left border that's visible for however long the animation takes, but this is ~half a pixel and only visible for a moment.

default button it's next to
this leads to a more consistent-looking button group

also color-matches the left border of the button to the primary button's
right to the primary button's border color, so that when transitioning
on hover the transition happens from the primary border color to the
default hover border color, rather than from the default border color.
@emma-sg emma-sg requested a review from SuaYoo May 1, 2025 20:20
Copy link
Member

@SuaYoo SuaYoo left a comment

Choose a reason for hiding this comment

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

Nice touch!

@SuaYoo
Copy link
Member

SuaYoo commented May 5, 2025

Would be a good one to add to Storybook.

@emma-sg emma-sg merged commit 4ce769e into main May 6, 2025
27 checks passed
@emma-sg emma-sg deleted the frontend-button-group-ordering branch May 6, 2025 00:24
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.

2 participants