-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Bugfix/wrong size attributes in image with border #30139
Bugfix/wrong size attributes in image with border #30139
Conversation
Already set in the lib/reset styles
With the same styles from Magento_Catalog product-image-photo
Hi @GrimLink. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@magento run all tests |
Can you verify previous commit purpose related with this doc https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/themes/theme-images.html. Seem they try to add new variable for solve problem
Also i think doc should be update for clarify user to use correct image size. |
@mrtuvn I can confirm that the previous commit is related to the doc https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/themes/theme-images.html#lazy_loading But I don't understand why the previous commit was seen as valid 😖 This same issue also plagued the images in the minicart. The width and height are recommended for the native lazy loading and to prevent layout jank. But I will check how to also update the doc with this changed. |
app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/_module.less
Show resolved
Hide resolved
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.
If I understand this correctly and previous change was some hacky workaround that we can remove while fixing the issue with those few lines of CSS then I'm happy to approve this.
Let's just resolve those failing tests that @mrtuvn mentioned.
@magento run Functional Tests B2B,Functional Tests CE,Functional Tests EE,Static Tests |
@magento run Static Tests |
@krzksz I am not sure how to als update the docs https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/themes/theme-images.html#lazy_loading |
@magento run all tests |
@GrimLink Hey, you can find the repository here: https://github.com/magento/devdocs When making PR there you should be able to reference this one to make sure they are processed together. |
@magento run Functional Tests B2B,WebAPI Tests |
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.
Thanks @GrimLink! Tested it locally. Nice job!
Yes, please, update https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/themes/theme-images.html#lazy_loading as well.
I don't think it is possible to cover this scenario with automatic tests. |
Hi @krzksz, thank you for the review.
|
@magento create issue |
Note: Automation tests are passed |
@magento give me new instance with edition ee |
Hi @gabrieldagama. Thank you for your request. I'm working on Magento instance for you. |
Hi @gabrieldagama, here is your Magento Instance: https://c44d658c861ce1e0e10f9ffac5860d3c.instances.magento-community.engineering |
Hi @GrimLink, thank you for your contribution! |
Description (*)
This PR removes most changes from commit #4e085c7
Commit #4e085c7 tried to fix images getting distorted.
By setting a boolean for the
image_with_border.phtml
.This boolean would set the width and height attribute, to the invalid html max-width and max-height attribute.
While this did fix the images not getting distorted.
This did reintroduced the use of invalid html attributes.
This commit unsets the boolean, use of invalid html attributes and fixes the images getting distorted, via the CSS instead.
Manual testing scenarios (*)
enable_lazy_loading_for_images_without_borders
width: auto
to the.product-image-photo
(This also possible viaobject-fit: scale-down
)This PR also removes the redundant max-width and height from the
.product-image-photo
.Since these values are already set globally, on the image, via the reset styles.
Contribution checklist (*)
Resolved issues: