I'd like to use my @variable (@variable: "file.less") to import file.less to main .less.
I tried this way:
@var: 'file.less';
@import @var
or this way:
@import "@var"
or:
@import "@{var}"
but it doesn't work.
Any ideas?
The best way to do this is to @import your LESS file with all your variables in it. Here's the syntax for the @import keyword: // For LESS file includes, @import "lib. less"; // or @import "lib"; // infers the .
Defining a variable: Variables in Less are represented with an at (@) sign. We can assign a value using a colon (:).
@imports are handled before @variables, so it won't work.
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