Hi - can anyone help me make the product images sticky for the Shapes theme? I’ve tried all of the simple css customisations on-page I can find - nothing seems to work. Cheers
Hi there,
The Shapes theme doesn’t include sticky product images out of the box, but you can add the effect with a small Liquid/CSS adjustment. The general idea is:
-
Wrap the product image container in a
divwith a fixed height. -
Apply
position: sticky; top: 0;to the image wrapper. -
Make sure the parent container has enough height so the sticky effect works while the user scrolls through the product details.
For example:
.product__media-wrapper {
position: -webkit-sticky;
position: sticky;
top: 20px; /* adjust spacing from top */
}
You may also need to adjust the product form’s layout (grid or flex settings) so the sticky image and product info scroll side by side smoothly.
If you’d like, I can help fine-tune this directly in your theme so it works seamlessly across desktop and mobile without breaking the layout.
Looked at the themes demo store.
Try this code in the product info Section “Custom CSS” setting (or theme settings=> custom css, if does not work in section settings)
.product-media > div {
position: sticky;
top: 0;
}
.overflow-hidden:has(.product-media) {
overflow:clip;
}
overflow:hidden; on the product media ancestor element prevents sticking, so need to fix that.
if my post is helpful, please like it ♡ and mark as a solution -- this will help others find it
Hi @Raised
Welcome to the Shopify Community! Please share your store URL and password (if it’s password-protected), so I can check and provide you with the exact solution.
Thanks Tim - much appreciated - I’m a bit simple when it comes to this - I’ve added the code to Custom CSS on the product page - what do i need to do re: overflow:hidden; ?
Overflow already addressed in the code, should be fine.
It was just a comment to others who would be looking at the code and ask why it it there…
Does it work though?
if my post is helpful, please like it ♡ and mark as a solution -- this will help others find it
No - hasn’t worked sorry
Hi @Raised
Welcome to the Shopify Community! Please share your store URL and password (if it’s password-protected), so I can check and provide you with the exact solution.
Could be your settings do not match demo store ones.
Share (preview) link to your store (and a storefront password if set) to look further.
Sorry Tim - not sure how I missed this last reply - this is currently a live URL: The Collagen Bar Mixed Box – Raised
Try the code in the “Theme settings”-> “Custom CSS” as I suggested above.
Why: overflow: hidden is also set on main, and adding this code to the Section settings-> “Custom CSS” makes it not apply to the main.
So the code (with slightly amended top value ) should go to the “Theme settings”-> “Custom CSS”:
.product-media > div {
position: sticky;
top: var(--header-height, 0);
}
.overflow-hidden:has(.product-media) {
overflow:clip;
}
Mate, works perfectly - thank you very kindly. I actually have a few little tweaks like this piling up - any chance we could have a chat about getting your help on a couple of other things?
