Re: [whatwg] Implementation complexity with elements vs an attribute (responsive images)

On Sun, May 13, 2012 at 8:55 PM, Bjartur Thorlacius
<svartman95@gmail.com> wrote:
> But the chosen image resolution might be a factor for choosing layout.

Maybe we should think of a way to expose _that_ information to CSS,
rather than going in the other direction.

<section>
  <img src="a.jpg" alt=""
       set="a.jpg 600x200 1x,
               b.jpg 600x200 2x,
               c.jpg 200x200">
</section>

section { /* generic style rules */ }
section! img:intrinsic-aspect-ratio(<2) { /* specific overrides for
section when the UA picks the narrow image */ }

--
Benjamin Hawkes-Lewis

Received on Sunday, 13 May 2012 20:17:55 UTC