Skip to content

Commit

Permalink
Image block: Fix focus style not around whole image when linked (#62556)
Browse files Browse the repository at this point in the history
* Add inline-block display to image and media-text image

* Add display:block to image's <a> tag

* Addressed feedback

* Fix linting

* Change syntax for .wp-block-media-text__media a CSS

Co-authored-by: amitraj2203 <amitraj2203@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: talldan <talldanwp@git.wordpress.org>
Co-authored-by: krokodok <krokodok@git.wordpress.org>
  • Loading branch information
5 people committed Jun 20, 2024
1 parent a33a94d commit 1a1372b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/block-library/src/image/style.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
.wp-block-image {

a {
display: inline-block;
}

img {
height: auto;
max-width: 100%;
Expand Down Expand Up @@ -27,6 +32,11 @@
text-align: center;
}

&.alignfull a,
&.alignwide a {
width: 100%;
}

&.alignfull img,
&.alignwide img {
height: auto;
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/media-text/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@
/*!rtl:end:ignore*/
}

.wp-block-media-text__media a {
display: inline-block;
}

.wp-block-media-text__media img,
.wp-block-media-text__media video {
height: auto;
Expand Down

1 comment on commit 1a1372b

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected in 1a1372b.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9592930730
📝 Reported issues:

Please sign in to comment.