If I am going to import multiple files from the same directory, I'd like to reuse the directory path (assuming the file with the import statements isn't in the same directory as the import targets). So far I've tried this:
@directoryPath: "../modules/core/less/";
@import @directoryPath + "file.less";
@import (@directoryPath + "file.less");
@import @{directoryPath}"file.less";
@import "@{directoryPath}file.less";
@filePath: @directoryPath + "file.less"; //I have verified this produces the proper string
@import @filePath;
@import @{filePath};
None of the 6 import statements work. Some of them work in the
source: url(/*LESS variables*/);
declaration, but don't work the same way in the @import statement. Any ideas on what will work?
See Variables > Variable Interpolation > Import statements in the documentation.
The proper syntax is:
@path: "../modules/core/less/";
@import "@{path}file.less";
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