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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 29 Aug 2012 09:18:28 -0700
Message-ID: <CAAWBYDALgaSiA=GJGp3G0y-8wgvQAbp+7GkqZR7SLffH14VQNA@mail.gmail.com>
To: Chris Eppstein <chris@eppsteins.net>
Cc: Brian Kardell <bkardell@gmail.com>, "Jens O. Meiert" <jens@meiert.com>, www-style@w3.org
On Tue, Aug 28, 2012 at 6:29 PM, Chris Eppstein <chris@eppsteins.net> wrote:
> I'm on record as getting behind this spec as custom properties if they are
> _really_ like properties and reading them is the same as reading non-custom
> properties.

To be accurate, you're wanting the ability to read normal properties
the same as custom properties.  (The order you phrased it implied that
you can already read the values of normal properties.)

This is unrelated, and troublesome.  Normal properties have lots of
interesting interconnections that make arbitrary reading troublesome,
to say the least. I'm hoping that we can finagle the ability to read
normal properties off of the parent, but whether it happens or not is
still up in the air.  Reading normal properties off of yourself is
completely out, at least generally (doing it for *some* properties
might be okay, but it locks us in to never introducing connections
between those properties).  However, reading a normal property off of
yourself is identical to just creating a variable and using it twice.
That is, your example:

foo {
  var-foo: 50px;
  width: var(foo);
  height: value(width);

Can just be written as:

foo {
  var-foo: 50px;
  width: var(foo);
  height: var(foo);

> You must be listening to a different corner of the twittersphere/blogosphere
> than I am -- most everyone in my echo chamber finds the current syntax to be
> incongruent and cumbersome.

Unscientifically, my own blog comments are surprisingly supportive.  I
figured there'd be more hate.

> What's more, if we're going to all the way with making these custom
> properties, I think that document inheritance is only sometimes desired and
> that there should be a way to define properties that do and do not inherit.
> This is basically the same as real CSS properties, there are just some of
> them that don't make sense to inherit and forcing it will just create
> annoyance. This could be as simple as a naming convention but it could also
> be done via a modifier e.g. !inherits;

I agree.  I plan to define something for this in level 2.

> Lastly, given that the stated explanation for why these variable are not
> using a more variable like syntax, is that there's a desire to reserve that
> syntax for macro-style variables in the future, I would excise the word var
> from this spec.

There's no such thing as macro-style variables, just macros. ^_^
If/when we do them, we'll just call them macros.

Received on Wednesday, 29 August 2012 16:19:19 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:20 UTC