Skip to content

Commit

Permalink
Images: Set height:auto on images that have explicitly set width and …
Browse files Browse the repository at this point in the history
…max-width to 100% (#30092)
  • Loading branch information
scruffian authored Oct 7, 2021
1 parent 2ffa662 commit c9ba6cf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/block-library/src/image/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ figure.wp-block-image:not(.wp-block) {
[data-align="wide"] > .wp-block-image,
[data-align="full"] > .wp-block-image {
img {
height: auto;
width: 100%;
}
}
Expand Down
2 changes: 2 additions & 0 deletions packages/block-library/src/image/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
margin: 0 0 1em 0;

img {
height: auto;
max-width: 100%;
}

Expand All @@ -15,6 +16,7 @@

&.alignfull img,
&.alignwide img {
height: auto;
width: 100%;
}

Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/media-text/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@

.wp-block-media-text__media img,
.wp-block-media-text__media video {
height: auto;
max-width: unset;
width: 100%;
vertical-align: middle;
Expand Down
2 changes: 2 additions & 0 deletions packages/block-library/src/site-logo/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
width: 120px;

img {
height: auto;
width: 100%;
}
}
Expand All @@ -38,6 +39,7 @@

img {
display: block;
height: auto;
max-width: 100%;
}

Expand Down

0 comments on commit c9ba6cf

Please sign in to comment.