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

How to use picture element as background image?

Updated November 28, 2017 21:07 PM