How to reduce image size on Trade theme?

How to reduce image size on Trade theme?

Yannsss
New Member
7 0 0

I had the similar problem before that was resolved for portrait images in: https://community.shopify.com/c/shopify-discussions/how-to-reduce-image-size-on-trade-theme/m-p/2781...

 

I followed these Steps:

1) Go to Online Store
2) Edit Code
3) Find theme.liquid file

4) Add the following code in the bottom of the file above </body> tag

<style>
@media screen and (min-width: 768px) {
.product.grid {
    justify-content: space-around !important;
}
.product--right .product__media-wrapper {
    max-width: 20% !important;
}
}
</style>
 

RESULT & current issue:

It works fine on portrait images like this one: https://ik-parts.com/products/ikea-100358

But now landscape images are tiny: https://ik-parts.com/products/ikea-10090009

 

Would it be possible to limit the max height instead (and not the max width)?

Replies 2 (2)

Dan-From-Ryviu
Shopify Partner
9695 1938 1973

You can try to update your code below to check if it solve the issue with your image 

<style>
@media screen and (min-width: 768px) {
.product.grid {
    justify-content: space-around !important;
}
.product--right .product__media-wrapper {
    max-width: 20% !important;
}
.card__media .media img {
    object-fit: contain !important;
}
}
</style>

- Helpful? Like and Accept solution! Support me! Buy me coffee
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Ryviu: Aliexpress Reviews - AliExpress Reviews Importer, one-click import aliexpress reviews, export reviews to CSV file.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

Yannsss
New Member
7 0 0

I found the correction:

 

<style>
@media screen and (min-width: 750px) {
.product.grid {
justify-content: space-around !important;
}
.product--right .product__media-wrapper {
max-width: 50% !important;
}
.product-media-container.constrain-height{
--constrained-height: 300px !important;
}
</style>