Re: [Media Queries] aspect ratio

On 22.08.2007, at 00:38, Håkon Wium Lie wrote:

> Also sprach Timur Mehrvarz:
>
>>>   @media screen and (max-aspect-ratio: 1/1) /* portrait or square */
>>>   @media screen and (min-aspect-ratio: 1/1) /* landscape or  
>>> square */
>
> Would you prefer the above to a keyword-based approach? E.g.:
>
>   @media screen and (aspect-ratio: portrait)
>   @media screen and (aspect-ratio: landscape)
>
> or
>
>   @media screen and (aspect: portrait)
>   @media screen and (aspect: landscape)
>
> or
>
>   @media screen and (portrait)
>   @media screen and (landscape)

It took me a while, but I got used to the original syntax. Also, I  
can imagine using other ratios than 1/1, but I have yet to explore  
this. Of course, the ability to use a keyword-based approach (as an  
alternative), may be more author friendly.

>>
> For a a phone with two states -- landscape and portrait -- it makes
> sense to evaluate the media queries when the state is changed. I
> expect all implementations to do this.

That's really good to hear.

> However, in an environment where the user resizes the viewport by
> hand, by dragging with a mouse, I don't think the spec should demand
> that media queries are evaluated during the resizing of the viewport.
> If we do so, resizing windows may become unbearably slow.
>
> I think this issue should be left to implementations.

Desktop implementations could, at least, consider doing an automatic  
re-rendering, when a user is done with resizing the window. And they  
would only need to do so, if certain queries were found in the  
document in the first place. This approach would not slow things  
down. It would actually be less heavy weight than requiring the user  
to reload the document. Which may also imply cost. Not to mention  
loss of state and users not being aware of a manual reload having the  
desired effect.

Aspect ratio specific stylesheets, used to the wrong aspect ratio,  
are horrible.

Timur

Received on Tuesday, 21 August 2007 23:43:38 UTC