-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fix: More resilient appender CSS. #28908
Conversation
Size Change: -2 B (0%) Total Size: 1.38 MB
ℹ️ View Unchanged
|
@jasmussen do you have a before and after screenshot(s)? It'd help to 👀 what we should be looking for. |
a95bce0
to
a309b12
Compare
Thanks for looking. When you create a submenu item, items are aligned better. Before: After: However the change applies to all appenders, and in most cases they should just look the same as before. I'm careful mostly because margin changes inside flex containers are usually adventurous. |
a309b12
to
bb73b51
Compare
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.
Thanks @jasmussen for the extra context! I smoke tested a bit in the navigation block and columns in FF and Chrome. The change here feels pretty safe, though I did notice that we're a couple pixels off if we're trying to left-align to submenu text:
One other thing I noticed that doesn't need to be addressed here, is that other appenders (including container blocks) are right-aligned. Not sure if this is just a quirk of the navigation block since the length of the links determine the submenu width.
Great observation. I think the high level behavior being discussed in #26404 might be the best way to address that. In the mean time, I'm going to land this one as an improvement. Thank you! |
Description
This is a followup to #28904, and fixes #28906.
How has this been tested?
Please test any block that uses nesting, but notably buttons, social links, navigation, and navigation submenus. Also test group and columns. The appender button both on hover and click should show up appropriately in all cases.
Screenshots
Types of changes
The Appender component has several shapes and forms. A full dedicated one that sits inside an empty group, a small plus that sits at the right of an empty paragraph, and the small plus that sits at the end of nesting containers.
One factor that adds complexity to this appender is that a bug in Firefox means that the
<li>
element has to be clickalbe, in addition to the<button>
inside. This is one of the issues that #28464 meant to improve, ensuring that the list item and the button inside share the same space, so the focus style is appropriate.Add to that the complexity of this button needing to be able to work in both vertical (default) contexts, as well as horizontal (buttons, social links) contexts. Some of these are flex containers, others are not, and in the case of flex containers, margins play a big role. A right margin of anything other than
auto
, will right align it.#28906 was specifically caused because the right margin of the appender container was zero, but on hover, an ancestor became
flex
.So there's not a lot in this PR, other than more explicit margins from the getgo.
Checklist: