-
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 sizes in the collage section #2478
Conversation
4d3c2bd
to
5133ade
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.
Looking good, just wondering about one more thing.
assign grid_space_desktop = settings.spacing_grid_horizontal | divided_by: 2 | append: 'px' | ||
assign grid_space_mobile = settings.spacing_grid_horizontal | divided_by: 4 | 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.
One thing I'm wondering about. Why does it need to be divided by 2 and 4 🤔 Since the spacing is applied once
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.
Because let's say there is a 40px gap, this 40px approximately equally split between 2 images. Since we are trying to calculate an image size we need to account it partially. If I account 40px for the first image only then the second image size will be calculated wrong.
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.
Makes sense 👍
* shopify/main: [Video] Add fade in on scroll animation (Shopify#2495) Animate rich text and email signup (Shopify#2408) [Gift card] Add help doc link and change label for translation (Shopify#2471) Add prettier config to support format-on-save (Shopify#2323) Announcements slideshow (Shopify#2394) fix: Update Follow on Shop Option Text (Shopify#2463) Enable "per-PR" async PR mode (Shopify#2488) Animate multicolumn (Shopify#2409) Fix improper image sizes in the collage section (Shopify#2478) Replaced depreciated liquid property/value (Shopify#2480)
* next: [Video] Add fade in on scroll animation (Shopify#2495) Animate rich text and email signup (Shopify#2408) [Gift card] Add help doc link and change label for translation (Shopify#2471) Add prettier config to support format-on-save (Shopify#2323) Announcements slideshow (Shopify#2394) fix: Update Follow on Shop Option Text (Shopify#2463) Enable "per-PR" async PR mode (Shopify#2488) Animate multicolumn (Shopify#2409) Fix improper image sizes in the collage section (Shopify#2478) Replaced depreciated liquid property/value (Shopify#2480) Update from Shopify for theme dawn/next Update from Shopify for theme dawn/next Update from Shopify for theme dawn/next Update from Shopify for theme dawn/next Update from Shopify for theme dawn/next Update from Shopify for theme dawn/next
* Add logic for collage image sizes * Add more logic and refactor. * Refactoring
PR Summary:
This PR improves the way images are loaded in the collage section. It accounts for many factors that image sizes depend on.
Why are these changes introduced?
Fixes #2354.
What approach did you take?
I rewrote the logic of how we create our srcset and choose sizes. Now it accounts for the page width, desktop/tablet/mobile layouts, number of columns, size of the image in collage and paddings.
Other considerations
Decision log
Visual impact on existing themes
No visual impact
Testing steps/scenarios
Demo links
Checklist