Using CSS @Variables

Tech4Wilco picture Tech4Wilco · Sep 28, 2011 · Viewed 8.8k times · Source

I am trying to use CSS Variables. I look online for tutorials and all of them worked so far.

Here's my CSS:

@variables {
 defaultColor: #8E5050;
 defaultBackGround: #E1DBC3;
}
body {
 background: var(defaultBackGround);
}
a {
 color: var(defaultColor);
}

I also tried:

body {
 background: @defaultBackGround;
}
a {
 color: @defaultColor;
}

None of them works, What am I doing wrong? Thanks

Answer

Petah picture Petah · Sep 28, 2011

I would use a CSS preprocessor such as Sass or Less.