6

I am trying to use the mixins.less file from Twitter Bootstrap in my project. All instances of multiple parameters that are separated by semi-colons show:

Undeclared mixin

The function arguments are unclosed, ')' expected.

Undeclared variable

I have WebEssentials 2012 v2.9 installed. Is there a way to get this working without using a different Less compiler? Or is the compiler in WebEssentials not the issue?

Community
  • 1
  • 1
JSchaffner
  • 63
  • 1
  • 3
  • It is an issue with WebEssentials. If you convert all of the semicolons to commas, you should be good to go. – ArrayKnight Aug 13 '13 at 23:00
  • I thought of doing that, but one of the concerns I had with that approach was that in the event where a list needs to be passed in as one of multiple arguments, the compiler would be unable to distinguish between the members of the list and the start of the next argument. – JSchaffner Aug 13 '13 at 23:10
  • Yup, that is the downside. You'll either have to switch compilers or avoid that scenario until WebEssentials is fixed. – ArrayKnight Aug 13 '13 at 23:13
  • That's what I was afraid of. Will switching compilers require pulling WebEssentials out completely, or can I use a different one and keep WebEssentials for its other uses? – JSchaffner Aug 13 '13 at 23:30
  • Also, could you submit your original response as an answer so I can accept it? – JSchaffner Aug 18 '13 at 02:20

2 Answers2

11

Unfortunately, the Web Essentials plugin for Visual Studio has not been keeping up with all of the LESS CSS standards and fails when semicolons are used as separators. In the meantime, you'll want to convert the semicolons to commas, with the downside that you'll no long be able to pass a list of arguments.

Web Essentials is constantly being updated, so I wouldn't be surprised if this is fixed very soon.

ArrayKnight
  • 6,956
  • 4
  • 17
  • 20
  • 1
    The LESS parser is part of Visual Studio itself (since 2012.2) and cannot be updated in Web Essentials. – SLaks Dec 17 '13 at 13:04
  • I getting an undeclared mixin with 2013! Can you believe this? – ATL_DEV Jan 26 '14 at 23:45
  • @SLaks Can you provide a link to that? Right now we use dotLess's compiler executable to smash LESS files into CSS, and we are experiencing the same symptom when trying to smash Bootstrap LESS files. Their LESS uses semicolons instead of commas to separate parameters. – one.beat.consumer Sep 12 '14 at 18:16
  • @one.beat.consumer: A link to what? – SLaks Sep 12 '14 at 21:22
0

You can't use the mixins.less by itself. You are getting errors because the mixin.less relies on other files, primarily variables.less. You compiler should tell you what lines are throwing the error. If not, try a different compiler. I use Codekit.

You can manually add the missing variables if needed although this seems to be a lot of unnessary work. I would suggest either using the whole Bootstrap framework or simply using the specific mixing your are wanting and adding in variables as needed..

Joe Conlin
  • 5,976
  • 5
  • 25
  • 35
  • 1
    The project already incorporates Bootstrap, I also added the entire group of Less files for it from GitHub and imported Bootstrap.less into my stylesheet. – JSchaffner Aug 13 '13 at 23:10