W3C home > Mailing lists > Public > www-style@w3.org > December 2001

Variables in CSS

From: (wrong string) šper <christoph.paeper@tu-clausthal.de>
Date: Thu, 6 Dec 2001 00:22:51 +0100
Message-ID: <02d901c17de3$c2a81c90$3ef4ae8b@heim4.tuclausthal.de>
To: <www-style@w3.org>
Lately in news:de.comm.infosystems.www.authoring.misc the question came to
variables in CSS, in the actual case as a handy way to keep colors used in
several places up to date, but not limited to colors. E.g.:

@var {
  $fore: #000; /* $ sign was taken as it's been introduced to indicate */
  $back: #FFF; /* variables in other languages already, e.g. PHP */
}

body {
  color: $fore;            /* or var($fore) */
  background-color: $back;
}

h1, h2 {
  color: $back;
  background-color: $fore;
}

Maybe it would be a better idea to incorporate this into a CSS editor and
not the browser -- offline / editor side includes like some HTML editors
already have.

Christoph

P.S.: I'm quite new to this ML, so maybe this has been discussed here
before, although I didn't find anything in a quick look in the archives.
Received on Wednesday, 5 December 2001 18:23:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:11 GMT