W3C home > Mailing lists > Public > www-style@w3.org > February 2011

Re: CSS Variables

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 7 Feb 2011 10:47:00 -0800
Message-ID: <AANLkTikQfkj+cC=ATEfCKrTT9omaKTV6DJ+h7WTzr-4D@mail.gmail.com>
To: Peter Beverloo <peter@lvp-media.com>
Cc: Daniel Glazman <daniel.glazman@disruptive-innovations.com>, www-style list <www-style@w3.org>
On Sun, Feb 6, 2011 at 4:36 AM, Peter Beverloo <peter@lvp-media.com> wrote:
> Furthermore, I'm curious about the naming requirements for variable
> identifiers.  Which characters are allowed, and are the identifiers
> case-sensitive?

Variables are IDENTs (plus a $ prefix), which gives them the same
syntax as CSS keywords.  They're case-insensitive.

The CSSOM syntax will have a defined case, probably the same as what
HTML does with data-* and the .dataset property, where you
auto-convert something like "data-foo-bar" to "dataset.fooBar".


> One part of your blog post I am opposed to is the inclusion of CSS
> Modules.  The concept closely approaches that of CSS Namespaces, and
> when talking about "CSS Modules", the first thing that comes to mind
> are the modules which are part of CSS Level 3.  Neither two
> definitions of namespaces nor two definitions of modules can be
> desirable.
>
> Based on the fact that the namespacing concept is already available in
> CSS, I'm more in favor of advocating prefixing of variable names to
> authors from the first ED forward (e.g. @var csswg-example red).  This
> would be consistent with other parts of their CSS and JavaScript code
> as well, which many projects and libraries already do.

Yeah, naming is hard.  I'm not particularly happy with calling them
Modules or Namespaces, which is too bad since both of those are good
words for it.  I think the functionality is good, but the name is
definitely undecided.

~TJ
Received on Monday, 7 February 2011 18:47:55 GMT

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