-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feature/image cta #31
Conversation
Hello, I'm the AEM Code Sync Bot and I will run some test suites that validate the page speed.
|
|
|
|
|
|
|
|
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'd like to get picture
element to pre-save the space for the image, which will be lazy loaded. Without this we'll end up with CLS issues if the block is marked as finished, but then the image loads after other, subsequent, blocks.
This can be done with two steps:
- Set the
picture
to be relative position, then absolute position the image within it. Example CSS - Calculate the width-to-height ratio. Then add this as padding (bottom or top). This creates the space in which the Image will fit when rendered. Example JS.
- This step should also set the max-width based on the original image's width. This way the image doesn't grow larger than desired, which can result in pixelation.
This is an example I've used to do this same approach for the free-form images in long form pages:
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.
changes applied
Please always provide the GitHub issue(s) your PR is for, as well as test URLs where your change can be observed (before and after):
Issue: #7
Test URLs: