-
Notifications
You must be signed in to change notification settings - Fork 22.9k
fix typo and improve articulation #42038
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
base: main
Are you sure you want to change the base?
Conversation
|
Preview URLs Flaws (20)URL:
|
chrisdavidmills
left a comment
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 for improving this, @prakhar-pal. What you've done so far is good, but I have a further suggestion for you to consider.
| - : Defers loading the image until it reaches a calculated distance from the viewport, as defined by the browser. The intent is to avoid the network and storage bandwidth needed to handle the image until it's reasonably certain that it will be needed. This generally improves the performance of the content in most typical use cases. | ||
|
|
||
| While explicit [`width`](#width) and [`height`](#height) attributes are recommended for all images to avoid layout shift, they are especially important for lazy-loaded ones. Lazy-loaded images will never be loaded if they do not intersect a visible part of an element, even if loading them would change that, because unloaded images have a `width` and `height` of `0`. It is also more a more disturbing user experience if the page reflows in the middle of reading. | ||
| While explicit [`width`](#width) and [`height`](#height) attributes are recommended for all images to avoid layout shift, they are especially important for lazy-loaded ones. Lazy-loaded images will never be loaded if they do not intersect a visible part of an element, even if loading them would change that, because unloaded images have a `width` and `height` of `0`. It also creates a more disruptive user experience when the page reflows in the middle of reading. |
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.
| While explicit [`width`](#width) and [`height`](#height) attributes are recommended for all images to avoid layout shift, they are especially important for lazy-loaded ones. Lazy-loaded images will never be loaded if they do not intersect a visible part of an element, even if loading them would change that, because unloaded images have a `width` and `height` of `0`. It also creates a more disruptive user experience when the page reflows in the middle of reading. | |
| While explicit [`width`](#width) and [`height`](#height) attributes are recommended for all images to avoid layout shift, they are especially important for lazy-loaded ones. Lazy-loaded images will never be loaded if they do not intersect a visible part of an element, even if loading them would change that, because unloaded images have a `width` and `height` of `0`. It creates an even more disruptive user experience when the content visible in the viewport reflows in the middle of reading 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.
What you've done so far is good, but I wonder if the sentence should be modified further to something like this. The page already mentions setting width/height to avoid layout shift, and that this is important, in a note inside the height description. So the existing text here seems a bit repetitive. I think it is supposed to say that the layout shift is particularly bad when you don't set width/height on lazy-loaded images because the shift can happen to the currently-visible content.
Description
This PR fixes a typo in the img documentation (the changed sentence contained duplicate
more). I've also improved articulation of that sentence to read more naturallyMotivation
Mainly to fix the typo and additionally to improve concept's articulation.
Additional details
Related issues and pull requests