Open wormeyman opened 3 years ago
@ntsekouras and @aristath I think you both would like to know about this issue.
In the twentytwentyone theme we did some nifty calculations in order to avoid this issue, perhaps we should port some of that logic? See https://github.com/WordPress/twentytwentyone/blob/7e5708f040013c2b158dd5b4f3b9b7f36fb71a96/inc/template-functions.php#L405-L447 for details
@aristath My example Gif is on the Twentytwentyone theme so I'm not sure that solution is working.
I happen to come across this Gutenberg support issue which mentions CLS in relation to Image blocks: https://wordpress.org/support/topic/cls-because-of-image-blocks-in-gutenberg/ Thought I would add it in here...
Description
Latest posts block in grid view causes CLS (Content Layout Shift) because the images are not pre allocated a size due to being in a list item.
Step-by-step reproduction instructions
Expected behaviour
Actual behaviour
Screenshots or screen recording (optional)
Code snippet (optional)
<!-- wp:latest-posts {"postsToShow":4,"postLayout":"grid","columns":4,"displayFeaturedImage":true,"featuredImageSizeSlug":"medium","addLinkToFeaturedImage":true} /-->
WordPress information
Device information