Re: [css-variables] the new ED for CSS Variables

Tab Atkins wrote:

> > I mentioned this a few months ago, but I would like to reiterate:  I
> > think it is definitely worth going to some measure to ensure an
> > understanding of the actual relationship between data properties in
> > CSS and data properties in HTML as I can easily see confusion here
> > with people doing something like:
> >
> >    <div data-foo="something">
> >
> > and then expecting to be able to say:
> >
> >    div{
> >          property:  data(foo);
> >    }
> >
> > Or vice versa.
> 
> Naming is still somewhat up in the air.  We may just change the name
> entirely, to var-* or something.  If we don't, then I think it would
> be good to add a note saying that it's merely a surface resemblance.

During the TPAC discussion of this proposal there was a brief discussion
of this.  Not all of that discussion got minuted but I remember Peter
Linss mentioned that he thought we should use functional notation
throughout rather than have 'data-' (or 'var-') micro-syntax and I tend
to agree with him.

So instead of:

  div {
    data-foo: xxx;
  }

  #content { color: data(foo); }

the author would use:

  div {
    data(foo): xxx;
  }

  #content { color: data(foo); }

This way the definition and use stays the same and there's less potential
for an author misconstruing a data-xxx thingy as some property they don't
know.

I think it would be a good idea to mark naming as an issue in the spec, noting
the '$', 'var-' and functional syntax proposals, along with your objections
(changes to the CSS core grammar as I recall or whatever).

Regards,

John Daggett

Received on Monday, 20 February 2012 04:55:38 UTC