Re: [CSS3 Values] referencing width or height explicitly

On Fri, Aug 19, 2011 at 10:45 AM, Brian Manthos <brianman@microsoft.com> wrote:
> http://www.w3.org/TR/css3-values/#calc
>
> Is there a way to reference both width and height of the associated element
> explicitly via calc()?
>
> If not, can we add it to the proposal list for CSS4 Values?
>
> Having such support would allow more flexible specification of properties
> (such as gradients) that are sensitive to aspect ratio.  In retrospect,
> aspect ratio would be enough to solve some of the scenarios, but having
> width and height (and doing division within the calc when you want aspect
> ratio) is much more powerful.

In general, allowing this exposes circularity problems.  You really
want to expose this explicitly as an aspect ratio, via something like
the aspect-ratio property I have written up on my blog:
<http://www.xanthir.com/blog/b4810>.

Even if there were "element width" and "element height" units, you
couldn't use them in calc() to do things aspect-ratio related, because
you can't divide by a dimension.

> [Sidenote: “W3C Working Draft 19 September 2006”..  eep!]

Yeah, why do you think Fantasai and I are trying to get it updated?  ^_^

~TJ

Received on Friday, 19 August 2011 17:59:46 UTC