How do I import .less files with string interpolation in the 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 tips how to solve this?
Thanks!
As of Less 1.4.0 variable interpolation is possible with @imports
Example
@bacon: "../bacon";
@import @{bacon}/smokey.less;
More information can be found here - Less Language Features import statements
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With