-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
new_audit: add unsized-images to experimental config #11115
Conversation
…tement in getNonHtmlError
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.
this looks awesome @lemcardenas! one of the cleanest "draft" PRs I've ever seen 😄
a PR overview with references to what stage this is and what planned followups should be expected (maybe linking to the doc?) would be awesome. I'm thinking we should land this in the experimental-config.js
rather than default-config.js until we can update it to support CSS images, but maybe you already discussed an alternative plan/timeline I missed?
Yes! I am planning on adding all of that, I didn't expect feedback on a draft PR 😅
I think placing it in experimental-config is a good idea! I'll switch it over to that today |
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.
only a couple of minor style nits from me. after that it'll be LGTM
Summary
This PR is a first iteration in creating a new audit that confirms users' images are explicitly sized; ultimately preventing layout shift and improving CLS (cumulative layout shift).
Setting explicit sizes for images is an effective way to reduce CLS since images without sizes are a leading contributor to CLS.
Design and detail about explicit sizing on image elements can be found here.
Design and discussion about explicit sizing on various HTML elements can be found here.
This audit is set to remain in experimental config until CSS sizing is included in a future image-elements gatherer PR.
Related Issues/PRs
#10085