Repository navigation
Add space-around and space-evenly justification options - #71129
Sukhendu2002 wants to merge 20 commits into
Conversation
|
Nice PR, this seems valid to me, and I can potentially help with some icons. Before we go about that, I'd love broader input, @WordPress/gutenberg-design what do you think about these options? |
|
I’m echoing @jasmussen, @Sukhendu2002; for me, this is quite valid. However, within the themesdesign channel, we concluded that while |
|
I think |
Same here. I think the only real concern I'd have is how dense the justification controls might feel, but adding one more sounds reasonable to me. If adding it to the flex layout, comparable changes will also need to be added to some PHP files for layout and navigation, I believe: E.g: gutenberg/packages/block-library/src/navigation/index.php Lines 562 to 567 in a1b9f58 And: gutenberg/lib/block-supports/layout.php Lines 421 to 427 in d398d64 |
|
Apologies for the delay, long days. I found some time and shared some designs in #42536 (comment). |
|
Hi @Sukhendu2002, do you have the bandwidth to work on this PR? In addition to resolving code conflicts, we need to address the following tasks:
|
85817e8 to
e6ef0e0
Compare
f1f4636 to
e13d9a9
Compare
|
Thanks @t-hamano! Conflicts are resolved, the panel design and PHP/Navigation support are updated, and tests were added. Trac: https://core.trac.wordpress.org/ticket/66172. Core backport: WordPress/wordpress-develop#13710. Ready for re-review. |
t-hamano
left a comment
There was a problem hiding this comment.
Thanks for the update! However, I think there are still a few areas that need to be updated.
gutenberg/docs/explanations/architecture/styles.md
Lines 541 to 544 in 5523d7b
gutenberg/packages/block-library/src/buttons/editor.scss
Lines 37 to 42 in 5523d7b
gutenberg/packages/block-library/src/buttons/style.scss
Lines 61 to 66 in 5523d7b
gutenberg/packages/block-library/src/buttons/style.scss
Lines 45 to 47 in 5523d7b
gutenberg/packages/block-library/src/common.scss
Lines 81 to 83 in 5523d7b
Additionally, we also need to consider whether we should change the default control for JustifyContentControl.
a2c3aa0 to
88ccb1d
Compare
t-hamano
left a comment
There was a problem hiding this comment.
Thanks for the update! I think it's almost complete, but I found a few more areas that need updating.
gutenberg/packages/block-library/src/page-list/editor.scss
Lines 3 to 5 in d74f838
gutenberg/packages/block-library/src/navigation/style.scss
Lines 461 to 467 in d74f838
gutenberg/schemas/json/block.json
Lines 448 to 454 in d74f838
…ver all options in tests
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the |
t-hamano
left a comment
There was a problem hiding this comment.
@Sukhendu2002 Thanks for the update!
The current UI doesn't have an icon, but in my opinion, it should have one.
@WordPress/gutenberg-design, here are a few potential variations—which one do you think is best? Personally, I think displaying the label, description, and icon together would be the clearest.
|
Agree on showing the icon. The descriptions I'm less sure about. They add a lot of weight and kind of repeat the label in more words—I'm uncertain how helpful they are as an addition. At a push, including them for the less obvious options might work, but I'm unconvinced. Not a strong opinion though; if y'all think they're helpful then I don't object. It might be nice to show the icon in the trigger too. |
|
Agree with Jay, the description adds too much information |
|
Can we start without the descriptions to land this PR, see if it floats, and then ponder whether we add the descriptions back as a followup? |
|
@Sukhendu2002, can you resolve the conflicts and try using the icon + label pattern (without the description)? |
…space-justification-options
t-hamano
left a comment
There was a problem hiding this comment.
Thanks for the update! From a code perspective, I think this PR is complete, but from a design standpoint, there still seems to be room for discussion.
It might be nice to show the icon in the trigger too.
Personally, I prefer removing the icons from the trigger because the full text might not be displayed, making it hard to read.
If we remove the icon, we should be able to restore this gap—which was narrowed to 4px—back to 16px. In other words, it will look like this:
Another approach might be to stop placing Justification and Orientation side by side. Either way, I look forward to hearing your ideas.
…space-justification-options # Conflicts: # packages/block-editor/CHANGELOG.md
t-hamano
left a comment
There was a problem hiding this comment.
@Sukhendu2002 Thanks for the update! As far as I can tell, this PR looks ready to ship. @tellthemachines @andrewserong @jasmussen, could you take another look?
There was a problem hiding this comment.
Nit: I don't think this test is necessary. It only asserts that the labels of the default allowedControls array are rendered in order, which essentially mirrors a constant.
| value={ selectedOption } | ||
| isItemEqualToValue={ ( item, value ) => item.value === value.value } | ||
| onValueChange={ ( selectedItem ) => { | ||
| if ( selectedItem && selectedItem.value !== null ) { |
There was a problem hiding this comment.
| if ( selectedItem && selectedItem.value !== null ) { | |
| if ( selectedItem ) { |
Nit: The value of each option is always a string, so the null check isn't needed.




What?
Closes: #42536
This PR adds support for
space-aroundandspace-evenlyCSS flexbox justify-content values to the Buttons block.Why?
Currently, the Buttons block only supports basic justification options (left, center, right, space-between). Adding
space-aroundandspace-evenlygives users more precise control over button spacing and alignment, especially useful for creating balanced layouts with multiple buttons.Testing Instructions
Screenshots or screencast