Image candidate filtering does not allow to specify container dimensions
Closed this issue · 1 comments
When passing multiple image candidates as a srcset, the document dimensions are being used to find the best matching image. It would be great to be able to pass in the container that serves as a wrapper for the image.
The function getBestImage already supports handling a view element, but there is currently no directive attribute that allows to pass in the view.
I know the service has support, we actually had this option in the past. But you then introduce the issue you want to know when the container is resized (for example rotation screen). That introduced too much complexity and also people didn't understand it anymore in our own team.
So basically what we said was that a container is always getting some room on your screen and you define your own breakpoints per container, so if on 768 your container is halve you can serve halve the image for that specific @MQ. We also have different image dimensions per breakpoint and that logic is based on how our grid flows which is always based on window.