0
votes

I am currently working on an template using less and I have encountered an unusual error:

less ParseError: Missing closing ')'.

This is the code where the error occured:

less.modifyVars({
  '@buttonFace': '#5B83AD',
  '@buttonText': '#D9EEF2'
});

I am sure I correctly used the closing ')' but the error says I didn't. please help.

1
Are you using SimpLESS? - Shaun
You posted your JavaScript code which is correct actually. But your error is raised from your Less code. (Or are your trying to use modifyVars function in Less source code itself? This is wrong of course). - seven-phases-max

1 Answers

0
votes
 less.modifyVars({
  '@buttonFace': '#5B83AD',
  '@buttonText': '#D9EEF2'
});

I have a doubt, why do you have to use '' for variable and its value.

less.modifyVars({
  @buttonFace: #5B83AD,
  @buttonText: #D9EEF2
});

if the variable @buttonFace is a property, you are making it a string by using single quotes.

for example:

.mixin(@property, @value){
    @{property}:@value;
}

.blackButton{.mixin(background,#ccc);.mixin(color,white);}

.rule(@className;@rules){
    .@{className}{
       @rules();
    }
}

.rule(blackButton;{
    .mixin(background,black);
    .mixin(color,white);
});

or else could you please elaborate on your problem. All I see in your code is string : string;