- From: Zack Weinberg <zweinberg@mozilla.com>
- Date: Thu, 20 Nov 2008 23:00:20 -0800
- To: W3C Emailing list for WWW Style <www-style@w3.org>
Andrew Fedoniouk <news@terrainformatica.com> wrote:
> Time to time I am getting feature request to provide
> "keep aspect ratio" functionality in CSS.
...
>
> #my-golden-ratio
> {
> width: 30%;
> height: width(62%);
> }
>
> where width takes 30% of content box of #my-golden-ratio parent
> and height of the element will be set to 62% of its computed width.
Not a completely crazy idea, but you'd ultimately end up with one of
these functions for every length property. I think it'd be better to
generalize immediately: prop('name') which evaluates to the computed
value of the property named 'name', and can be used inside calc().
zw
Received on Friday, 21 November 2008 07:01:04 UTC