-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Re-apply slider shadow padding #1231
Conversation
.product-grid, | ||
.collection-list, | ||
.blog__posts, | ||
.card { |
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.
We can update these to use shared classes in the future.
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.
Looks good 👌 Just wondering if we should tweak the calculation a little 🤔
assets/component-slider.css
Outdated
@@ -24,9 +24,6 @@ slider-component { | |||
scroll-padding-left: 1rem; | |||
-webkit-overflow-scrolling: touch; | |||
margin-bottom: 1rem; | |||
} | |||
|
|||
.slider--mobile.product__media-list { | |||
padding-top: calc(var(--shadow-vertical-offset) * -1 + var(--shadow-blur-radius)); | |||
padding-bottom: calc(var(--shadow-vertical-offset) + var(--shadow-blur-radius)); |
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.
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 was going to include .5rem here actually but then we may not want an additional .5rem if there's already a shadow offset that will cover it. It also didn't fix it in one case (because the calculation currently relies on negative padding not being a problem), I believe with positive offset shadow applied?. tl;dr I just want sliders to work again and will handle more complicated stuff in follow ups.
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.
Edit: Actually, using max() may straighten that up nicely. Good call. Will update if all looks well 👍
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.
Donezo
73015ce
to
d710311
Compare
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.
Let me know if you think this should be in a different PR.
padding-top: calc(var(--shadow-vertical-offset) * -1 + var(--shadow-blur-radius)); | ||
padding-bottom: calc(var(--shadow-vertical-offset) + var(--shadow-blur-radius)); | ||
padding-top: max(0.5rem, calc(var(--shadow-vertical-offset) * -1 + var(--shadow-blur-radius))); | ||
padding-bottom: max(0.5rem, calc(var(--shadow-vertical-offset) + var(--shadow-blur-radius))); |
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 know this isn't technically part of this PR, but this is something I've observed:
For cards that use the standard
style, and particularly for the featured collection product cards and collection list collection cards, I think this adds a lot of unintended space below the cards on mobile and tablet. When the slider is enabled and when it's not. The list itself already adds margin-bottom: 1.5rem
on tablet, so we probably need to make some exceptions for these types of cards.
I'm wondering if the padding should be applied below the image instead of the slider when the card type is Standard.
In this example, you can see that all padding has been removed from the section, but there's still a lot of space between the cards and the next section.
This makes sense if the card style is "Card" (see below), but it's causing some unintended spacing for the "Standard" style.
Places to look at:
- Featured collection product cards
- Collection list collection cards
- Blog post cards
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.
good point, so should be conditional to a class applied based on the card/standard layout then
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.
That's definitely valid and I believe Meli mentioned it in the ticket too (I don't have this PR closing the issue for this reason). If the card discrepancy is also a sev 1 concern that we want done asap I can play with it before merging this. Otherwise, the current fix in this PR is definitely sev 1 and should be merged separately so it doesn't potentially get held up by reviews/discussions for the card aspect. cc @melissaperreault
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.
Aligned to tackle separately!
It fixes this too: #1157 if we add the |
Thanks Ludo I'll add it to the PR description |
* Re-apply slider shadow padding and fix blog slider * Account for focus outline
Why are these changes introduced?
Refs #1217
Fixes #1157
What approach did you take?
Reverted a change from a previous commit that limited the scope of the shadow padding styles.
Also noticed that the blogs slider may have been prevented from receiving the proper shadow offset values.
Other considerations
There are other improvements we can make to this logic, but this commit just aims to get it back to working for all sliders in the theme.
Testing notes:
Demo links
Checklist