Repository navigation
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.
…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?
| 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.
There was a problem hiding this comment.
I tried this, but it fails typecheck: onValueChange receives SelectItem from @wordpress/ui, whose value is typed string | null, so the check is needed to narrow it before calling onJustificationChange. I've kept it as is.
|
Thanks! The gap between the Justification select and the Orientation toggles is currently |
|
This one looks ready to merge. Should we land it, @WordPress/gutenberg-design ? |
ciampo
left a comment
There was a problem hiding this comment.
This is close. I left one non-blocking note inline.
On the onValueChange null check: the current version is right. SelectItem.value is string | null, so if ( selectedItem ) alone fails typecheck. Also, selectedItem itself can be null at runtime, because Base UI resets the value when the option list changes. So that check is needed either way.
t-hamano
left a comment
There was a problem hiding this comment.
This could be handled as a follow-up, but we might want to refine the labels a bit more to improve consistency.
In the Stack layout, a single legacy Stretch item is mixed in among Left, Center, and Right. I think this should be Stretch.
In the Constrained layout, the toolbar displays Left, Center, Right, but the inspector still uses the legacy labels. I think we should update the legacy labels to match the new ones.
|
Agree on "Stretch" rather than "Stretch items" |
…dd/buttons-block-space-justification-options
…dd/buttons-block-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! I've left two minor suggestions, but everything else looks good to me.




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