0

I have tried both SimpLESS and Crunchapp both return the same error.

I am trying to compile this bootswatch http://bootswatch.com/cyborg/ and when I do I get the following error.

Compiler Errors
variable @grayLight is undefined (Line: 17)

Does anyone know what I am doing wrong?

Sameera Thilakasiri
  • 9,452
  • 10
  • 51
  • 86
h00j
  • 308
  • 1
  • 7
  • 18

2 Answers2

3

You must define the variable in the same file where you using it:

@grayLight: #e7e7e7;

Or if it defined in another .less file you must import that to see the variable in another file:

@import "mixins.less";
laszlo-horvath
  • 1,852
  • 2
  • 19
  • 20
0

You have to asign the variable value first, for example:

@grayLight: #ffffff;

It's exactly as error said, you use variable that is undefined. Then you can call this variable at any place in code. If it happens you defined it earlier, check if names are equal (letterCase as well).

Malyo
  • 1,990
  • 7
  • 28
  • 51
  • It is defined in a different file (variables.less), does it have to be in the same file? – h00j May 24 '12 at 11:21
  • Yes, less script probably is setuped, to compile in file range only, there's even rule that you should always place a less file before compiler. – Malyo May 24 '12 at 11:24
  • RynoRn has answered my concern – Malyo May 24 '12 at 12:10
  • 1
    It doesn't have to be in the same file. That's what import is for. You SHOULD be importing from a variables.less file in each of your other less files. You SHOULD NOT import a mixins file from all other less files because this causes the mixins to run multiple times. Mixins should only be included once in your master less file. – GeekyMonkey May 24 '12 at 13:02