Less, @ include and incorrect url

mercredi 23 janvier 2013

Previously, I had a large file and styles.less about this structure:
 project /
 | - Im /
 | | - Image-1.jpg
 | | - Image-2.png
 |  
 | - Js /
 | | - Js-file-1.js
 | | - Js-file-2.js
 |  
 | - Styles.css
 | - Styles.less 


Using SimpLESS 1.4 file styles.less compiled in styles.css and everything was fine.
The fact that the project is on a different hosting and depending on the settings files can be static or in a subdirectory or in a separate CDN. Then towards Kartik indicated relatively less-file inside:

div { background: url('background.png'); } 


Now the file was too big and I want to break it down into sub-files:

 project /
 | - Im /
 | | - Image-1.jpg
 | | - Image-2.png
 |  
 | - Js /
 | | - Js-file-1.js
 | | - Js-file-2.js
 |  
 | - Less /
 | | - Lib.less
 | | - Foo.less
 | | - Bar.less
 |  
 | - Styles.css
 | - Styles.less 


Content styles.less :
 @import "less/lib"; @import "less/foo"; @import "less/bar"; 


As a result, code that is in the file less/foo.less :
 div { background: url('background.png'); } 


Is compiled into the following nonsense:
 div { background: url('less/less/background.png'); } 


Is there a correct way to get around this behavior, provided that within less file, I do not know the direct path to the picture, only a relative.

0 commentaires:

Enregistrer un commentaire

 
© Copyright 2010-2011 GARMOBI All Rights Reserved.
Template Design by Herdiansyah Hamzah | Published by Borneo Templates | Powered by Blogger.com.