-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix featured collection slider margins #409
Conversation
@@ -17,7 +17,7 @@ | |||
endif | |||
-%} | |||
<div class="collection page-width{% if section.settings.swipe_on_mobile == true and section.settings.collection.all_products_count > 2 and section.settings.products_to_show > 2 %} page-width-desktop{% endif %}"> | |||
<div class="{% if section.settings.show_view_all and section.settings.swipe_on_mobile %}title-wrapper-with-link{% endif %}{% if section.settings.title == blank %} title-wrapper-with-link--no-heading{% endif %}{% if section.settings.collection.all_products_count > 2 and section.settings.swipe_on_mobile and section.settings.products_to_show > 2 %} title-wrapper--self-padded-tablet-down{% endif %}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unrelated to the product-grid issue, but fixes inconsistent spacing below the title in this section.
@tauthomas01 you should take a look at this with your product-grid context. Interested if you see a better way to resolve this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder what negative-margin-small
was solving 🤔
Tho what you did here seem to fix the problem mentioned in the issue 👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works well 👍 clean solution
Why are these changes introduced?
Fixes #379
What approach did you take?
The product grid changes introduced in #176 applied some negative vertical margins that don't play nice with the absolutely positioned slider buttons below the slides/grid items, specifically in the featured collection section which is using the product grid (other slider sections don't appear to be affected).
The simplest fix seems to be declaring a default margin-bottom (of zero) on the slider class which will take priority over the default product grid margins. Slider slides (grid items) already set their own padding/margins in this way.
Other considerations
Another option is to just not apply the
product-grid
class at specific breakpoints when the slider setting is enabled, but we'd probably have to extend the product grid component to offer breakpoint exclusive classes (such asproduct-grid--desktop
). I'm not sure this is necessary, but it's an option.Demo links
Checklist