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

Re: Better Variables through Custom Properties

From: L. David Baron <dbaron@dbaron.org>
Date: Wed, 26 Oct 2011 11:41:06 -0700
To: www-style@w3.org
Message-ID: <20111026184106.GA8354@pickering.dbaron.org>
On Monday 2011-10-24 16:39 -0700, Tab Atkins Jr. wrote:
> Here's the same example, using a slight variant on Roland's suggested grammar:
> 
> :root {
>   data-main-color: #06c;
>   data-accent-color: #006;
> }
> h1 {
>   color: data(main-color);
>   border-left: thick solid data(accent-color);
> }
> 
> In this simple case, two custom properties are set on the root
> element.  They inherit down to the h1, where they are referenced with
> the data() function.  Here I'm assuming that properties prefixed with
> "data-" are "custom properties", which are valid but defined to be
> meaningless, similar to the data-* attributes in HTML.

Do all data-* properties inherit by default, or is there any
provision for such properties that do not?  (I'm not sure if there
needs to be; I'm just trying to understand what the model you're
proposing is.)

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                           http://www.mozilla.org/   𝄂
Received on Wednesday, 26 October 2011 18:41:40 GMT

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