ampproject / ampproject/amphtml
Add native `img` to the AMP validator
- Dominant language
- JavaScript
- Stars
- 14.9k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
Description
## Add native `img` tag to the AMP Validator
This issue falls under the umbrella of changes which are a part of the '`amp-img` deprecation': #30442.
We will be adding the native `img` tag to the validator which will allow for native `img` tags which require the following attributes...
Standard image:
- `alt`
- `decoding=async`
- `height`
- `loading=lazy`
- `src`
- `width`
Hero image:
- `alt`
- `data-hero`
- `decoding=async`
- `height`
- `src`
- `width`
Image using `srcset`:
- `alt`
- `decoding=async`
- `height`
- `loading=lazy`
- `sizes`
- `srcset`
- `width`
## Describe alternatives you've considered
These guidelines are fairly strict, we had considered having looser more granular validation rules for images trying to replicate specific amp-layout considerations, however for ease of development and for user understanding we have decided to start with more strict validation rules and allow for loosening of these restrictions in the future.
## Additional context
For additional documents see this document about [`amp-img` deprecation](https://docs.google.com/document/d/1tLqmz3g0a8PCOWwsQuPZ3Sx0MuqL8ly78I7eA-xOj-Q/edit?usp=sharing), and this document about [allowing native `img`](https://docs.google.com/document/d/135fsDOw-OfVNZbqr-aOY3ZVNKTzwCLcf8z6Dang2ygY/edit?usp=sharing) in valid amp documents.
Contributor guide
Assessment
This issue has not been assessed yet.