W3C home > Mailing lists > Public > www-style@w3.org > September 2012

Re: [css-variables] Custom properties using the 'var' prefix? (Issue 1, !important)

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 6 Sep 2012 10:55:26 -0700
Message-ID: <CAAWBYDB0kn=8KeQuLSNGMZDq709gbKF9akD-W+ocTe-8q2+Rbg@mail.gmail.com>
To: François REMY <fremycompany_pub@yahoo.fr>
Cc: CSS WG <www-style@w3.org>
On Thu, Sep 6, 2012 at 2:40 AM, François REMY <fremycompany_pub@yahoo.fr> wrote:
> Most of us don’t understand why, when ‘Variables properties’ were renamed
> into ‘Custom properties’ in the spec, the spec itself wasn’t renamed ‘CSS
> Custom Properties’ like our proposal is.

Please don't imply that you speak for the majority of authors.  I
understand that you feel strongly about the naming issues, but from my
own unsolicited feedback, lots of people seem perfectly fine with the
current naming.  (I was expecting a *lot* more vitriol in my last
Variables thread, but got virtually none.  Nearly everyone that
commented on the name said that it made sense to them.)

> Also, we contest the ‘var’ prefix being used. If ‘custom properties are not
> variables’, using the ‘var’ keyword doesn’t make sense anymore.
>
> The name of CSS Custom Properties specification has been chosen on purpose.
> Since this spec aims to differentiate itself from macro-like functionality
> of preprocessed variables, it doesn't make sense for it to be called CSS
> Variables. In fact, it doesn't define any variable at all, only properties
> and property references.

It's valid to look at it that way, but it's not the *only* way to see
things.  I think that looking at custom properties as defining a
variable is a useful mental model.  This is easier to extend in some
way, too - for example, the SVG Parameters specification can be built
on top of Cascading Variables just by specifying that a param in the
URL defines a variable accessible on the root element.

> This specification uses the 'my' prefix for custom properties on purpose for
> custom properties for three main reasons:
>
> It's the prefix that developers used naturally, for years, when they were
> using or asking custom properties. If necessary, I can find a lot of samples
> of that.

I have never seen this.  It would be kind of weird, actually, since
Perl is the only language I know of that uses "my" in reference to
variables.

Mostly, when people talk about custom CSS properties they either use
x- or don't use any prefix at all.

> It does clearly explain the status of the property: the property is yours,
> you can use it for anything you would like to and the browser won't mess up
> with your code.
> Meanwhile, it's a very short prefix that's not cumbersome to type.
>
> Beside this, this specification also replace the 'var' and 'parent-var'
> functional notations with the more informative 'use()' and 'inherit()'
> functions. It’s interesting to note that ‘color: inherit(color)’ has the
> same behavior as ‘color: inherit’ in our proposal.

I challenge the assertion that use() is "more informative".  It seems
roughly the same as var() (though I'd argue that var() is actually
better, since you immediately know what it's used for).

~TJ
Received on Thursday, 6 September 2012 17:56:14 GMT

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