我认为这是不可能的,但我想问一下是否有方法。我的想法是我有一个指向web资源文件夹路径的变量:
@root: "../img/";
@file: "test.css";
@url: @root@file;
.px {
background-image: url(@url);
}
我得到了以下结果:
.px { background-image: url("../img/" "test.css"); }
但是,我希望这些字符串合并成一个字符串,就像这样:
.px { background-image: url("../img/test.css"); }
在Less中是否可以将字符串连接在一起?
px
或%
这样的字符串组合使用的人,这里有一个提示:你可以在字符串前面加上波浪线~
来取消引号,例如:width: ~"@{w}px";
- AsGoodAsItGets