asual / lesscss-engine

LESS Engine - A Java wrapper for less.js
http://www.asual.com/lesscss
Apache License 2.0
220 stars 66 forks source link

Problem with relative path in imported less #27

Closed ndkhoiits closed 12 years ago

ndkhoiits commented 12 years ago

Hi team,

I'm facing with a problem which relate to relative path in an imported less, I'll show my case in the commit https://github.com/ndkhoiits/lesscss-engine/commit/4e10c3d6362f292c1c91c1030c611d1ec4f83ebd

The problem is demonstrated as following: I have a less file at root folder named main.less, a file in inc folder named imported.less, and a list of images in background folder subfolder of inc

|─── main.less |─── inc | |──── imported.less | |──── background

Now, in imported.less, I have a style like that:

.profile {
   float: left;
   background-image: url('background/image.png');
}

and the main.less

@import "inc/imported.less";

Now, my output expectation is :

.profile {
   float: left;
   background-image: url('inc/background/image.png');
}
ndkhoiits commented 12 years ago

I've tested with less.js, and I got what I want.

asual commented 12 years ago

Thanks for the nice explanation! I integrated your testcase locally and was able to reproduce the issue. I will look into it when I find some time.

asual commented 12 years ago

I'm not able to achieve the desired output with less.js. How did you manage to get what you want? Are you testing in the browser or using node?

ndkhoiits commented 12 years ago

I'm testing on Browser with less.js as client compilation

asual commented 12 years ago

Can you please try to verify this with the command line node.js version? Unfortunately I may not be able to provide a solution if it works like this under the node and rhino.