Re: [CSS3 Values] referencing width or height explicitly

For that purposes I was forced to introduce width(N%) and height(N%) "functions". 
So you can say:

div {  height: width(10%);  }
But this will not work 

div {  width: height(10%);  }
as height() can be used only in properties that do not change dimensions like background-position, etc.

So I‘ve introduced concept of “colored percentage“ units – “percentage-of-what-actually”.

Just an idea. They (c%u) fit into CSS nicely – no changes are required other than introduction of such functions somewhere in http://www.w3.org/TR/css3-values/

-- 
Andrew Fedoniouk

http://terrainformatica.com



From: Brian Manthos 
Sent: Friday, August 19, 2011 10:45 AM
To: www-style@w3.org 
Subject: [CSS3 Values] referencing width or height explicitly

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.

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

Received on Saturday, 20 August 2011 03:49:59 UTC