The images on my collection page & thumbnails for individual product pages(product detail page) are still image’s original ratios that have been uploaded.
I want to crop them all to square ratio.
And I want them to trim with object-fit: cover ;.
But in the largest image of the product, I want them to square ratio but want to trim with object-fit: contain;
Or, only in this place, It may not need to trim, and it may ok that it keep the aspect ratio as original.
I don’t know until I see it …
theme.scss.liquid
Collection styles & Product template styles
/*====== Collection styles ======*/
.collection-description {
margin-bottom: $gutter / 2;
}
.product {
position: relative;
}
.product__image-wrapper {
display: block;
margin-bottom: $gutter / 3;
position: relative;
img {
display: block;
margin: 0 auto;
}
}
.product__image-wrapper--loading {
background-color: $color-body-text;
@include animation(placeholder-background-loading 1.5s infinite linear);
}
.product__image {
display: block;
width: 100%;
position: absolute;
top: 0;
&.lazyload {
opacity: 0;
}
}
/*====== Product template styles ======*/
.product-single__variants {
display: none;
.no-js & {
display: block;
}
}
.product-single__featured-image-wrapper {
margin: 0 auto $gutter;
position: relative;
width: 100%;
}
.product-single__photos,
.product-single__thumbnails {
a,
img {
display: block;
margin: 0 auto;
max-width: 100%;
}
}
.product-single__photos {
.supports-js & {
position: relative;
}
}
.product-single__photo {
width: 100%;
.supports-js & {
position: absolute;
top: 0;
}
&.lazyload {
opacity: 0;
}
}
.lightbox {
cursor: -webkit-zoom-in;
cursor: -moz-zoom-in;
cursor: zoom-in;
}
.image-zoom {
cursor: move;
}
.product-single__thumbnails li {
margin-bottom: $gutter;
}
.product-single__meta {
padding-top: $gutter / 2;
}
If anyone knows, please help.
I have attached the code.
Thank you.








