How to import inactive files with string interpolation into pathstring?

How to import inactive files with string interpolation into pathstring.

@folder: "LessFiles"; 

I tried this

 @import "@{folder}/file.less"; Error: File Not Found. HTTP GET Url is "%7Bfolder%7D/file.less" 

and this:

 @import formatString("{0}/file.less",@folder); Error: Server throws System.NullReferenceException 

and this:

 @path: "@{folder}/file.less"; @import @path; Error: directive block with unrecognised format on line 16 in file 'test.less': [15]: [16]: @import @path; --------^ [17]: 

Any clues how to solve this?

Thanks!

+7
source share
1 answer

Compared to less than 1.4.0, interpolation variable is possible with @imports

Example

 @bacon: "../bacon"; @import @{bacon}/smokey.less; 

More information can be found here - Less language features of import applications

+1
source

All Articles