Re: srcN - Alternative to picture and srcset

On Thu, Oct 3, 2013 at 3:58 PM, Jason Grigsby <jason@cloudfour.com> wrote:
> Catching up on the proposal today. Happy to see the stuff John Mellor
> mentioned on the WhatWG list almost a year ago finally getting addressed.
>
> One thing I wondered about was the syntax in the viewport use case
> (http://tabatkins.github.io/specs/respimg/Overview.html#viewport). Here is
> Tab's example code:
>
>   <img src-1="100 30em 400 70em 50%;
>              pic50.png 50, pic100.png 100, pic200.png 200,
>              pic400.png 400, pic800.png 800, pic1600.png 1600,
>              pic3200.png 3200">
>
> I find the first part of this to be difficult to parse.

Note that this is the most complex possible use-case.  The more common
case of just a "100%" is obviously pretty simple. ^_^

> '100 30em 400 70em
> 50%' In order to read it, I have to pair off each. And it will get more
> confusing if the author doesn't conveniently switch between pixels for image
> sizes and ems for media queries.
>
> May I suggest commas to clarify which sizes and viewports values are paired:
>
>
>   <img src-1="100 30em, 400 70em, 50%;
>              pic50.png 50, pic100.png 100, pic200.png 200,
>              pic400.png 400, pic800.png 800, pic1600.png 1600,
>              pic3200.png 3200">

The whole point of that is that you *don't* pair it off.  You're not
defining pairs, you're defining a line with breakpoints on it and
image sizes between/around them.  That's what my image attempted to
illustrate, though I think I need to tweak it a bit to make it even
clearer.  Pairing them requires you to remember whether the viewport
size is a min or a max, which is the most confusing part of the
current extended srcset syntax, and which I was trying to avoid.

~TJ

Received on Thursday, 3 October 2013 23:43:42 UTC