-
Notifications
You must be signed in to change notification settings - Fork 2k
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
ButtonGroup component: fix hover/focus styles #74620
base: trunk
Are you sure you want to change the base?
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Async-loaded Components (~1 bytes removed 📉 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍🏻
There's just one glitch which I'm not sure is even relevant but when clicking on an un-scary button so it is active and then hovering over the item next to it still has the missing left border (see video below; you don't see the click unfortunately).
Screen.Recording.2023-03-29.at.15.40.23.mov
Excellent spot @flootr! This only seems to happen when the non-scary button has :focus styles applied, and then the following scary button has :hover. I'll see if I can come up with a fix. |
Could this bug be solved by forcing the hovered/focused button to have a temporarily higher z-index? |
That's a smart idea - thanks @ciampo! I'll give that a try. |
Proposed Changes
When using a Calypso ButtonGroup, the left border of a button does not match when hovering/focusing it:
This is particularly noticeable on a 'scary' button, which has a red border.
This PR fixes the focus and hover styles for buttons within a button group so that the entire border of the current button is the same color:
Testing Instructions
Head to http://calypso.localhost:3000/devdocs/design/button-group and try hovering over/interacting with a button. Ensure that the hovered/focused button has a continuous border in the same color.
To try this component in a real world situation, take a look at http://calypso.localhost:3000/comments/all/ and try to bulk edit comments. The spam and trash buttons here should also now show a continuous border.
Pre-merge Checklist