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
Remove right negative margin from pinned items #57666
Conversation
Size Change: -32 B (0%) Total Size: 1.69 MB
ℹ️ View Unchanged
|
@jasmussen will know for sure but I think this style may have been added to visually balance the position of the icons accounting for the minimal Options (ellipsis) icon. For me the inconsistent spacing between these buttons is equally awkward, so I would approve of this change because it simplifies things a little. But let's see what Joen says. |
Yes that's right. The vertical ellipsis due to the thinness of the icon is better optically balanced with the negative margin. We used the negative margin instead of a smaller width, to keep the touchable footprint of the ellipsis the same size. I wonder if there's a better way to document this aspect of the vertical ellipsis button. |
I do agree there's potential for simplification here. What if the ellipsis button was always 24x32? Or what if the ellipsis button had a |
@jasmussen @jameskoster Thank you for your wonderful review.
It will look something like this: Narrowed the button width from 32px to 24px and removed the negative margin on the left element. Furthermore, since the Option button appears to be closer to the right side, I added 4px to the padding on the right side. Personally, I find this style a little cramped 😅 |
Feels cramped to me only when focused, whereas the resting state which you'd see most of the time feels off balance. Would the negative left/right margins on the ellipsis have any side effects? Or does it have to be a negative left margin on the ellipsis, since presumably the ellipsis is always last in a series? |
The only method I can think of is to add a style to the button component that applies the negative margin to the last button in a series when the icon is an ellipsis. But that's not bullet-proof because an ellipsis could appear next to a group of buttons in a container, in which case the negative margin wouldn't be applied. It seems very tricky to write a style that will account for all situations, but if there's a smarter way to build this behavior into the component then it would be good to explore. Otherwise it doesn't feel worth the hassle to me. There will always be circumstances where the negative margin isn't applied which creates inconsistency. |
Personally, I'm hesitant to put negative margin on the The main reason I submitted this PR is that when I enable "Show button text labels", the spaces between the buttons look very cramped. For example, how about an approach that overrides the current negative margin to zero only when "Show button text labels" is enabled? |
It seems like there are some strong preferences for being generic and not having exceptions, I think @richtabor also stumbled on this, so I'm happy to defer to you all on this. |
@jasmussen @jameskoster Thank you for your deep insight. I would like to merge this PR, but there may be an opportunity to reconsider this negative margin in the future. |
What?
This PR removes the negative margin on the right from pinned items in the header. This should ensure that all icons have the same gap of 8px.
Why?
This style was added in #40411 to fix gaps, but now it seems unnecessary.
Testing Instructions
Try a scenario like the one below.
To test Custom Pinner Item, run the code below in your browser console.
Post Editor:
Site Editor:
Screenshots or screencast