W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2013

Re: [whatwg] <imgset> responsive imgs proposition (Re: The src-N proposal)

From: Markus Ernst <derernst@gmx.ch>
Date: Wed, 13 Nov 2013 23:53:03 +0100
Message-ID: <528402CF.5010003@gmx.ch>
To: John Mellor <johnme@google.com>
Cc: Silvia Pfeiffer <silviapfeiffer1@gmail.com>, Adam Barth <w3c@adambarth.com>, whatwg <whatwg@lists.whatwg.org>, Christian Biesinger <cbiesinger@google.com>, "Jukka K. Korpela" <jkorpela@cs.tut.fi>, Ryosuke Niwa <rniwa@apple.com>, Markus Lanthaler <markus.lanthaler@gmx.net>
Am 13.11.2013 14:52 schrieb John Mellor:
> <style>
> @media (max-width: 19.99em) {
>      .artdirected { content: replaced image-set(128px; attr(srcs-smallicon));
> }
> }
> @media (min-width: 20em) {
>      .artdirected { content: replaced image-set(100% (30em) 50% (50em) 33%;
> attr(srcs-flexwidth)); }
> }
> </style>
> ...
> <img class="artdirected" src="fallback.jpg"
>       srcs-smallicon="i64.jpg 64, i128.jpg 128, i256.jpg 256"
>       srcs-flexwidth="160.jpg 160, 320.jpg 320, 640.jpg 640, 1280.jpg 1280,
> 2560.jpg 2560">
>
> (note that the above is a maximally complex example, incorporating art
> direction, viewport-switching and dpr-switching; most normal cases would be
> simpler than this)

Looks great to me. Just verbose enough to be understood by average 
authors (as I am one), perfectly maintainable, and as powerful as src-N.
Received on Wednesday, 13 November 2013 22:53:34 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:14 UTC