-
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
Add Transformation from Separator to Spacer #66230
Add Transformation from Separator to Spacer #66230
Conversation
Merge latest updates of trunk to feat/seprator-transform-spacer branch
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @[email protected]. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If 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. |
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @rudrakshi-gupta! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
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 your contribution and the very well written PR description.
I think the one thing missing that would be good to add is a transform the other way from spacer to separator. Usually as a rule of thumb blocks can be transformed both ways.
Thanks for the feedback! I agree, it makes sense to include a transformation from spacer to separator as well. I'll work on adding that functionality to ensure the blocks can be transformed both ways. |
- Remove the default height of 50px after transformation to default 100px that of Spacer - Update the transform of blocks so that it retains anchor attribute
Thanks for making those changes. This is looking good to me, except it looks like there are unit tests failing (https://github.com/WordPress/gutenberg/actions/runs/11434042367/job/31806942028?pr=66230). It should hopefully only be a matter of adding the block titles of the new transform options to these places and then this PR will be good to merge:
|
@talldan Thanks for the feedback! I’ve added the new block titles to both Please let me know if there’s anything else needed! |
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 all your work here!
(Congrats on your first PR contribution!)
* Add a transform from the Separator block to the Spacer block * Add a transform from the Separator block to the Spacer block Feat WordPress#65492 * Add transformation from spacer to separator - Remove the default height of 50px after transformation to default 100px that of Spacer - Update the transform of blocks so that it retains anchor attribute * Add new transformation block titles in Test * Add new transformation block titles in Test * Add new transformation block titles in Test and resolve linting problem * Add new transformation block titles in Test and resolve linting problem * Update test suite snapshot for test [mobile] to pass successfully --------- Co-authored-by: talldan <[email protected]> Co-authored-by: rudrakshi-gupta <[email protected]>
What?
This PR introduces a transform for converting
Separator
blocks intoSpacer
blocks, providing better control over white space in content.Why?
This PR addresses the issue of outdated content that contains excessive use of hr elements, which are being converted into
Separator
blocks during migration to the Block Editor. Many users relied on hr for spacing, but transitioning toSpacer
blocks gives more control and helps achieve a cleaner, modern design with better-managed whitespace.How?
A transform has been added to convert
Separator
blocks intoSpacer
blocks. Specifically, the transform generates a Spacer block with a default height of 50px, replacing the Separator block and offering more flexibility in controlling spacing between content sectionsTesting Instructions
Separator
Block:Separator
block to your content.Separator
block selected, look at the block toolbar (just above the block).Spacer
to transform theSeparator
block into aSpacer
block.Spacer
block is correctly added and that the default height is set to 50px. You can view this in the block settings on the right-hand panel.Feel free to explore further by adjusting the height in the block inspector to ensure everything works as expected!
Testing Instructions for Keyboard
Separator
Block:Separator
block.Separator
block.Spacer
block option.Separator
block into aSpacer
block.Spacer
block settings and verify that the height has been set to50px
.Screenshots or screencast