You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your enhancement related to a problem? Please describe.
To support the Instant Results feature we currently we index a single image URL (and dimensions) for the post thumbnail, whose size is determined by the ep_post_thumbnail_image_size filter. The problem with this is that it's a single size that is not necessarily appropriate for use by other features, such as Autosuggest (particularly when using WooCommerce and the larger thumbnail size is used). This was basically because it was the only cropped size whose layout could be predictable.
However, with support for object-fit now widely available we can crop images with CSS. Therefore I think it makes more sense to index a srcset of all the uncropped sizes of the image and use the sizes attribute of the img tag to let the browser choose the optimal size. By setting a proper sizes attribute a developer can get the browser to use the size of image that they want, rather than needing to filter the image size so that it's changed for all uses.
Designs
No response
Describe alternatives you've considered
No response
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Is your enhancement related to a problem? Please describe.
To support the Instant Results feature we currently we index a single image URL (and dimensions) for the post thumbnail, whose size is determined by the
ep_post_thumbnail_image_size
filter. The problem with this is that it's a single size that is not necessarily appropriate for use by other features, such as Autosuggest (particularly when using WooCommerce and the larger thumbnail size is used). This was basically because it was the only cropped size whose layout could be predictable.However, with support for
object-fit
now widely available we can crop images with CSS. Therefore I think it makes more sense to index asrcset
of all the uncropped sizes of the image and use thesizes
attribute of theimg
tag to let the browser choose the optimal size. By setting a propersizes
attribute a developer can get the browser to use the size of image that they want, rather than needing to filter the image size so that it's changed for all uses.Designs
No response
Describe alternatives you've considered
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: