Skip to content

Commit

Permalink
Fix image proportions for overlay images due to air-helper 3.1.1, T-2…
Browse files Browse the repository at this point in the history
…3188
  • Loading branch information
ronilaukkarinen committed Dec 3, 2024
1 parent f5297f2 commit eeaf106
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 12 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
### [Unreleased]

* Fix body styles leaking to wp-admin
* Fix img proportions fallback for images that have width and height set, T-23188
* Fix image proportions for overlay images due to air-helper 3.1.1, T-23188

### 9.4.6: 2024-11-19

Expand Down
12 changes: 8 additions & 4 deletions css/dev/global.css

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions css/dev/gutenberg-editor-styles.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/prod/global.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/prod/gutenberg-editor-styles.css

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion sass/gutenberg/formatting/_img.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
}

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

/* For images that have width and height set, T-23188 */
img[width][height] {
height: auto;
}
4 changes: 3 additions & 1 deletion sass/helpers/_images.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Styling background-images
// For custom sized image background, use: class="image image-background"
// For bg as layer, use: class="image image-background image-background-layer"
.image-background > img {
.image-background > img,
.image-background > img[width][height] {
object-fit: cover;
}

Expand All @@ -11,6 +12,7 @@
}

.image-background > img,
.image-background > img[width][height],
.image-background-layer {
height: 100%;
left: 0;
Expand Down

0 comments on commit eeaf106

Please sign in to comment.