-
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
Add/transform button to buttons #20063
Add/transform button to buttons #20063
Conversation
This is my first pull request. @talldan instructed me to open a pull request. I'm not sure if i should add any developer documentation, and if that's the case, where should it be placed? And this doesn't affect any React Native files, right? |
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.
This is working well for me. I have tested with three button blocks and tried transforming a single one, two and all three. Works well every time, keeping all attributes of individual buttons.
Regarding docs or native, I believe they are not needed here as this is no change in public APIs that other components use.
Testing snippet I have used:
<!-- wp:button {"backgroundColor":"very-dark-gray","textColor":"very-light-gray"} -->
<div class="wp-block-button"><a class="wp-block-button__link has-text-color has-very-light-gray-color has-background has-very-dark-gray-background-color" href="http://wordpress.org">Button 1</a></div>
<!-- /wp:button -->
<!-- wp:button {"backgroundColor":"very-light-gray","textColor":"pale-pink"} -->
<div class="wp-block-button"><a class="wp-block-button__link has-text-color has-pale-pink-color has-background has-very-light-gray-background-color" href="http://wp.org">Button 2</a></div>
<!-- /wp:button -->
<!-- wp:button {"backgroundColor":"vivid-cyan-blue","textColor":"very-light-gray"} -->
<div class="wp-block-button"><a class="wp-block-button__link has-text-color has-very-light-gray-color has-background has-vivid-cyan-blue-background-color" href="http://github.com">Button 3</a></div>
<!-- /wp:button -->
@Ringish congrats on your first merged pull request! It looks like there are no failing tests, so I was wrong about that. I think the test I referred to on slack must have been removed. I noticed you've also been looking at fixes for some other issues, thanks for your work on those. I'd recommend also creating pull requests for those if you can, that's generally the easiest way to get feedback on your code. One other little bit of feedback is that I added |
Description
Fixes #19919.
Adds possibility to transform single button blocks to buttons as described in #19919.
How has this been tested?
Screenshots
Types of changes
New feature (non-breaking change which adds functionality)
Checklist: