After reading several articles discussing the use of srcset
for device-pixel-density adjustments and art direction, I have come to a few conclusions:
The State of Responsive Images in 2015 by Paddi Macdonnell
srcset Part 2: The W descriptor and sizes attribute by Rich Finelli
Most sources suggest that w-descriptors should be used together with the sizes
attribute. However, based on my own testing, it seems image switching can indeed work using only w descriptors.
When specifying different images based on their width using the w-descriptor, browsers seem to automatically choose the best-fitting image without requiring additional code.
In the context of designing responsive websites, this simplicity is both convenient and confusing because as a designer, my needs are rather straightforward:
- Changing the image based on device-pixel-density (which works fine)
- Adjusting the image based on available width (also works well)
I am curious about how the inclusion of the sizes
attribute would affect these processes, especially considering its relatively new introduction.