[whatwg] Media queries, viewport dimensions, srcset and picture
derernst at gmx.ch
Thu May 24 02:35:35 PDT 2012
Am 24.05.2012 11:13 schrieb Matthew Wilcox:
> I agree, the problem is that... it's still a problem. It's not always
> a cropped version, it's sometimes a different image entirely - but we
> can only sense the viewport rather than the space into which an image
> is sitting. Because we can only sense the viewport we are actually
> hooking into the design itself rather than being able to automate
> things based on "how much room is there for this image?". However it's
> cut, future maintenance is going to be a problem.
>> - New designs usually require other image dimensions, meaning that images
>> have to be recreated anyway.
> That's true, but the problem isn't so much that as it is that there
> will be different breakpoints. It's unlikely we'd be working with the
> same breakpoints, so the one's in the mark-up are all wrong. Leading
> to incorrect image selection. It's not trivial to revisit all mark-up
> to correct this.
Once CSS variables are available, would it be possible to reference them
from the @media attribute? Given a variable "breakpoint1" is defined in
the CSS file:
<source media="(min-width:var(breakpoint1))" srcset="tall.jpg 1x,
More information about the whatwg