Shopify themes, liquid, logos, and UX
Hey there!
Wondering if anyone could help me out with an issue I have with the product grid inside collections using Dawn Theme.
The product images are being cropped. Only option they are not being cropped is when 'Adapt to image' is selected however then products are completely misaligned and it looks awful.
I would like to use the square option for images but have the images scaled rather than cropped (even though a lot of my images are similar in size). I can't share link as at this stage my current theme is different and I'm only preparing to switch to Dawn and I'm stuck with this issue.
Hoping for any guidance on this. If not thanks for taking the time to read. Cheers.
Solved! Go to the solution
This is an accepted solution.
I've solved the problem.
In the product grid you set the image ratio to square -> products are nicely aligned but images are cut off
In "edit code" go to "assets" and find base.css
find the following code:
.media > img {
object-fit: cover;
object-position: center center;
transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
replace "cover" with "contain"
.media > img {
object-fit: contain;
object-position: center center;
transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
I needed to clear browser cache but now it seems to be working - no more cut off images!
Please share store URL & screenshot what do you want !
Thanks!
Hey @dmwwebartisan unfortunately its not my active theme at the moment so I can't share link. Im just trying to stop product grid cropping images - instead I want it to scale down the images to fit within the square.
I have the exact same problem. Did you find a solution for this?
Thanks!
"misaligned" -> So you mean your images have not the same ratio?
edit: wouldn't an image processing app help here?
Like this one : https://apps.shopify.com/bulk-image-edit ?
Thanks for your response but no, Image resizing was not the solution. All my images are same size prior to uploading to begin with. Anyways I've ditched the theme, its absolutely rubbish has issues everywhere.
This is an accepted solution.
I've solved the problem.
In the product grid you set the image ratio to square -> products are nicely aligned but images are cut off
In "edit code" go to "assets" and find base.css
find the following code:
.media > img {
object-fit: cover;
object-position: center center;
transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
replace "cover" with "contain"
.media > img {
object-fit: contain;
object-position: center center;
transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
I needed to clear browser cache but now it seems to be working - no more cut off images!
@Schoppifyer Hello, I am using Dawn theme too but for some reason, it does not work on our website. Could you see why the images are still being cut off?
Hi Schoppifyer,
Thanks for this, it partially fixed the problem, some smaller horizontal images get stretched, is it possible to contain those images(I have added screenshots)? Thanks, Art.
SMALL SIZE HORIZONTAL IMAGE (Stretched)
NORMAL SIZE IMAGE
This was immensely helpful. Thank you.
I spoke a bit too soon. The change also altered images on my home page which looked better with the "cover" option. Any thoughts on per-page changes? Thanks.
For some reason, this code wouldn't come up with FIND...so i had to scroll the entire code to find it
Hey @thewolf22, if you're struggling with product grid image issues in Shopify Dawn Theme, watch this quick tutorial: https://www.youtube.com/watch?v=LNCzj6cxw1s.
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024