Shopify themes, liquid, logos, and UX
hi, I want to have a shadow in my featured product only. like in the image. I set it in theme but my problem is the collection page also has a shadow. I only want the shadow on the homepage. can you please help me? Thank you andvance
Solved! Go to the solution
This is an accepted solution.
The class is called .shape--round.
However, there is an incompatibility problem with the original code; the following attribute: clip-path: ellipse(45% 45% at 50% 50%) cuts the box-shadow and does not display correctly. The clip-path is responsible for giving the image a rounded shape.
To solve it we are going to remove that attribute (clip-path: none) and add instead (border-radius: 50% !important;).
This is how the code would look (add it in the theme.liquid):
{% if template == 'index' %}
<style>
.shape--round {
box-shadow: 3px 3px 5px #888888; /* set your values */
clip-path: none;
border-radius: 50% !important;
}
</style>
{% endif %}
This would be the result, I hope you like it!
This is an accepted solution.
This code now takes image hover into account:
{% if template == 'index' %}
<style>
.shape--round,
.product-card-wrapper:hover .shape--round {
box-shadow: 7px -4px 10px 2px #777 !important;
clip-path: none;
border-radius: 50% !important;
}
</style>
{% endif %}
Mark it as a solution too if it helped you!
I don't have access to the store, so I can't see what classes you are using. Basically the code you are looking for should be something like this:
{% if template == 'index' %}
<style>
.image-container img {
box-shadow: 3px 3px 5px #888888;
}
</style>
{% endif %}
This is an accepted solution.
The class is called .shape--round.
However, there is an incompatibility problem with the original code; the following attribute: clip-path: ellipse(45% 45% at 50% 50%) cuts the box-shadow and does not display correctly. The clip-path is responsible for giving the image a rounded shape.
To solve it we are going to remove that attribute (clip-path: none) and add instead (border-radius: 50% !important;).
This is how the code would look (add it in the theme.liquid):
{% if template == 'index' %}
<style>
.shape--round {
box-shadow: 3px 3px 5px #888888; /* set your values */
clip-path: none;
border-radius: 50% !important;
}
</style>
{% endif %}
This would be the result, I hope you like it!
By the way, here are other values for the box-shadow attribute that I think fit more with your original requirement.
box-shadow: 7px -4px 10px 2px #777; /* set your values */
the only problem now is when i hover it the shadows are gone.
{% if template == 'index' %}
<style>
.shape--round,
.shape--round:hover {
box-shadow: 7px -4px 10px 2px #777 !important; /* set your values */
clip-path: none;
border-radius: 50% !important;
}
</style>
{% endif %}
hi it's still the same if i hover it.
This is an accepted solution.
This code now takes image hover into account:
{% if template == 'index' %}
<style>
.shape--round,
.product-card-wrapper:hover .shape--round {
box-shadow: 7px -4px 10px 2px #777 !important;
clip-path: none;
border-radius: 50% !important;
}
</style>
{% endif %}
Mark it as a solution too if it helped you!
thank you so much!
thank you so much. it works perfectly!
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024