A. Murray
A. Murray

Reputation: 2801

Web Essentials Including existing style in new LESS style from another CSS file

I'm using version 3.0 of the Web Essentials for VS2012 and I'm experiencing an issue trying to create a new style based on the styling applied to another existing style in a separate CSS file (in the same directory).

At the top of the LESS file I'm doing a:

@import "bootstrap.css";

Assuming my understanding of mixins is correct, every CSS style is effectively a mixin and according to the LESS guidance, all the styling of one style can be applied to another straightforwardly like so:

.input-validation-error {
    .has-error;
}

However, web essentials red-squiggly-underlines my .has-error; style and won't compile the LESS file into CSS. When I hover over the error is states:

Undeclared mixin

Upvotes: 0

Views: 566

Answers (1)

Olly Hodgson
Olly Hodgson

Reputation: 15775

Web Essentials doesn't appear to compile mixins etc in from CSS files, only LESS files. I found I had to include the original bootstrap.less files, like so:

@import "../../Bootstrap/less/bootstrap.less";

Obviously your path might be different!

Upvotes: 2

Related Questions