W3C home > Mailing lists > Public > www-style@w3.org > August 2011

Re: [CSS3 Values] referencing width or height explicitly

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 19 Aug 2011 10:58:51 -0700
Message-ID: <CAAWBYDAiT-dt5quZCosH976xWREnRAkr12Us+Qek0i+DvnjbWw@mail.gmail.com>
To: Brian Manthos <brianman@microsoft.com>
Cc: "www-style@w3.org" <www-style@w3.org>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:43 GMT