Skip to content
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

resolve avatar block alignment issue. #67419

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

NidhiDhandhukiya74
Copy link

What?

Resolve the mentioned issue of :- #56706
This pull request resolves an issue where the Avatar block is not properly center-aligned in the editor when the "Link to user profile" option is enabled. The alignment issue primarily affects themes like Twenty Seventeen, Twenty Nineteen, Twenty Sixteen, and Twenty Twenty-One. However, the alignment works as expected in Twenty Twenty-Two and Twenty Twenty-Three.

why

The problem occurs because the necessary CSS styles to center the Avatar block are missing in the editor. This leads to inconsistent alignment behavior across themes when the block is center-aligned. Since this is an editor-side issue, the fix must first be implemented in the Gutenberg plugin to ensure proper alignment before checking for any related issues in the core.

Testing Instructions

Setup:
Use one of the affected themes: Twenty Seventeen, Twenty Nineteen, Twenty Sixteen, or Twenty Twenty-One.
Ensure the Gutenberg plugin is activated.

Steps to Reproduce:
Add an Avatar Block to a post or page in the editor.
Enable the "Link to user profile" option in the block settings.
Center-align the Avatar block using the alignment controls in the block toolbar.

Expected Behavior:
The Avatar block should appear centered in both the editor and the frontend.
The alignment issue should no longer persist across affected themes.

Additional Verification:
Repeat the same steps with themes like Twenty Twenty-Two and Twenty Twenty-Three to confirm that the fix does not introduce any regressions in themes where the alignment already works correctly.

Copy link

github-actions bot commented Nov 29, 2024

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: NidhiDhandhukiya74 <[email protected]>
Co-authored-by: Mayank-Tripathi32 <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Nov 29, 2024
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @NidhiDhandhukiya74! 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.

@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended [Block] Avatar Affects the Avatar Block labels Nov 29, 2024
@Mayank-Tripathi32
Copy link
Contributor

This resolves the align center issue in classic themes, but I noticed that align right is not working in block-based themes in editor view. I'll create a separate issue to address this.

@NidhiDhandhukiya74 NidhiDhandhukiya74 force-pushed the resolve-alignment-in-avatar branch from 5e837af to 2c38d25 Compare December 6, 2024 10:39
@NidhiDhandhukiya74
Copy link
Author

Hello @Mayank-Tripathi32

In your Pr you have added solution for align-right but you have not added my code which is for align center in classic themes.
so I have combined the code so that it will resolve both the issue.

@Mayank-Tripathi32
Copy link
Contributor

Hello @Mayank-Tripathi32

In your Pr you have added solution for align-right but you have not added my code which is for align center in classic themes. so I have combined the code so that it will resolve both the issue.

Hello, I have made some modifications in #67494, which fixes the wrapper itself instead of adding css. Please have a look.

cc: @NidhiDhandhukiya74

.components-resizable-box__container {
margin: 0 auto;
}
}

.wp-block-avatar.alignright {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not required as changes made are not required anymore. See #67494

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Avatar Affects the Avatar Block First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants