Responsive image style with srcset and without sizes

by fritzmg   Last Updated November 14, 2017 12:07 PM

Using this tutorial for example I found out how to use responsive image styles in Drupal 8 without <picture> (which is pretty straight forward anyway).

However this approach forces you to use sizes. The article says

The default here 100vw is hard-coded for a good reason, it's a pretty sane default and works well in most situations.

which I completely disagree with. I find that in most cases you simply want to provide higher resolution images of simple <img>s for devices with a dppx that is greater than 1.

So how do I achieve something as simple like

<img src="foo_320.png" srcset="foo_640.png 2x">

with responsive image styles in Drupal?

Related Questions

Use responsive images inline

Updated April 21, 2017 15:07 PM

Webform: display image uploaded by user

Updated April 15, 2015 22:03 PM

Image url expires

Updated January 11, 2017 08:03 AM