-
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
Remove inline-block display from image anchor in style.scss #67368
Conversation
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 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 the PR! When deleting code, it's a good idea to use something like Git blame to find out why it's there. This code is to fix the unintended focus outline that occurs when images are linked, so we can't delete this code entirely (See #62556): More importantly, the HTML changes when we add left/right alignment to images in the classic theme. No left/right alignment: <figure class="wp-block-image">
<a href="">
<img>
</a>
</figure> With left:right alignment: <div class="wp-block-image">
<figure class="alignleft">
<a href="">
<img>
</a>
</figure>
</div> With these things in mind, I think the following selector would be good to accurately target links to the image itself: .wp-block-image {
> a,
> figure > a {
display: inline-block;
}
} |
P.S. This issue also occurs when the images are wide and full width, but those issues will be fixed in #67392. |
Thank you, @t-hamano, for reviewing the PR. I have addressed your feedback and made the necessary updates. The code has been tested and is functioning as expected. It is now ready for your review. |
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.
LGTM 👍
…s#67368) * Remove inline-block display from image anchor in style.scss * Refactor: Set image anchor display to inline-block in style.scss Co-authored-by: yogeshbhutkar <yogeshbhutkar@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: Infinite-Null <ankitkumarshah@git.wordpress.org> Co-authored-by: hanneslsm <hanneslsm@git.wordpress.org> Co-authored-by: frkly <frkly@git.wordpress.org>
Fixes: #67366
What?
This PR removes the display: inline-block property from the image anchor that causes the caption anchors to not flow in continuation as described in the PR.
How?
The CSS rule causing the side-effect was removed.
Screenshots
Before:
After:
Screencast:
Screen.Recording.2024-11-28.at.12.32.16.PM.mov