Improving the calculation of image sizes attributes #760
Labels
[Issue] Overview
Provides an overview of a specific project
[Plugin] Enhanced Responsive Images
Issues for the Enhanced Responsive Images plugin
WP Core
Work relates to inclusion in WP Core only
Overview
Originally introduced in WordPress 4.4, at the time WordPress had almost no way of knowing the intended layout of an image and therefore only came with a reasonable default value, intended to be modified by theme developers.
Since that time, enhancements to WordPress have been made, including the implementation of a declarative way for themes to control layout and alignments with
theme.json
, which provides the ability to more accurately predict the layout width of images before CSS is applied.Paired with the addition of ”auto sizes” for lazy-loaded images to the HTML specification, we can now improve the sizes attribute authored by WordPress to provide much more accurate layout information.
Project Overview
Goals
layout.contentSize
andlayout.wideSize
properties fromtheme.json
in the default sizes attribute for images to improve accuracy.theme.json
.Nice to have
Non-goals
sizes
attribute needs to be 100% accurate at all viewport sizes for a theme.srcset
attribute to provide more granular sources for clients to request at different viewport widths.Roadmap
This project is broken into the following two epics, with milestones for each epic describing major objectives that could be published as part of a plugin release version. This roadmap will be updated over time.
Improving the sizes calculation
This epic is broken into logical milestones to validate the use of theme.json data in the API before proposing needed enhancements to that API, and then rolling out enhancements to classic themes in order to support the largest number of sites.
sizes
algorithm #1187sizes
values #1251sizes
for left/right/center alignment #1289wp_calculate_image_sizes
to Reflect Changes in sizes attribute #1381sizes
values #1240Implement auto-sizes for lazy loaded images
This epic outlines the phases of development planned to implement the auto-sizes spec in WordPress.
Update the implementation based on changes to the spec as it is being implemented by browsers (related issue)not applicable.The text was updated successfully, but these errors were encountered: