I like the concept, but the syntax feels awkward, clunky and very specific.
Why not repurpose the media attribute from style tags to all other tags?
Why not repurpose the media attribute from style tags to all other tags?
Yeah, stuff like "2x 100w" looks a bit like magic numbers[1]
Also there's potential for confusion in 'x' - does it mean X as in a co-ordinate i.e. width, or zoom? I'd rather see something more verbose like this:
<img src="foo.jpg">
<set src="foo1.jpg" width="100">
<set src="foo2.jpg" density="2">
</img>
Yes it's more wordy to write, but you read code more than you write it so it makes sense to optimise for readability over byte-shaving. <setsrc>
<img src="foo.jpg">
<set src="foo1.jpg" width="100">
<set src="foo2.jpg" density="2">
</setsrc>
Always be wary of allowing arguments that hinge on "it's not technically possible" to shut down good ideas. <imgset>
<img src="foo.jpg">
<img src="foo1.jpg" width="100">
<img src="foo2.jpg" density="2">
</imgset> imgset img{display:none;}
imgset img:first-child{display:block;}
Same with modern HTML5 tags, modernizer or any other tool would handle that for you.http://www.libpng.org/pub/png/book/chapter11.html#png.ch11.d...