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

Re: [css-variables] Putting it all toegether (syntax)

From: Brian Kardell <bkardell@gmail.com>
Date: Mon, 4 Jun 2012 20:51:40 -0400
Message-ID: <CADC=+jcK3-v4ria9Mh431OjNMP5D8Eo6M50=vANO-Uzy8Li9eQ@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: François REMY <fremycompany_pub@yahoo.fr>, CSS 3 W3C Group <www-style@w3.org>
On Jun 4, 2012 6:56 PM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:
> On Mon, Jun 4, 2012 at 9:36 AM, François REMY <fremycompany_pub@yahoo.fr>
> > 5.    Why we don’t want { $foo: bar }
> >
> > As noted by some users, this syntax is confusing; firstly because
> > expect intuitively to be able to use preprocessor variables anywhere,
> > including in selectors and to shorten property names. This means that
> > bar” can easily be confused as “the property name contained by the foo
> > variable should be set to bar” instead of “the foo variable should be
set to
> > bar”.
> I don't think this is valid.  If authors do labor under this
> misconception, it will only be for the handful of moments until they
> actually learn what it does.  There's no way to read even a trivial
> amount of variable usage without seeing what's going on, so confusion
> can persist no more than a few seconds.  ^_^

I agree that people can learn it, people learn more essoteric things than
this everyday, but it seems to me that it is an optimistic speculation to
imply that the confusion will be trivial and easily overcome... We have
witnessed confusion on the list by people who are generally fairly
well-versed which lasted a while despite attempts to explain.  Given the
relatively few number of people who have commented on this particular
aspect,  I showed examples with both forms ($ on the left, but matching and
prefixed) to a dozen or so developers and designers and they were uniformly
confused by $ on the left, and that is with trivial rules in which
definition and use are in close proximity.  Further, after I explained it,
they also uniformly said something along the lines of "why"?  Matching as
an explanation just didn't cut it.  I am fully aware that that isn't
scientific proof and I am not trying to extrapolate but I see nothing there
to make me think "ok, it's just me"... A segment (at least) of people will
be significantly confused.  Can they overcome it?  Sure.  My question is:
what is so compelling about left and right both having $ to warrant asking
them to do so when a prefix (as the draft has had) does not suffer from
this problem.

> Further, we *can not ever* have property names determined by
> variables, without drastically altering the way the cascade is
> resolved.  Variables, as they are, already require some hacky handling
> of properties whose values become invalid after variables are
> substituted.  If we couldn't even figure out which properties were
> being used until variable substitution time...

Fully agree.  It would be ideal if the syntax didn't give the impression
that you could either though and that is the bit that I personally have
misgivings about.  Again, maybe there are just two or three of us that
think this... if that is the case, then maybe we are wrong.  It would be
nice to hear some other opions.

> The Core Grammar is not frozen.  We can change it in ways that are
> compatible with legacy content, just like we can do with every other
> feature of the entire web platform.
Sure, but if there isn't a clear benefit I we should lean toward "not" -
Received on Tuesday, 5 June 2012 00:52:10 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:00 UTC