Re: suggestion: fixed-aspect-ratio CSS rule for block elements

On May 5, 2010, at 5:17 PM, Julien Cayzac wrote:

>> 3) We add aspect-ratio, but have it only interact with 'auto' values
>> for width/height.  So, in the previous example, the aspect-ratio would
>> have no effect, since both width and height are already specified.  If
>> you set height:auto instead, though, then aspect-ratio will be
>> consulted to resolve it.  Or you could set height and leave width as
>> auto, so aspect-ratio would also have an effect.  Finally, if both
>> were auto (the default), then whichever is resolved first (typically
>> width) would be resolved normally, then aspect-ratio would be used to
>> resolve the other dimension (typically height).
>> I like #3 the best.
> 
> Same here. The way dimensions get resolved is more understandable this way

I think that is the best choice, to avoid confusion over which height/width to use. Also, I would go further and say that it only interacts with 'auto' values when there is no conflicting  min/max-width/height in that dimension (min/max takes precedence).

Received on Thursday, 6 May 2010 04:36:27 UTC