Vitamin
Vitamin

Reputation: 1526

LESS @import does not seem to work

Using the command line program lessc installed by following this guide on a Ubuntu machine, don't seem to compile @import rules as I expected.

$ echo '@import "inc.less"' > test.less
$ echo 'body { background: pink }' > inc.less
$ lessc test.less

The output is an empty line. I expected the contents of inc.less. Am I doing something wrong here?

Upvotes: 0

Views: 1800

Answers (1)

qxn
qxn

Reputation: 17574

Try @import "inc";

Don't use the .less extension. I also think you need a semicolon.

For example, here's a couple of lines that are working for me:

@import "blueprint/screen";
@import "blueprint/ie";

a, a:link, a:visited, a:hover, a:active
{
    text-decoration:none;
    color:#FF0000;
}

That imports blueprint/screen.less and blueprint/ie.less into the file.

Upvotes: 3

Related Questions