Re: Proposal for adding variable declaration blocks

On Fri, Jul 18, 2008 at 4:14 PM, Francois Remy
<fremycompany_pub@yahoo.fr> wrote:
> I don't like $varName. I much prefer var(varName);

I don't care, honestly.  var() is more CSS-style.  I just prefer
$varName over =varName or =varName=.

> If we choose for var(varName), it will be possible later to add some other
> functions like :
>
>   var(oHeight + '5px')
> or
>   var(oWidth * 3)
> or
>   var('10%' - ('50px' * 2))
> or
>   color: var(iif(isDefined('tColor'), tColor, 'blue'))

You mean like the already-existing calc() function?  calc(
var(oHeight) + 5px ) or calc( $oHeight + 5px ) or whatnot should
already work, in browsers that support calc() as well as variables,
since variables are just another data type.  I assume that's the
intent, anyway.

The last one can just be

color: blue;
color: tColor;

since the second statement will be silently dropped if tColor is
undefined.  Adding generic conditionals would probably make CSS
Turing-complete, which I believe is something that's intentionally
avoided to ensure simplicity and speed.  If you need complex
conditionals that actually require things like iif(), that's what
JavaScript is for.

> PS : I'm not against $varName as shortcut of var(varName);

Keeping one syntax for doing one thing should definitely be a goal
here.  Pick one or the other, don't take the "add all the syntaxes
people might like and let them pick" approach.

Received on Friday, 18 July 2008 20:25:25 UTC