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

Re: CSS Variables

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 8 Feb 2011 21:10:35 -0800
Message-ID: <AANLkTinOfX+20Sa4kH8M5rSO97DP6ORwZRmO=JyAuR_Y@mail.gmail.com>
To: Alan Gresley <alan@css-class.com>
Cc: www-style list <www-style@w3.org>
On Tue, Feb 8, 2011 at 5:18 PM, Alan Gresley <alan@css-class.com> wrote:
> Anyway my example had the syntax partly wrong.
>
> @var $US red;    span:before { content: '$US' }  <span>100</span>

You get something looking like <span><::before>$US</::before>100</span>.

You do *not* get <span><::before>red</::before>100</span>, because you
didn't invoke the variable.  You just have a string who's contents
look like the name of a variable.  If you want this version, do this
instead:

span::before { content: $US; }

~TJ
Received on Wednesday, 9 February 2011 06:09:36 GMT

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