Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LESS CSS, @import path from variable

Tags:

css

less

I want to declare a variable with the path to the library:

@libPath: "any/path/to/lib";

And use it in @import. Something like this:

@import "@{libPath}/file.less";

And I see the result after processing:

@import url("@{libPath}/file.less");

No such possibility or am I doing something wrong?

Thanks.

like image 925
Tui Kiken Avatar asked May 20 '12 19:05

Tui Kiken


1 Answers

FWIW this is a bug in less.js that’s been discussed for way over a year now. There are at least two attempts to fix this but one requires large changes to the public API and has consequently been rejected. The other approach only works partially.

On the other hand, lessphp supports this without problem now; I have no idea whether dotless does.

like image 144
Konrad Rudolph Avatar answered Oct 14 '22 10:10

Konrad Rudolph