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

span::before { content: $US; }

Received on Wednesday, 9 February 2011 06:09:36 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:56 UTC