-
Notifications
You must be signed in to change notification settings - Fork 4.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
Try: Allow space between on menu items. #28169
Conversation
Size Change: +91 B (0%) Total Size: 1.28 MB
ℹ️ View Unchanged
|
This will solve #27132 |
At the very least, I think the justification setting should not display for the vertical variation. It would be nice to add a height option to the vertical variant, and then allow for vertical spacing options. |
93d95c3
to
8823ef6
Compare
I refactored the code to use icons from the icon library. That means the following icons are now available to use elsewhere:
One hiccup, and it explains why the space between icon does not show up as active when selected. The following code sets the active icon in the toolbar:
What it does is basically compare the list of icons ( It works for But it breaks for I feel like this is needlessly complex, and there should be a far simpler way of matching the value to icons. @draganescu I know you worked on this, if you have a moment, any thoughts on how to best fix this? Would this work?
I'll keep tinkering in the mean time, but would appreciate pointers! |
@mkaz Once we land this one, it would be nice to refactor this alignment dropdown so it's easy to port to Social Links, for example, that would solve #17275. CC: @ntsekouras as I think I recall you thinking about the same. |
Okay, I got it working: But it's an ugly hack that can almost certainly be made much prettier. Shield your eyes: e34ef36#diff-610616a7f92cf5567753ff6e54b42e95ffd4b9607984b72c814f56279e87fff4R62 If anyone who's less tired than I am would like to help me refactor that to something nicer, I'd much appreciate it. In the mean time, this should be ready for reviews! |
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.
I tested this and it works great. If we merge this I'd remove the toolbar item for the vertical variation and make a separate issue to see how to handle item spacing in that case. Left a nitpick about obtaining the className for space-between
.
Cool work!
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 for working on this Joen! I chimed in and made buttons
use these nice new icons you created, for consistency.
In general as we have already discussed, we should make in the future a generic component for this: #28169 (comment)
The only reason I'm not approving now is that I pushed code as well. I believe it's ready to 🚢 though.
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.
I left a comment about your "ugly hack" feel free to switch using lodash kebab case if you want, but I don't see it as necessary since it also adds a small dependency, either way is fine.
This looks good, and I'll review the other issues to see what is next to get this implemented for the social links. 👍
This PR tries to add
space-between
to the navigation menu as an option. I also updated the icons. It works fine. Before:After:
Here are the icons:
What's missing?
Penny for your thoughts?