Tech4Wilco Tech4Wilco - 1 month ago 10
CSS Question

Using CSS @Variables

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

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

Comments