diff --git a/assets/css/amp-default.css b/assets/css/amp-default.css index 264d0a3f507..8213a06e6d0 100644 --- a/assets/css/amp-default.css +++ b/assets/css/amp-default.css @@ -1,6 +1,11 @@ -.amp-wp-unknown-size [src] { - /** Worst case scenario when we can't figure out dimensions for an image. **/ - /** Force the image into a box of fixed dimensions and use object-fit to scale. **/ + +/* + * Prevent cases of amp-img converted from img to appear with stretching by using object-fit to scale. + * See . + * Also use object-fit:contain in worst case scenario when we can't figure out dimensions for an image. + */ +amp-img.amp-wp-enforced-sizes[layout=intrinsic] > img, +.amp-wp-unknown-size > img { object-fit: contain; }