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

Re: Better Variables through Custom Properties

From: Eli Morris-Heft <eli.morris.heft@gmail.com>
Date: Tue, 25 Oct 2011 13:49:18 -0500
Message-ID: <CABcnqoWSQ-5Z5-uFMASZOStm+Cn_AnHWJT6uNV9JiwfnoNdtXw@mail.gmail.com>
To: Brian Kardell <bkardell@gmail.com>
Cc: www-style@w3.org, Boris Zbarsky <bzbarsky@mit.edu>, "Tab Atkins Jr." <jackalmage@gmail.com>, Roland Steiner <rolandsteiner@google.com>
I'd think this would be a bad idea. The two really have nothing to do with
each other aside from being custom user data, and we can get data in the
correct direction using attr().

Maybe a better prefix is in order for these types of variables? var-*? $?
On Oct 25, 2011 1:32 PM, "Brian Kardell" <bkardell@gmail.com> wrote:

> I guess that's really more a question for css values and units in general
> :)
>
> On Tue, Oct 25, 2011 at 2:07 PM, Brian Kardell <bkardell@gmail.com> wrote:
> > What if you had
> >
> > #x {
> >    data-foo: attr(data-foo);
> > }
> >
> > and then in script you change the value of the attribute 'data-foo'?
> >
> >
> > On Tue, Oct 25, 2011 at 1:50 PM, Roland Steiner
> > <rolandsteiner@google.com> wrote:
> >> On Tue, Oct 25, 2011 at 10:41, Brian Kardell <bkardell@gmail.com>
> wrote:
> >>>
> >>> I take it from Tab's "similar to the data-* attributes in HTML" that
> >>> these are not HTML data attributes and would not be exposed in a
> >>> writable way via DOM/script?
> >>
> >> No, but AFAICT there shouldn't be a reason to not make HTML data
> attributes
> >> accessible via attr(), i.e.
> >> [data-foo] {
> >>   data-foo: attr(data-foo);
> >> }
> >> With this you could write to the HTML data attribute and the CSS
> variable
> >> (same name not required) should pick it up.
> >>
> >> - Roland
> >>
> >
>
>
Received on Tuesday, 25 October 2011 18:49:56 GMT

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