4 ms·
To me it's really annoying that I need to specify the sizes attribute in order for the browser to make a sensible choice about which image version to download.
by yakubin 5y ago
To me it's really annoying that I need to specify the sizes attribute in order for the browser to make a sensible choice about which image version to download. The browser could do it on its own based on layout. It really feels laborious (if done manually, or even implementing the automation) and like filling out the implementation details for the browser vendors.
Another hurdle is that you can't specify the heights of images. So now you're left with translating all those bounds from width x height to just width based on width x height of viewport. This srcset and sizes business feels really half-baked.
I wish I could just give the browser a list of image versions with their dimensions (both width and height), and the browser would just pick the smallest one with sufficient quality for a given viewport based on size of the viewport and dimensions of the img element in the given layout, i.e. the website author would only specify content and its different versions in a declarative way, not fill out algorithm details.
- deleted 5y ago[deleted]