LESS CSS,@import从变量的路径 [英] LESS CSS, @import path from variable

查看:2190
本文介绍了LESS CSS,@import从变量的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要声明一个变量与库的路径:

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

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

并在 @import 中使用。像这样:

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

我看到处理后的结果:

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

没有这种可能性或我做错了什么?

No such possibility or am I doing something wrong?

感谢。

推荐答案

FWIW 这是一个bug in less.js ,已经讨论了一年多了。有至少两个尝试来解决这个问题,但是一个需要大量更改公共API,因此已被拒绝。 其他方法只有部分功能

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.

另一方面, lessphp现在支持这个问题;我不知道是否有点。

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

这篇关于LESS CSS,@import从变量的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆