Variables in CSS

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 UTC