Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index a full srcset for the post thumbnail #3449

Open
1 task done
JakePT opened this issue Apr 18, 2023 · 0 comments · May be fixed by #3693
Open
1 task done

Index a full srcset for the post thumbnail #3449

JakePT opened this issue Apr 18, 2023 · 0 comments · May be fixed by #3693
Milestone

Comments

@JakePT
Copy link
Contributor

JakePT commented Apr 18, 2023

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
@JakePT JakePT self-assigned this Apr 18, 2023
@felipeelia felipeelia added this to the 5.0.0 milestone Apr 20, 2023
@felipeelia felipeelia assigned burhandodhy and unassigned JakePT Oct 6, 2023
@burhandodhy burhandodhy linked a pull request Oct 10, 2023 that will close this issue
4 tasks
@burhandodhy burhandodhy assigned JakePT and unassigned burhandodhy Oct 17, 2023
@felipeelia felipeelia modified the milestones: 5.0.0, 6.0.0 Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants