1

I'm just start using Less. I'd like to compile all of the less files to a css file. So I created a less file with that content:

@startup-basePath: '../../ressources/StartupFramework/Developer';
@import '@{startup-basePath}/flat-ui/less/flat-ui.less';

But I get an Error.

FileError: '@{startup-basePath}/flat-ui/less/flat-ui.less' wasn't found...

Well, the path is right. So I tried a different version. I just added the content of the variable to the file.

@startup-basePath: "../../ressources/StartupFramework/Developer";
@import "../../ressources/StartupFramework/Developer/flat-ui/less/flat-ui.less";

And it solved the issue. I successfully compiled the less file. But I need to include lots of less files, so I'd like to use variables for the path.

So can some one help me with this issue? Why do I get the File not Fond error, when I use variables?

user39063
  • 183
  • 1
  • 13
  • First of all make sure your Less compiler does support this feature. Additionaly take into account that the use of variables inside import statements is quite [limited](http://lesscss.org/features/#variables-feature-import-statements). – seven-phases-max Mar 24 '14 at 21:54
  • Thank you, I used the Less.App to compile the Less file. After I switched to the official compiler, I was able to compile the Less text with the variable in the include statement. Thank you for the hint! – user39063 Mar 24 '14 at 23:50
  • possible duplicate of [LESS CSS, @import path from variable](http://stackoverflow.com/questions/10676628/less-css-import-path-from-variable) – Bass Jobsen Oct 04 '14 at 23:44

0 Answers0