cloudhead/less.js — Issue #484: Incorrect @import order
Author: kennethjor
Created: 2011-11-23 15:13:31+00:00
State: open

I noticed what appears to be a bug in the import order between .css and .less files.
Suppose I have the following three files:

main.less:

@import url("first.less");
@import url("second.css");
@import url("third.less");

first.less:

.first {
color: #000;
}

second.css:

.second {
color: #111;
}

third.less:

.third {
color: #222;
}

Executing `lessc main.less` produces the following result:

@import url("second.css");
.first {
color: #000;
}
.third {
color: #222;
}

The import of `second.css` is placed above the parsed content of `first.less`, which had its original import statement placed before the second one.

Unless I'm overlooking something, the expected result would be:

.first {
color: #000;
}
@import url("second.css");
.third {
color: #222;
}