Skip to content

Commit 3fd8aef

Browse files
committed
Fix tall images on PDPs and PLPs
1 parent a527e81 commit 3fd8aef

File tree

6 files changed

+21
-1
lines changed

6 files changed

+21
-1
lines changed

assets/js/theme/global.js

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import maintenanceMode from './global/maintenanceMode';
1313
import carousel from './common/carousel';
1414
import loadingProgressBar from './global/loading-progress-bar';
1515
import svgInjector from './global/svg-injector';
16+
import objectFitImages from './global/object-fit-polyfill';
1617

1718
export default class Global extends PageManager {
1819
onReady() {
@@ -28,5 +29,6 @@ export default class Global extends PageManager {
2829
maintenanceMode(this.context.maintenanceMode);
2930
loadingProgressBar();
3031
svgInjector();
32+
objectFitImages();
3133
}
3234
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import objectFitImages from 'object-fit-images';
2+
3+
export default function () {
4+
objectFitImages();
5+
}

assets/scss/components/citadel/cards/_cards.scss

+3
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
border: 0;
5252
width: 100%;
5353
max-height: 100%;
54+
object-fit: contain;
55+
/* Object-fit polyfill */
56+
font-family: 'object-fit: contain;';
5457
}
5558

5659
.card-title {

assets/scss/components/stencil/productView/_productView.scss

+4
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
@include lazy-loaded-img;
5050
max-height: 100%;
5151
width: 100%;
52+
object-fit: contain;
53+
/* Object-fit polyfill */
54+
font-family: 'object-fit: contain;';
5255
}
5356

5457
@include lazy-loaded-padding('product_size');
@@ -79,6 +82,7 @@
7982
max-height: 50px;
8083
max-width: 50px;
8184
width: 100%;
85+
object-fit: contain;
8286
}
8387
}
8488

package-lock.json

+6-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"lodash": "^4.17.4",
1818
"nanobar": "^0.4.2",
1919
"nod-validate": "^2.0.12",
20+
"object-fit-images": "^3.2.4",
2021
"slick-carousel": "^1.8.1",
2122
"svg-injector": "^1.1.3",
2223
"sweetalert2": "^6.11.5"

0 commit comments

Comments
 (0)