Solved

prevent image resize when only a single product in Collection

Sakana
Visitor
3 0 1

Hi, I'm using Spotlight theme, and one of my collections only has a single product, but when i remove the other default blocks in the Collection to only the one, it automatically maximises the image size to full width.

 

All of my other collections are set to 5 columns so i want to make my collection with the single product the same image size as those.

 

https://sakanaproducts.com/

Accepted Solution (1)

Dan-From-Ryviu
Shopify Partner
7550 1459 1455

This is an accepted solution.

Hi @Sakana 

You can do that by adding this css code at the bottom of your base.css file in Online store > Themes > Edit code > Assets 

.collection-list .collection-list__item:only-child {
    width: calc(20% - var(--grid-desktop-horizontal-spacing) * 4 / 5);
    max-width: calc(20% - var(--grid-desktop-horizontal-spacing) * 4 / 5);
}

Screenshot_2.png

- Helpful? Like or Accept solution! - Buy me a coffee
- Ryviu - Product Reviews app, collect product reviews, import reviews from AliExpress, Amazon, Etsy, Shopee and Walmart and CSV.
- Lookfy app: Easy and fast to create Photo Gallery, Lookbook, Shop The Look
- Enjoy 1 month of Shopify for $1. Sign up now

View solution in original post

Replies 3 (3)

Dan-From-Ryviu
Shopify Partner
7550 1459 1455

This is an accepted solution.

Hi @Sakana 

You can do that by adding this css code at the bottom of your base.css file in Online store > Themes > Edit code > Assets 

.collection-list .collection-list__item:only-child {
    width: calc(20% - var(--grid-desktop-horizontal-spacing) * 4 / 5);
    max-width: calc(20% - var(--grid-desktop-horizontal-spacing) * 4 / 5);
}

Screenshot_2.png

- Helpful? Like or Accept solution! - Buy me a coffee
- Ryviu - Product Reviews app, collect product reviews, import reviews from AliExpress, Amazon, Etsy, Shopee and Walmart and CSV.
- Lookfy app: Easy and fast to create Photo Gallery, Lookbook, Shop The Look
- Enjoy 1 month of Shopify for $1. Sign up now

Sakana
Visitor
3 0 1

Amazing, it worked! thank you so much!!

Dan-From-Ryviu
Shopify Partner
7550 1459 1455

You are very welcome

- Helpful? Like or Accept solution! - Buy me a coffee
- Ryviu - Product Reviews app, collect product reviews, import reviews from AliExpress, Amazon, Etsy, Shopee and Walmart and CSV.
- Lookfy app: Easy and fast to create Photo Gallery, Lookbook, Shop The Look
- Enjoy 1 month of Shopify for $1. Sign up now