Initial implementation of improved image sizes
algorithm
#1187
Labels
[Plugin] Auto Sizes
Issues for the Auto Sizes plugin
sizes
algorithm
#1187
Overview
This issue cover adding the first set of enhancement to the auto-sizes plugin, that improve the default image
sizes
algorithm by constraining the maximumsizes
width by layout settings fromtheme.json
and the content width setting in classic themes for default aligned images.Approach
To kick off this effort, I’ve created a proof of concept implementation, which adds the
sizes
attribute to images in blocks during the block rendering process, via block render filters. This approach is based on the following initial proposal for new algorithms based on alignment values:(max-width: contentSize + padding) calc(100vw - padding), contentSize
(max-width: wideSize + padding) calc(100vw - padding), widesize
useRootPaddingAwareAlignments
:100vw
useRootPaddingAwareAlignments
:calc(100vw - padding)
Goal
An initial implementation should meet the following requirements:
default
aligned image blocks should incorporate thecontentSize
setting from theme.jsonwide
aligned image blocks should incorporate thewideSize
setting, if availablefull
aligned images should subtract the padding setting whenuseRootPaddingAwareAlignments
is nottrue
, otherwise be100vw
The text was updated successfully, but these errors were encountered: