[whatwg] Media queries, viewport dimensions, srcset and picture

Matthew Wilcox mail at matthewwilcox.com
Thu May 24 02:46:57 PDT 2012


>> 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, tall2.jpg
> 2x">
>

I don't want to take this thread too far off topic, but the "we'll
have changing breakpoints at some point" problem is a major reason why
http://www.w3.org/community/respimg/2012/05/13/an-alternative-proposition-to-and-srcset-with-wider-scope/
was thought of. It has it's own drawbacks, but it does address the
problem of breakpoint management and centralisation of breakpoints
throughout the technology stack of HTML/CSS/JS.



More information about the whatwg mailing list