-
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
Blocks: Extract and factorize block alignment controls #1019
Conversation
Is this different in purpose than #987 ? How does it relate? |
Isn't #987 about text alignments? or do you think we can reuse it? |
#987 is mainly toward a goal of letting alignment be a consideration of the block as a whole, not individual paragraphs. So seems similar in purpose to what you've proposed here, though your changes include a handful more blocks. |
But don't you think we should keep distinction between TextAlignmentToolbar and BlockAlignmentToolbar ? Even if the internals are close, and could share some code, having two different components could be a good thing. |
Hmm, what would be the practical difference between the two? Seems they only really vary in the icons they render. Both assume a callback is to be passed to specify the actual change implementation. |
yes, the icons are the only differences but sometimes it's good to duplicate code for clarity. A component could have both. These are the two toolbars we have for now, but we may have other reusable toolbars a block author could use. I see them as a meaningful group of controls instead of a more generic toolbar component with maybe unrelated controls to pick. Anyway, this is just an idea, the generic "toggle" toolbar is a possibility too. |
Yeah, not so opposed to the idea of duplication as much as questioning whether a distinction between text alignment vs. block alignment is really one we care to make, or is in-fact more clear. Maybe cc @jasmussen @mtias to this point. |
I'm keen to move these two (PRs #987 and this one) forward to remove the |
6dd1048
to
0a6f728
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.
Dunno if we might want to hold off on this in our push toward a stable release this week since it's not really fixing or adding anything.
}, | ||
wide: { | ||
icon: 'align-full-width', | ||
title: wp.i18n.__( 'Wide width' ), |
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.
Consistency: __
title: __( 'Align right' ), | ||
}, | ||
wide: { | ||
icon: 'align-full-width', |
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 think we want icon: 'align-wide'
0a6f728
to
597af75
Compare
Ok to postpone :) |
597af75
to
705da6c
Compare
Rebased, should be ok to review. Let's get this merged before the plugin release
This PR continues our Refactoring to move the controls to the
edit
function.Testing instructions