Re: CSS Variables

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 UTC