Re: [css-variables] Different syntax for variable definition and use

On Thu, Aug 30, 2012 at 8:40 AM, François REMY
<fremycompany_pub@yahoo.fr> wrote:
> |  No damning argument, only that it's basically exactly the same as the
> |  current spec, but with very slightly different names, and I like my
> |  names better. ^_^
>
>    1) Most people agree we should not call "CSS Variables" variables
> anymore. Using 'var' is not only a bad idea but doesn't make sense.
> "Variables properties" are not variables, they are properties. A variable
> doesn't belong to an object, where 'css custom properties' belong to the
> element they apply on. Calling them 'variables' is a non-sense, they are not
> any variabler than other properties. Honestly, I think you're the only one
> still defending the 'variable' terminology.

You may want to check the draft.  I switched the terminology to
"custom properties" a week or two ago.

>    2) This minimalist counter-proposal is not the same as your current ont
> at all, because the *same* idenfier is used to define and use the variable
> (ie: the difference is in the 'x-' or 'my-' or 'user-' being included in the
> 'use()' or 'val()' function. It's not logical to have a different identifier
> to define and use the variable, and the first reason it's bad is that it
> makes CTRL+H difficult. I'll have to make two of them to rename my variable,
> which is one more than it should.

It's a tradeoff.  You may have to do a second search/replace while
renaming, but you have to type an additional four characters all of
the time.  "var(var-foo)" just seems... redundant.

>    3) If we want to support the use of any property in
> 'use()'/'val()'/'var()' or 'parent-var()'/'...' we will have a problem if we
> didn't included the 'my-'/'x-'/'user-'/'var-' prefix from start.

Actually, referencing arbitrary properties and referencing variables
are different even if we ignore the potential problems with the
former.  Variables start out invalid, and you want fallback so you can
provide a value for that case (technically unnecessary, but *much*
more convenient and easier to understand than trying to select only
the first element to set the initial value, and only the remaining
elements to set the subsequent values).  Normal property values have
no such problem.

If we do get arbitrary property referencing, we'll want another
function, like value() or prop() or something.

~TJ

Received on Thursday, 30 August 2012 16:40:31 UTC