[whatwg] <imgset> responsive imgs proposition (correction)

Bruno Racineux bruno at hexanet.net
Mon Nov 11 20:56:30 PST 2013


Just a correction on the 'custom' definitions of my previous msg.
I had this mixed up from previous values.

Here is the correct relation intended:

<imgset>
  logo: small 150 1x, medium 200 1x, large 300 1x 150 2x;
  custom: /(?<=\-)(.*)(?=\.)/s;
</imgset>

with:

<img width="300" height="100" src="logo-large.jpg" res="1x,2x"
sizing="custom"  
imgset="logo" sizes="small (360px) medium (800px) large">

Meaning that 'large' is both 300px at 1x and 150px at 2x.


And with a size of 'small' for a phone (at 1x) the browser can do the
math, and load 'large' at 2x resolution from the 'small' keyword.

Hence, breakpoint 'sizes' can be defined by using either a keyword or a
size.




More information about the whatwg mailing list