-
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 improper image size for the collapsible content #2507
Conversation
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.
Did a first pass and the sizes look like they're working well. Just have some cosmetic code suggestions to consider. Otherwise looks gtg.
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.
Looking good.
I agree with Ken about the variable names that could be a bit clearer maybe 🤔
| image_tag: | ||
loading: 'lazy', | ||
sizes: sizes, | ||
widths: '50, 75, 100, 150, 200, 300, 400, 500, 750, 1000, 1250, 1500, 1750, 2000, 2250, 2500, 2750, 3000, 3200' |
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'm not sure it makes sense to add that many extra sizes 🤔 Though it doesn't have a negative impact either.
The only time it's going to be useful is if someone uses the section and removed the collapsible blocks.
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 fair what you say. I added the same bunch of numbers as we did for other sections, just because I want to make it into a snippet one day, even though some sections don't require that range.
sections/collapsible-content.liquid
Outdated
if section.settings.layout == 'section' | ||
assign padding_multiplier = 2 | ||
endif | ||
assign desktop_tablet_padding = padding_multiplier | times: 100 | append: 'px' |
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.
Nitpick, but might read a little better if you did 100 | times: multiplier
. Non-issue though if you don't agree. Otherwise I like it.
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.
agreed ^
* Fix improper image size for collapsible content * Refactoring and renaming variables. * Fix prettier issue. * Minor refactor.
PR Summary:
This PR improves the way images are loaded in the collapsible content section.
Why are these changes introduced?
Fixes #1944.
What approach did you take?
I rewrote the logic of how we create our srcset and choose sizes.
Other considerations
Decision log
Visual impact on existing themes
Testing steps/scenarios
Demo links
Checklist