W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2012

Re: [whatwg] Problems with width/height descriptors in srcset

From: Markus Ernst <derernst@gmx.ch>
Date: Fri, 18 May 2012 11:17:43 +0200
Message-ID: <4FB613B7.3090300@gmx.ch>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: Jeremy Keith <jeremy@adactio.com>, whatwg@lists.whatwg.org
Am 17.05.2012 19:48 schrieb Tab Atkins Jr.:
> On Thu, May 17, 2012 at 10:27 AM, Jeremy Keith<jeremy@adactio.com>  wrote:
>> Tab wrote:
>>> Absolutely agreed.  Like several others have suggested, I think we
>>> should just go with a "min-width:100px" approach, which is much
>>> clearer.  It also lets us add "max-width", though that may complicate
>>> the resource choosing algorithm a bit.
>>
>> Just to be clear, do you mean changing the syntax so that Nw is replaced with min-width:N?
>>
>> e.g.
>>
>> <img src="small.png" srcset="medium.png min-width:600px, large.png min-width: 800px">
>>
>> or
>>
>> <img src="large.png" srcset="medium.png max-width:800px, small.png max-width: 600px">
>
> Yes, you got it.
>
>> Those two examples would then be functionally equivalent (give or take a single pixel) but allow developers to take a "Mobile First" or "Desktop First" approach according to their preference.
>>
>> Related question: do we still want to keep this unit-less i.e. ditch the "px" from the examples above? Or, if we're going to use this CSS-like syntax anyway, allow other units of measurement (e.g. ems).
>
> No, if we're aping the CSS syntax more closely, we should just use CSS units.

<h1><img src="small.png" srcset="medium.png min-width:30em, large.png 
min-width:50em"></h1>

<p><img src="small.png" srcset="medium.png min-width:30em, large.png 
min-width:50em"></p>

Is em different in these 2 elements, or is it actually rem? And whatever 
answer, is it a problem or a feature?
Received on Friday, 18 May 2012 09:18:32 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:08 GMT