Shopify themes, liquid, logos, and UX
Hi There, basically we have cutout images on white and want to add a very small grey tint over the top - rather than changing every image background in photoshop.
My attempts in Dawn have failed, eg for collection pages, "card__inner" looked the perfect div to add a background colour with opacity but it always appears below the product image...? I'm missing something fundimental here...?
Any help much much much appreciated...? Thx
Solved! Go to the solution
This is an accepted solution.
@NH
If I understand correctly, depending on what images you have on your store it would require a different approach.
You can add an overlay to product page images by:
1. In your Shopify Admin go to: online store > themes > actions > edit code
2. Find Asset >base.css and paste this at the bottom of the file:
.product__media-item modal-opener{
position: relative;
}
.product__media-item modal-opener:after{
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
height: 100%;
width: 100%;
background: #000000;
opacity: 0.2;
}
#000000 = overlay color
0.2 = intensity (from 0 to 1)
Kind regards,
Diego
Hello @NH,
Please share:
- your store URL;
- page URL with the issue you mention;
- storefront password (if your store has one).
If the store is not online yet, please follow this quick tutorial to learn how to safely and temporarily share an offline/unpublished theme URL.
Kind regards,
Diego
Hi Diego, thx but its not an issue, and its an amend to vanilla Dawn code...?
This is an accepted solution.
@NH
If I understand correctly, depending on what images you have on your store it would require a different approach.
You can add an overlay to product page images by:
1. In your Shopify Admin go to: online store > themes > actions > edit code
2. Find Asset >base.css and paste this at the bottom of the file:
.product__media-item modal-opener{
position: relative;
}
.product__media-item modal-opener:after{
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
height: 100%;
width: 100%;
background: #000000;
opacity: 0.2;
}
#000000 = overlay color
0.2 = intensity (from 0 to 1)
Kind regards,
Diego
cheers, thx...
Hello, how can i use this code to make image overlay but conditional not for all products?
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